Commit Graph

101 Commits

Author SHA1 Message Date
peter klausler
f0ffc690d5 [flang] Fix parsing of WRITE(I+J) with more accurate look-ahead
The parsing of I/O units uses look-ahead to discriminate between
keywords, variables and expressions as part of distinguishing internal
from external I/O.  The look-ahead was inaccurate for variables that
appear as the initial parts of expressions.

Differential Revision: https://reviews.llvm.org/D95743
2021-02-01 09:07:40 -08:00
peter klausler
6110e7716c [flang] Search for #include "file" in right directory (take 2)
Make the #include "file" preprocessing directive begin its
search in the same directory as the file containing the directive,
as other preprocessors and our Fortran INCLUDE statement do.

Avoid current working directory for all source files except the original.

Resolve tests.

Differential Revision: https://reviews.llvm.org/D95481
2021-01-27 15:41:29 -08:00
Andrzej Warzynski
e878589098 Revert "[flang] Search for #include "file" in right directory"
This reverts commit d987b61b1d.

As pointed out in https://reviews.llvm.org/D95388, the reverted commit
causes build failures in the following Flang buildbots:
  * http://lab.llvm.org:8011/#/builders/32/builds/2642
  * http://lab.llvm.org:8011/#/builders/33/builds/2131
  * http://lab.llvm.org:8011/#/builders/135/builds/1473
  * http://lab.llvm.org:8011/#/builders/66/builds/1559
  * http://lab.llvm.org:8011/#/builders/134/builds/1409
  * http://lab.llvm.org:8011/#/builders/132/builds/1817
I'm guessing that the patch was only tested with
`FLANG_BUILD_NEW_DRIVER=Off` (i.e. the default). The builders listed
above set `FLANG_BUILD_NEW_DRIVER` to `On`.

Although fixing the build is relatively easy, the reverted patch
modifies the behaviour of the frontend, which breaks driver tests. In
particular, in https://reviews.llvm.org/D93453 support for `-I` was
added that depends on the current behaviour. The reverted patch
changes that behaviour. Either the tests have to be updated or the
change fine-tuned.
2021-01-26 13:07:14 +00:00
peter klausler
d987b61b1d [flang] Search for #include "file" in right directory
Make the #include "file" preprocessing directive begin its
search in the same directory as the file containing the directive,
as other preprocessors and our Fortran INCLUDE statement do.

Avoid current working directory for all source files after the original.

Differential Revision: https://reviews.llvm.org/D95388
2021-01-25 13:39:37 -08:00
Valentin Clement
6bd0a4451c [flang][directive] Get rid of flangClassValue in TableGen
The TableGen emitter for directives has two slots for flangClass information and this was mainly
to be able to keep up with the legacy openmp parser at the time. Now that all clauses are encapsulated in
AccClause or OmpClause, these two strings are not necessary anymore and were the the source of couple
of problem while working with the generic structure checker for OpenMP.
This patch remove the flangClassValue string from DirectiveBase.td and use the string flangClass as the
placeholder for the encapsulated class.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D94821
2021-01-19 10:28:46 -05:00
Valentin Clement
ca98baa042 [openacc] Rename generated file from ACC.cpp.inc to ACC.inc to match D92955
This patch rename the tablegen generated file ACC.cpp.inc to ACC.inc in order
to match what was done in D92955. This file is included in header file as well as .cpp
file so it make more sense.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D93485
2021-01-14 14:19:53 -05:00
Valentin Clement
4d0aad96e4 [flang][openmp] Make Reduction clause part of OmpClause
After discussion in D93105 we found that the reduction clause was not following
the common OmpClause convention. This patch makes reduction clause part of OmpClause
with a value of OmpReductionClause in a similar way than task_reduction.
The unparse function for OmpReductionClause is adapted since the keyword and parenthesis
are issued by the corresponding unparse function for parser::OmpClause::Reduction.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D93482
2021-01-04 15:19:00 -05:00
sameeran joshi
6280bc1cc3 [Flang][openmp][5.0] Add task_reduction clause.
See OMP-5.0 2.19.5.5 task_reduction Clause.
To add a positive test case we need `taskgroup` directive which is not added hence skipping the test.
This is a dependency for `taskgroup` construct.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D93105

