Commit graph

2215 commits

Author SHA1 Message Date
peter klausler
2075e06dff [flang] Change more empty classes into enums
Original-commit: flang-compiler/f18@e73b0368b2
Reviewed-on: https://github.com/flang-compiler/f18/pull/569
Tree-same-pre-rewrite: false
2019-07-15 13:05:27 -07:00
peter klausler
2d0f9636a8 [flang] Change some empty classes into enums
Original-commit: flang-compiler/f18@652e474556
Reviewed-on: https://github.com/flang-compiler/f18/pull/569
Tree-same-pre-rewrite: false
2019-07-15 13:05:27 -07:00
peter klausler
a3242b8107 [flang] more progress
Original-commit: flang-compiler/f18@1a219e5073
Reviewed-on: https://github.com/flang-compiler/f18/pull/569
Tree-same-pre-rewrite: false
2019-07-15 13:05:26 -07:00
peter klausler
1a26c576de [flang] Eliminate a lot of needless indirection in OMP data structures
Original-commit: flang-compiler/f18@47c6cb0ba9
Reviewed-on: https://github.com/flang-compiler/f18/pull/569
Tree-same-pre-rewrite: false
2019-07-15 13:05:25 -07:00
peter klausler
b85df73935 [flang] Restore alphabetical order to OpenMP nodes in parse tree dumper
Original-commit: flang-compiler/f18@88b1a26035
Reviewed-on: https://github.com/flang-compiler/f18/pull/569
Tree-same-pre-rewrite: false
2019-07-15 13:05:24 -07:00
peter klausler
51b43e9e48 [flang] Define and use OpenMPConstructDirective
Original-commit: flang-compiler/f18@cd716fa907
Reviewed-on: https://github.com/flang-compiler/f18/pull/569
Tree-same-pre-rewrite: false
2019-07-15 13:05:24 -07:00
peter klausler
bdec2cd8c9 [flang] Refinements; builds and passes tests again
Original-commit: flang-compiler/f18@a83410a440
Reviewed-on: https://github.com/flang-compiler/f18/pull/569
Tree-same-pre-rewrite: false
2019-07-15 13:05:23 -07:00
peter klausler
40c797d773 [flang] Add "..."_id token syntax for complete tokens with lookahead
Original-commit: flang-compiler/f18@19695ccfa4
Reviewed-on: https://github.com/flang-compiler/f18/pull/569
Tree-same-pre-rewrite: false
2019-07-15 13:05:22 -07:00
Tim Keith
9bb9352a09 [flang] Merge pull request flang-compiler/f18#567 from flang-compiler/tsk-pass-2
Use passed-object dummy in distinguishability checks

Original-commit: flang-compiler/f18@c87fbc387f
Reviewed-on: https://github.com/flang-compiler/f18/pull/567
2019-07-15 12:45:40 -07:00
Tim Keith
714d3be8bf [flang] Use passed-object dummy in distinguishability checks
Complete the checks for distinguishable specifics procedure in a generic
by considering any passed-object dummy arguments.

C1514 rule 3 is implemented and the checks for the other rules are
extended to consider the PASS attribute, including the concept of the
"effective" position of an argument in an argument list, computed by
ignoring passed-object arguments.

Add `pass` to `characteristics::DummyArgument` to mark each
passed-object dummy argument.

Change symbols to store the index of the passed-object dummy argument
rather than its symbol.

Check that specifics of a type-bound generic are distinguishable only
after all of the procedure bindings have been processed. They don't have
to be before the generic.

Original-commit: flang-compiler/f18@2751490f95
Reviewed-on: https://github.com/flang-compiler/f18/pull/567
2019-07-12 12:18:00 -07:00
Tim Keith
507cc50866 [flang] Add IsGlobal and IsDerivedType to Scope
These are properties of Scopes that are checked frequently
so add IsGlobal and IsDerivedType for convenience.

Original-commit: flang-compiler/f18@aebb2379d7
Reviewed-on: https://github.com/flang-compiler/f18/pull/567
Tree-same-pre-rewrite: false
2019-07-12 12:17:56 -07:00
Jinxin (Brian) Yang
4370b717f0 [flang] Merge pull request flang-compiler/f18#566 from flang-compiler/by-mp-validity
Add missing THREADS and SIMD clauses