Co-authored-by: Valentin Clement <clementval@gmail.com>
2021-01-04 08:48:11 +05:30
sameeran joshi
1aa10ab2e1 Revert "[Flang][openmp][5.0] Add task_reduction clause."
This reverts commit 9a7895dc20.
Reverting due to missing Co-author attribution.

https://reviews.llvm.org/D93105
2020-12-22 23:53:51 +05:30
sameeran joshi
9a7895dc20 [Flang][openmp][5.0] Add task_reduction clause.
See OMP-5.0 2.19.5.5 task_reduction Clause.
To add a positive test case we need `taskgroup` directive which is not added hence skipping the test.
This is a dependency for `taskgroup` construct.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D93105
2020-12-22 22:34:38 +05:30
sameeran joshi
1a6f43991f [Flang][openmp][5/5] Make dist_schedule clause part of OmpClause
After discussion in `D93482` we found that the some of the clauses were not
following the common OmpClause convention.

The benefits of using OmpClause:
- Functionalities from structure checker are mostly aligned to work with
  `llvm::omp::Clause`.
- The unparsing as well can take advantage.
- Homogeneity with OpenACC and rest of the clauses in OpenMP.
- Could even generate the parser with TableGen, when there is homogeneity.
- It becomes confusing when to use `flangClass` and `flangClassValue` inside
  TableGen, if incase we generate parser using TableGen we could have only a
  single `let expression`.

This patch makes `OmpDistScheduleClause` clause part of `OmpClause`.
The unparse function for `OmpDistScheduleClause` is adapted since the keyword
and parenthesis are issued by the corresponding unparse function for
`parser::OmpClause::DistSchedule`.

Reviewed By: clementval, kiranktp

Differential Revision: https://reviews.llvm.org/D93644
2020-12-22 14:32:33 +05:30
sameeran joshi
e282ae57da [Flang][openmp][4/5] Make nowait clause part of OmpClause
After discussion in `D93482` we found that the some of the clauses were not
following the common OmpClause convention.

The benefits of using OmpClause:
- Functionalities from structure checker are mostly aligned to work with
  `llvm::omp::Clause`.
- The unparsing as well can take advantage.
- Homogeneity with OpenACC and rest of the clauses in OpenMP.
- Could even generate the parser with TableGen, when there is homogeneity.
- It becomes confusing when to use `flangClass` and `flangClassValue` inside
  TableGen, if incase we generate parser using TableGen we could have only a
  single `let expression`.

This patch makes `OmpNoWait` clause part of `OmpClause`.

Reviewed By: clementval, kiranktp

Differential Revision: https://reviews.llvm.org/D93643
2020-12-22 14:02:19 +05:30
sameeran joshi
34958d11c3 [Flang][openmp][3/5] Make ProcBind clause part of OmpClause
After discussion in `D93482` we found that the some of the clauses were not
following the common OmpClause convention.

The benefits of using OmpClause:
- Functionalities from structure checker are mostly aligned to work with
  `llvm::omp::Clause`.
- The unparsing as well can take advantage.
- Homogeneity with OpenACC and rest of the clauses in OpenMP.
- Could even generate the parser with TableGen, when there is homogeneity.
- It becomes confusing when to use `flangClass` and `flangClassValue` inside
  TableGen, if incase we generate parser using TableGen we could have only a
  single `let expression`.

This patch makes `OmpProcBindClause` clause part of `OmpClause`.
The unparse function is dropped as the unparsing is done by `WALK_NESTED_ENUM`
for `OmpProcBindClause`.

Reviewed By: clementval, kiranktp

Differential Revision: https://reviews.llvm.org/D93642
2020-12-22 13:40:38 +05:30
sameeran joshi
f72c384b5b [Flang][openmp][2/5] Make Default clause part of OmpClause
After discussion in `D93482` we found that the some of the clauses were not
following the common OmpClause convention.

The benefits of using OmpClause:
- Functionalities from structure checker are mostly aligned to work with
  `llvm::omp::Clause`.
- The unparsing as well can take advantage.
- Homogeneity with OpenACC and rest of the clauses in OpenMP.
- Could even generate the parser with TableGen, when there is homogeneity.
- It becomes confusing when to use `flangClass` and `flangClassValue` inside
  TableGen, if incase we generate parser using TableGen we could have only a
  single `let expression`.

This patch makes `OmpDefaultClause` clause part of `OmpClause`.
The unparse function is dropped as the unparsing is done by `WALK_NESTED_ENUM`
for `OmpDefaultClause`.

Reviewed By: clementval, kiranktp

Differential Revision: https://reviews.llvm.org/D93641
2020-12-22 13:17:44 +05:30
sameeran joshi
442aac5da6 [Flang][openmp][1/5] Make Allocate clause part of OmpClause
After discussion in `D93482` we found that the some of the clauses were not
following the common OmpClause convention.

The benefits of using OmpClause:
- Functionalities from structure checker are mostly aligned to work with
  `llvm::omp::Clause`.
- The unparsing as well can take advantage.
- Homogeneity with OpenACC and rest of the clauses in OpenMP.
- Could even generate the parser with TableGen, when there is homogeneity.
- It becomes confusing when to use `flangClass` and `flangClassValue` inside
  TableGen, if incase we generate parser using TableGen we could have only a
  single `let expression`.

This patch makes `allocate` clause part of `OmpClause`.The unparse function for
`OmpAllocateClause` is adapted since the keyword and parenthesis are issued by
the corresponding unparse function for `parser::OmpClause::Allocate`.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D93640
2020-12-22 12:53:34 +05:30
Valentin Clement
8f933a4e93 [openacc] Use TableGen enum for default clause value
Use the TableGen feature to have enum values for clauses.
Next step will be to extend the MLIR part used currently by OpenMP
to use the same enum on the dialect side.

This patch also add function that convert the enum to StringRef to be
used on the dump-parse-tree from flang.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D93576
2020-12-21 15:07:27 -05:00
Valentin Clement
f4c8b80318 [openmp] Remove clause from OMPKinds.def and use OMP.td info
Remove the OpenMP clause information from the OMPKinds.def file and use the
information from the new OMP.td file. There is now a single source of truth for the
directives and clauses.

To avoid generate lots of specific small code from tablegen, the macros previously
used in OMPKinds.def are generated almost as identical. This can be polished and
possibly removed in a further patch.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D92955
2020-12-17 14:08:12 -05:00
Valentin Clement
71699a998d [flang][openacc] Enforce restriction on routine directive and clauses
This patch add some checks for the restriction on the routine directive
and fix several issue at the same time.

Validity tests have been added in a separate file than acc-clause-validity.f90 since this one
became quite large. I plan to split the larger file once on-going review are done.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D92672
2020-12-17 11:33:34 -05:00
peter klausler
9a883bfa11 [flang] Clean up TODO comments and fix one (DATA constant ambiguity)
Remove resolved & moot TODO comments in Common/, Parser/,
and Evaluate/.  Address a pending one relating to parsing
ambiguity in DATA statement constants, handling it with
symbol table information in Semantics and adding a test.

Differential Revision: https://reviews.llvm.org/D93323
2020-12-15 13:36:07 -08:00
sameeran joshi
f1569b1ece [Flang][OpenMP-5.0] Semantic checks for flush construct.
From OMP 5.0 [2.17.8]
Restriction:
If memory-order-clause is release,acquire, or acq_rel, list items must not be specified on the flush directive.

Reviewed By: kiranchandramohan, clementval

Differential Revision: https://reviews.llvm.org/D89879
2020-12-14 13:30:48 +05:30
sameeran joshi
e43b3b08cc [Flang][OpenMP] Semantic checks for Atomic construct.
Patch implements restrictions from 2.17.7  of OpenMP 5.0 standard for atomic Construct. Tests for the same are added.

One of the restriction
`OpenMP constructs may not be encountered during execution of an atomic region.`
Is mentioned in 5.0 standard to be a semantic restriction, but given the stricter nature of parser in F18 it's caught at parsing itself.

This patch is a next patch in series from D88965.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D89583
2020-12-14 13:03:57 +05:30
Irina Dobrescu
c9e967af3f [flang]Add Parser Support for Allocate Directive
Differential Revision: https://reviews.llvm.org/D89562
2020-12-10 16:21:19 +00:00
Valentin Clement
d553243fe4 [flang][openacc] Update reference to OpenACC 3.1 specification
Update all reference from the specification to the new OpenACC 3.1
document.