Original-commit: flang-compiler/f18@ade72d803d
Reviewed-on: https://github.com/flang-compiler/f18/pull/566
2019-07-11 16:32:34 -07:00
peter klausler
ed2213bb51 [flang] Ensure that no OMP clause is a prefix of a later one in the grammar; then alphabetize the order.
Original-commit: flang-compiler/f18@7f4b4f8e74
Reviewed-on: https://github.com/flang-compiler/f18/pull/566
2019-07-11 15:30:32 -07:00
Jinxin Yang
ca3dc401a9 [flang] add ORDERED construct w/ THREADS and SIMD clauses (parse error)
Original-commit: flang-compiler/f18@23a71aed74
Reviewed-on: https://github.com/flang-compiler/f18/pull/566
Tree-same-pre-rewrite: false
2019-07-11 15:30:32 -07:00
Jinxin (Brian) Yang
800b96540b [flang] Examples of Composite and Combined constructs (flang-compiler/f18#558)
* Examples of Composite and Combined constructs

2.8.3 Loop SIMD Construct
2.11.1 Parallel Loop Construct
2.11.3 Parallel Loop SIMD Construct

Not in the implementation:
2.8.3 DO SIMD: A list item may appear in a linear or firstprivate clause but not both

Original-commit: flang-compiler/f18@75d9c1a081
Reviewed-on: https://github.com/flang-compiler/f18/pull/558
2019-07-11 15:18:09 -07:00
Peter Klausler
b2479a78c6 [flang] Merge pull request flang-compiler/f18#561 from flang-compiler/pmk-fixes
Better name resolution for intrinsics

Original-commit: flang-compiler/f18@33aceaec8f
Reviewed-on: https://github.com/flang-compiler/f18/pull/561
2019-07-11 13:00:21 -07:00
peter klausler
20dd13e492 [flang] Better name resolution for intrinsics
Original-commit: flang-compiler/f18@31fd9c82e9
Reviewed-on: https://github.com/flang-compiler/f18/pull/561
2019-07-11 11:52:47 -07:00
Tim Keith
eb97418b2d [flang] Merge pull request flang-compiler/f18#559 from flang-compiler/tsk-symbols3
Move some functions to semantics/tools.h

Original-commit: flang-compiler/f18@e133247901
Reviewed-on: https://github.com/flang-compiler/f18/pull/559
2019-07-11 08:52:52 -07:00
Tim Keith
cc8e1e9e9f [flang] Change two member functions of DerivedTypeDetails to non-member
In `OrderParameterNames` and `OrderParameterDeclarations` it was
always true that `this == &type.get<DerivedTypeDetails>()` which
meant that `this` was redundant.

So convert them to non-member functions in `tools.h` that get the
details from the symbol passed in. This makes life simpler for the
callers.

Original-commit: flang-compiler/f18@81710d4e6e
Reviewed-on: https://github.com/flang-compiler/f18/pull/559
2019-07-11 08:51:40 -07:00
Tim Keith
c37707a5b1 [flang] Move various Instantiate functions to tools.cc
Move these functions from scope.cc, symbol.cc, type.cc into tools.cc:
  Scope::FindOrInstantiateDerivedType
  Scope::InstantiateDerivedType
  Scope::InstantiateIntrinsicType
  Symbol::Instantiate
  DerivedTypeSpec::ProcessParameterExpressions
  DerivedTypeSpec::Instantiate

This eliminates some dependencies in these files on SemanticsContext,
FoldingContext, etc.

It also allows three of the functions to be private to tools.cc
because they are only called from the others.

Original-commit: flang-compiler/f18@48c6efbf95
Reviewed-on: https://github.com/flang-compiler/f18/pull/559
Tree-same-pre-rewrite: false
2019-07-11 08:51:40 -07:00
Tim Keith
ca06058da8 [flang] Fix formatting
Original-commit: flang-compiler/f18@bef7ddd43b
Reviewed-on: https://github.com/flang-compiler/f18/pull/559
Tree-same-pre-rewrite: false
2019-07-11 08:51:21 -07:00
Peter Klausler
ce1f2174e1 [flang] Merge pull request flang-compiler/f18#557 from flang-compiler/pmk-fixes
Fix name resolution for direct recursion; adjust BOZ arguments to intrinsics.

Original-commit: flang-compiler/f18@537a501f47
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
2019-07-10 16:50:43 -07:00
peter klausler
28f4c5ca2d [flang] Update grammar and a test in light of C1516
Original-commit: flang-compiler/f18@df4ddccde7
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
2019-07-10 16:42:10 -07:00
peter klausler
f7057e031c [flang] Add -fxor-operator
Original-commit: flang-compiler/f18@b8365afc91
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
2019-07-10 16:42:10 -07:00
peter klausler
ef061f3e65 [flang] Update tests
Original-commit: flang-compiler/f18@aa18f1bca5
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
2019-07-10 16:42:09 -07:00
peter klausler
caf9e8e624 [flang] Fix name resolution with directly recursive calls.
Original-commit: flang-compiler/f18@b8e8610430
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
2019-07-10 16:42:09 -07:00
peter klausler
2ccba3837d [flang] Do not emit PROCEDURE(TYPE(REAL)), pgf90 cannot deal. Use PROCEDURE(REAL).
Original-commit: flang-compiler/f18@ee5f392381
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
2019-07-10 16:42:08 -07:00
peter klausler
5842409864 [flang] Document preprocessing of Fortran comments in macro actual args
Original-commit: flang-compiler/f18@f491b73636
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
2019-07-10 16:42:07 -07:00
peter klausler
8ccd6b19c4 [flang] Allow BOZ argument to more intrinsics; generalize BOZ conversions in folding
Original-commit: flang-compiler/f18@6df0136ee8
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
2019-07-10 16:42:06 -07:00
peter klausler
b2b1f045d9 [flang] Remove reference to EUC_JP from test
Original-commit: flang-compiler/f18@ca5c812994
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
2019-07-10 16:42:05 -07:00
peter klausler
03f5723cb6 [flang] Update extension documentation
Original-commit: flang-compiler/f18@40b44b2e3a
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
2019-07-10 16:42:05 -07:00
psteinfeld
0ddcf62681 [flang] Merge pull request flang-compiler/f18#551 from flang-compiler/ps-shared-locality
Enabling automatic declaration of names in SHARED locality-spec's

Original-commit: flang-compiler/f18@b553d3857c
Reviewed-on: https://github.com/flang-compiler/f18/pull/551
2019-07-10 13:02:52 -07:00
Peter Steinfeld
542264e519 [flang] Improved warning message base on feedback from Peter.
Original-commit: flang-compiler/f18@030f364324
Reviewed-on: https://github.com/flang-compiler/f18/pull/551
2019-07-10 12:53:56 -07:00
Peter Steinfeld
18f2628287 [flang] Changed the warning as recommended.
Original-commit: flang-compiler/f18@7887331705
Reviewed-on: https://github.com/flang-compiler/f18/pull/551
Tree-same-pre-rewrite: false
2019-07-10 12:53:56 -07:00
Peter Steinfeld
66e8935dec [flang] Changes related to feedback from pull request flang-compiler/f18#551
- Changed the name a a function to FindOrDeclareEnclosingEntity
 - Changed that function to return a reference rather than a pointer
 - Polished the setting of the IMPLICIT flag on a declared entity in a
 locality-spec
 - Changed a test to remove an unreported error

Original-commit: flang-compiler/f18@0c1a00d7c2
Reviewed-on: https://github.com/flang-compiler/f18/pull/551
Tree-same-pre-rewrite: false
2019-07-10 12:53:56 -07:00
Peter Steinfeld
2ce7432bb8 [flang] Enabling automatic declaration of names in SHARED locality-spec's
Prior to this change, the compiler issued an error message when a name in a
SHARED locality-spec had not been declared explicitly in an enclosing scope.
Presumably, this was done to enforce constraint C1124.  This constraint states
that "A variable-name in a locality-spec shall be the name of a variable in the
innermost executable construct or scoping unit that includes the DO CONCURRENT
statement".  For LOCAL and LOCAL_INIT locality-spec's, we were automatically
creating a local variable in the situation where one had not been explicitly
declared rather than issuing an error message.

The only compiler I could find that implements the SHARED locality-spec was the
PGI compiler, which automatically creates a variable and does not emit an error
message.  Also, @vdonaldson said that he had consulted with a member of the
Fortran standards committee who said that the correct thing was to create a
variable if necessary.

This change has the compiler creating a variable in the enclosing scope of a DO
CONCURRENT statement if necessary.  I also changed a test to adapt to the new
behavior.  I also consolidated the semantic checking for the constraints
associated with all of the locality-spec's.

Original-commit: flang-compiler/f18@d9253a76fc
Reviewed-on: https://github.com/flang-compiler/f18/pull/551
Tree-same-pre-rewrite: false
2019-07-10 12:53:55 -07:00
Jinxin (Brian) Yang
0f8e792455 [flang] 2.8.1 SIMD structural checks (flang-compiler/f18#554)
Straightforward implementation but not including:
* list-item on aligned clause
* nesting check with the ordered construct (parse tree changes needed!)
* list-item attributes check on aligned clause

Original-commit: flang-compiler/f18@cf04d8ad26
Reviewed-on: https://github.com/flang-compiler/f18/pull/554
2019-07-09 14:08:50 -07:00
Peter Klausler
9b73091758 [flang] Merge pull request flang-compiler/f18#553 from flang-compiler/pmk-fixes
Support "*length" character length specifier on declarations, plus a couple small fixes.

Original-commit: flang-compiler/f18@afe12f7f4b
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
2019-07-08 16:16:55 -07:00
peter klausler
008e697192 [flang] Fix regressions found in testing
Original-commit: flang-compiler/f18@ea09b191df
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
2019-07-08 16:02:50 -07:00
peter klausler
644b2aabd0 [flang] Support *length character length specifiers
Original-commit: flang-compiler/f18@874b13b7d8
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
2019-07-08 14:07:56 -07:00
peter klausler
7a6dabf974 [flang] Resolve merge
Original-commit: flang-compiler/f18@44743f1fa9
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
2019-07-08 10:44:43 -07:00
peter klausler
626a4cfdfc [flang] Document non-standard use of larger INTEGER for sizes
Original-commit: flang-compiler/f18@edc79c4257
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
2019-07-08 10:44:14 -07:00
peter klausler
cc2172b6f4 [flang] Fix multi-file compilations in throwaway driver
Original-commit: flang-compiler/f18@7954d0aecf
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
2019-07-08 10:43:42 -07:00
peter klausler
e05f539917 [flang] Crash less
Original-commit: flang-compiler/f18@e8ac1a697d
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
2019-07-03 16:00:26 -07:00
peter klausler
d1de4fe462 [flang] Avoid null pointer dereference
Original-commit: flang-compiler/f18@3c108c0edc
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
2019-07-03 16:00:25 -07:00
Tim Keith
6b8df08cad [flang] Merge pull request flang-compiler/f18#550 from flang-compiler/tsk-bug
Prevent segfault in DynamicType::IsTkCompatibleWith

Original-commit: flang-compiler/f18@8ff0df020b
Reviewed-on: https://github.com/flang-compiler/f18/pull/550
2019-07-03 15:54:27 -07:00
Tim Keith
0386490751 [flang] Prevent segfault in DynamicType::IsTkCompatibleWith
Make sure `derived_` is not null before dereferencing it.

This might only happen when there is a previous error. I saw it
compiling a test program where a USEd module was not found.

Original-commit: flang-compiler/f18@2db516556b
Reviewed-on: https://github.com/flang-compiler/f18/pull/550
2019-07-03 15:47:37 -07:00
psteinfeld
8d8a867b83 [flang] Merge pull request flang-compiler/f18#542 from flang-compiler/ps-c1128
Enforce constraint C1128 for DO CONCURRENT locality-spec's

Original-commit: flang-compiler/f18@248600031d
Reviewed-on: https://github.com/flang-compiler/f18/pull/542
2019-07-03 14:28:49 -07:00
Peter Steinfeld
5b7b8866b8 [flang] Improved the implementation of "IsCoarray()" suggested by @tskeith.
Original-commit: flang-compiler/f18@efaf5fca2e
Reviewed-on: https://github.com/flang-compiler/f18/pull/542
2019-07-03 13:59:44 -07:00
Peter Steinfeld
02a395dcb7 [flang] Changes in response to comments on pull request flang-compiler/f18#542.
Original-commit: flang-compiler/f18@e156f977d8
Reviewed-on: https://github.com/flang-compiler/f18/pull/542
Tree-same-pre-rewrite: false
2019-07-03 13:50:57 -07:00