Reviewed By: SouraVX

Differential Revision: https://reviews.llvm.org/D92120
2020-12-08 14:36:38 -05:00
Valentin Clement
1dd24e6ab7 [flang][openacc] Add clause validity tests for the update directive
Add couple of clause validity tests for the update directive and check for
the restriction where at least self, host or device clause must appear on the directive.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D92447
2020-12-08 10:47:06 -05:00
peter klausler
641ede93ef [flang] Improve initializer semantics, esp. for component default values
This patch plugs many holes in static initializer semantics, improves error
messages for default initial values and other component properties in
parameterized derived type instantiations, and cleans up several small
issues noticed during development.  We now do proper scalar expansion,
folding, and type, rank, and shape conformance checking for component
default initializers in derived types and PDT instantiations.
The initial values of named constants are now guaranteed to have been folded
when installed in the symbol table, and are no longer folded or
scalar-expanded at each use in expression folding.  Semantics documentation
was extended with information about the various kinds of initializations
in Fortran and when each of them are processed in the compiler.

Some necessary concomitant changes have bulked this patch out a bit:
* contextual messages attachments, which are now produced for parameterized
  derived type instantiations so that the user can figure out which
  instance caused a problem with a component, have been added as part
  of ContextualMessages, and their implementation was debugged
* several APIs in evaluate::characteristics was changed so that a FoldingContext
  is passed as an argument rather than just its intrinsic procedure table;
  this affected client call sites in many files
* new tools in Evaluate/check-expression.cpp to determine when an Expr
  actually is a single constant value and to validate a non-pointer
  variable initializer or object component default value
* shape conformance checking has additional arguments that control
  whether scalar expansion is allowed
* several now-unused functions and data members noticed and removed
* several crashes and bogus errors exposed by testing this new code
  were fixed
* a -fdebug-stack-trace option to enable LLVM's stack tracing on
  a crash, which might be useful in the future

TL;DR: Initialization processing does more and takes place at the right
times for all of the various kinds of things that can be initialized.

Differential Review: https://reviews.llvm.org/D92783
2020-12-07 14:40:41 -08:00
clementval
952c9d3a91 [NFC] Fix typo in atomic 2020-11-21 14:32:31 -05:00
Valentin Clement
aa179d8099 [flang][openmp] Separate memory-order-clause parser creating OmpClause node
This patch introduce the separate parser for the memory-order-clause from the general
OmpClauseList. This parser still creates OmpClause node and therefore can use all the feature
from TableGen and the OmpStructureChecker.
This is applied only for the Flush construct in this patch and it should be applied for
atomic as well.

This is the approach we disscussed several time during the weekly call.

Reviewed By: kiranchandramohan, sameeranjoshi

Differential Revision: https://reviews.llvm.org/D91839
2020-11-21 14:31:33 -05:00
sameeran joshi
42ecf188b5 [flang][openmp] Fix bug in OmpClause::Hint clause which was missing to generate inside in OMP.cpp.inc file.
Before this patch "Hint" isn't found inside the generated file.
./bin/llvm-tblgen --gen-directive-gen ../llvm-project/llvm/include/llvm/Frontend/OpenMP/OMP.td -I ../llvm-project/llvm/include/ > OMP.cpp.in

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D91909
2020-11-21 19:02:34 +05:30
peter klausler
5349f99114 [flang] Correct handling of null pointer initializers
Fortran defines "null-init" null pointer initializers as
being function references, syntactically, that have to resolve
to calls to the intrinsic function NULL() with no actual
arguments.

Differential revision: https://reviews.llvm.org/D91657
2020-11-18 13:57:25 -08:00
peter klausler
6c516cda39 [flang] Recognize END FILE as ENDFILE in free form source
The ENDFILE statement may be spelled as two words.

Differential revision: https://reviews.llvm.org/D91377
2020-11-12 12:46:04 -08:00
peter klausler
cc575dd2ce [flang][MSVC] Use list<Message> rather than forward_list<> in Messages
The implementation of Messages with forward_list<> makes some
nonstandard assumptions about the validity of iterators that don't
hold up with MSVC's implementation.  Use list<> instead.  The
measured performance is comparable.

This change obviated a distinction between two member functions
of Messages, and the uses of one have been replaced with calls
to the other.

Similar usage in CharBuffer was also replaced for consistency.

Differential revision: https://reviews.llvm.org/D91210
2020-11-11 16:38:38 -08:00
peter klausler
4acd8f7f0a [flang] Detect and rewrite ambiguous READ(CVAR)[,item-list]
READ(CVAR)[,item-list] with a character variable CVAR
could be parsed as an unformatted READ from an internal
unit or as a formatted READ from the default external unit
with a needlessly parenthesized variable format.  We parse
it as the former, but Fortran doesn't have unformatted
internal I/O.

Differential revision: https://reviews.llvm.org/D90493
2020-10-30 15:47:28 -07:00
Valentin Clement
990222931b [flang][openacc] Fix ambiguity in the self clause parsing
In the OpenACC specification, there are two different self clause. One for the
update directive with a var-list argument. This clause is a synonym of the host clause.
The second self clause is present for most of the compute construct and takes an optional
condition. To solve this ambiguity, the self clause for the update directive is directly
translated to a host clause during the parsing. The self clause in AccClause refers always
to the compute construct clause.

Reviewed By: kiranktp

Differential Revision: https://reviews.llvm.org/D90185
2020-10-27 21:10:00 -04:00
Michael Kruse
b57937861f [flang][windows] Support platform-specific path separator.
Remove the assumption that the path separator is `/`. Use functions from `llvm::sys::path` instead.

Reviewed By: isuruf, klausler

Differential Revision: https://reviews.llvm.org/D89369
2020-10-23 22:22:37 -05:00
Valentin Clement
676ff75d60 [flang][openacc] Fix semantic check for wait and atomic directives
wait and atomic directives are represented by OpenACCWaitConstruct, OpenACCAtmicConstruct in the parser. Those contrsuct were
not taken into account in the semantic check so far.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D88628
2020-10-23 10:31:50 -04:00
sameeran joshi
d95d3d2a42 [Flang][OpenMP] Rework parser changes for OpenMP atomic construct.
`OmpStructureChecker` is supposed to work only with `parser::OmpClause`
after tablegen changes for OpenMP and OpenACC were introduced.
Hence `OmpMemoryOrderClause`, `OmpAtomicMemoryOrderClause` and similar ones were failing
to catch semantic errors, inspite of having code for semantic checks.
This patch tries to change parser for `OmpMemoryOrderClause` and similar dependent ones
and use `OmpClauseList` which resides/comes from common tablegen for OpenMP/OpenACC eventually using `parser::OmpClause`.

This patch also tries to :
1. Change `OmpCriticalDirective` in `openmp-parsers.cpp` to support `OmpClauseList`.
2. Check-flang regresses when changes were introduced due to missing semantic checks in OmpCritical, patch implements them at the minimal level to pass the regression.
3. Change tablegen to support Hint clause.
4. Adds missing source locations `CharBlock Source` in each atomic construct.
5. Remove dead code realted to `memory-order-clauses` after moving to `OmpClauseList`.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D88965
2020-10-14 14:19:49 +05:30
peter klausler
3e86eda18c [flang] Allow "name: value" in compiler directives
Some legacy compiler directives use colons rather than
equals signs.

Differential revision: https://reviews.llvm.org/D89017
2020-10-08 10:01:37 -07:00
Valentin Clement
2f40e20613 [flang][openacc] Fix device_num and device_type clauses for init directive
This patch fix the device_num and device_type clauses used in the init clause. device_num was not
spelled correctly in the parser and was to restrictive with scalarIntConstantExpr instead of scalarIntExpr.
device_type is now taking a list of ScalarIntExpr.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D88571
2020-10-06 21:27:01 -04:00
Valentin Clement
91b49fc257 [flang][openacc] Fix unparsing of combined construct (bug 47659)
This patch fixes the bug report in https://bugs.llvm.org/show_bug.cgi?id=47659

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D88597
2020-10-01 10:35:06 -04:00
Michael Kruse
97ca41e1dd [flang][msvc] Add explicit function template argument to applyLamda. NFC.
Like in D87961, msvc has difficulties deducing the template argument. The error message is:
```
expr-parsers.cpp(383): error C2672: 'applyLambda': no matching overloaded function found
```
Explicitly pass the first template argument to help it.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: DavidTruby

Differential Revision: https://reviews.llvm.org/D88001
2020-09-22 14:22:08 -05:00
Michael Kruse
2bc589bbb8 [flang][msvc] Add explicit function template argument to applyFunction. NFC.
Msvc has difficulties deducing the template argument here. The error message is:
```
basic-parsers.h(790,12): error C2672: 'applyFunction': no matching overloaded function found
```
Explicitly pass the first template argument to help it.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: DavidTruby

Differential Revision: https://reviews.llvm.org/D87961
2020-09-22 14:22:08 -05:00
serge-sans-paille
2a77441117 Do not dereference an array out of bound just to take its address
This is UB by the standard, and caught by the libstdc++ asserts

Differential Revision: https://reviews.llvm.org/D87892
2020-09-21 12:08:30 +02:00
peter klausler
01def7f7c3 [flang] Rework preprocessing of stringification
Hew more closely to the C17 standard; perform macro replacement
of arguments to function-like macros unless they're being stringified
or pasted.  Test with a model "assert" macro idiom that exposed
the problem.

Differential Revision: https://reviews.llvm.org/D87650
2020-09-18 10:45:57 -07:00
Michael Kruse
dee4686227 [flang][msvc] Work around if constexpr (false) evaluation. NFC.
MSVC tries to expand templates that are in the false-branch of a `if constexpr` construct. In this case, the condition checks whether a tuple has at least one element and then is trying to access it using `std::get<0>`, which fails when the tuple has 0 elements.

The workaround is to extract that case into a separate method.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D87728
2020-09-16 15:01:39 -05:00
peter klausler
4706880f06 [flang] Allow Fortran comments after #include path
C-style /*comments*/ are removed during preprocessing directive
tokenization, but Fortran !comments need to be specifically
allowed.

Fixes LLVM bugzilla 47466.

Differential Revision: https://reviews.llvm.org/D87638
2020-09-14 16:58:14 -07:00
peter klausler
5881bf0050 [flang] More clean-up of CookedSource API
The std::string holding the content of a CookedSource no longer
needs to be exposed in its API after the recent work that allows
the parsing context to hold multiple instances of a CookedSource.
So clean the API.  These changes were extracted from some work in
progress that was made easier by the API changes.

Differential Revision: https://reviews.llvm.org/D87635
2020-09-14 14:51:55 -07:00
Kiran Kumar T P
4536c6acb3 [flang][OpenMP] Enhance parser support for atomic construct to OpenMP 5.0
Summary:
This patch enhances parser support for atomic construct to OpenMP 5.0.
2.17.7 atomic -> ATOMIC [clause [,]] atomic-clause [[,] clause] |
                 ATOMIC [clause]
       clause -> memory-order-clause | HINT(hint-expression)
       memory-order-clause -> SEQ_CST | ACQ_REL | RELEASE | ACQUIRE | RELAXED
       atomic-clause -> READ | WRITE | UPDATE | CAPTURE

The patch includes code changes and testcase modifications.

Reviewed By: DavidTruby, kiranchandramohan, sameeranjoshi

Differential Revision: https://reviews.llvm.org/D82931
2020-09-08 06:52:07 +05:30
peter klausler
c963757783 [flang] Implement nonstandard OPEN statement CARRIAGECONTROL specifier
Differential Revision: https://reviews.llvm.org/D87052
2020-09-02 13:07:45 -07:00
peter klausler
92a5419786 [flang] Support multiple CookedSource instances
These are owned by an instance of a new class AllCookedSources.

This removes the need for a Scope to own a string containing
a module's cooked source stream, and will enable errors to be
emitted when parsing module files in the future.

Differential Revision: https://reviews.llvm.org/D86891
2020-09-02 10:34:23 -07:00
Valentin Clement
832c8a7298 [flang][openacc] Fix gang-argument parsing and add validity tests for !$acc loop
This patch fix the prasing for the gang-arg values for the gang clause. It also adds
some clause validity tests for the loop construct.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D86584
2020-08-27 22:33:05 -04:00