Commit graph

872 commits

Author SHA1 Message Date
peter klausler
a62636f634 [flang] debug initial intrinsic table probes
Original-commit: flang-compiler/f18@dce9a1e173
Reviewed-on: https://github.com/flang-compiler/f18/pull/212
Tree-same-pre-rewrite: false
2018-10-12 16:02:34 -07:00
peter klausler
cb308d32a1 [flang] error messages
Original-commit: flang-compiler/f18@392a733073
Reviewed-on: https://github.com/flang-compiler/f18/pull/212
Tree-same-pre-rewrite: false
2018-10-12 16:02:33 -07:00
peter klausler
75a32097fd [flang] checkpoint
Original-commit: flang-compiler/f18@e103152671
Reviewed-on: https://github.com/flang-compiler/f18/pull/212
Tree-same-pre-rewrite: false
2018-10-12 16:02:31 -07:00
peter klausler
a70f596719 [flang] intrinsic pattern matching
Original-commit: flang-compiler/f18@ca0ee1660a
Reviewed-on: https://github.com/flang-compiler/f18/pull/212
Tree-same-pre-rewrite: false
2018-10-12 16:02:30 -07:00
peter klausler
b22d494357 [flang] buildable checkpoint before merging with master
Original-commit: flang-compiler/f18@78c5b8c411
Reviewed-on: https://github.com/flang-compiler/f18/pull/212
Tree-same-pre-rewrite: false
2018-10-12 16:02:29 -07:00
peter klausler
42b33da129 [flang] initial intrinsics table
Original-commit: flang-compiler/f18@8b5c3adf88
Reviewed-on: https://github.com/flang-compiler/f18/pull/212
Tree-same-pre-rewrite: false
2018-10-12 16:02:28 -07:00
Tim Keith
edf9eec265 [flang] More miscellaneous name resolution
Resolve the index name in a FORALL, DO, or DO CONCURRENT.

Handle pointer-stmt. Add DeclareUnknownEntity() to declare an entity
that is not yet know to be an object or procedure. This is used in the
EntityDecl and PointerDecl cases.

When an array element assignment is mistakenly parsed as a statement
function, ensure the index names are resolved.

Detect erroneous use-association with local name that matches the name
of the containing subprogram.

Cleanup: Eliminate GetVariableName() and CheckImplicitSymbol() in favor
of using the Resolve* functions consistently. Add ResolveName() to do
what CheckImplicitSymbol() used to do.

Disable warnings about unresolved names for some categories of
constructs that are not yet implemented: common blocks, namelist
statements, etc. These will be turned back on when they are implemented.

Original-commit: flang-compiler/f18@9a41bf37fd
Reviewed-on: https://github.com/flang-compiler/f18/pull/210
2018-10-10 16:20:46 -07:00
Tim Keith
7db04a4c05 [flang] Check conflicting construct names
Check that construct names don't conflict with other construct names or
entities in the same scoping unit.

This requires adding symbols for them. MiscDetails was added for cases
like this where we don't need to save much information about the symbol.
References to construct names are recorded too, so those names are now
expected to be resolved and no longer are exceptions in rewrite-parse-tree.cc

Checking that construct names match is still done in resolve-labels.cc.

Original-commit: flang-compiler/f18@0ad79ff029
Reviewed-on: https://github.com/flang-compiler/f18/pull/210
Tree-same-pre-rewrite: false
2018-10-10 16:05:00 -07:00
peter klausler
884d9057d0 [flang] Prep for review
Original-commit: flang-compiler/f18@a9439ee83c
Reviewed-on: https://github.com/flang-compiler/f18/pull/209
2018-10-10 15:27:17 -07:00
peter klausler
fa671ab542 [flang] Remove some obsolete casts now that Integer has a better constructor
Original-commit: flang-compiler/f18@f9a4a8bdda
Reviewed-on: https://github.com/flang-compiler/f18/pull/209
Tree-same-pre-rewrite: false
2018-10-10 15:01:12 -07:00
peter klausler
a10f6000b0 [flang] Fix issue#202 by avoiding clang+BSD/Darwin header bug
Original-commit: flang-compiler/f18@1bdefe528a
Reviewed-on: https://github.com/flang-compiler/f18/pull/209
Tree-same-pre-rewrite: false
2018-10-10 15:01:10 -07:00
Paul Henning
3712060d2e [flang] Removed obsolete comments and conversions
The addition of a more robust Integer constructor for POD types has
made some comments and static_cast expressions obsolete.

Original-commit: flang-compiler/f18@847b8a7684
Reviewed-on: https://github.com/flang-compiler/f18/pull/208
2018-10-10 14:43:21 -07:00
peter klausler
4bdb76af0b [flang] Make conversions between C++ integral types and Integer fully generic.
Original-commit: flang-compiler/f18@bf753a183d
Reviewed-on: https://github.com/flang-compiler/f18/pull/206
2018-10-10 13:21:46 -07:00
Tim Keith
03435d981d [flang] Use fundamental types in overloadings of Unparse.
Different systems map std::size_t, string::size_type, etc. to different
fundamental types. To ensure they are all covered, make the overloadings
of Unparse for integer types use only fundamental types.

This fixes compilations problems on Darwin and *BSD systems.

Original-commit: flang-compiler/f18@5576ed49a2
Reviewed-on: https://github.com/flang-compiler/f18/pull/205
2018-10-10 07:24:27 -07:00
Eric Schweitz
ee7b4dafde [flang] Build the label stack locally and thread the iterators explicitly rather
than as implied state within the Mutator object.

Original-commit: flang-compiler/f18@ae2adeab34
Reviewed-on: https://github.com/flang-compiler/f18/pull/203
2018-10-05 13:59:43 -07:00
Eric Schweitz
98ed7d037b [flang] Use move semantics directly to move the LoopControl object.
Original-commit: flang-compiler/f18@7d646b42bb
Reviewed-on: https://github.com/flang-compiler/f18/pull/203
Tree-same-pre-rewrite: false
2018-10-05 11:10:47 -07:00
peter klausler
b64a39e1ea [flang] Prep for review
Original-commit: flang-compiler/f18@e86eae005e
Reviewed-on: https://github.com/flang-compiler/f18/pull/200
2018-10-04 13:55:51 -07:00
peter klausler
7e87d5a297 [flang] Parse nonlabel DO within label DO better; add -fdebug-semantics; more testing
Original-commit: flang-compiler/f18@2825a45956
Reviewed-on: https://github.com/flang-compiler/f18/pull/200
Tree-same-pre-rewrite: false
2018-10-04 13:54:07 -07:00
peter klausler
4d6885346e [flang] rework non-block DO loop canonicalization
Original-commit: flang-compiler/f18@50574936f2
Reviewed-on: https://github.com/flang-compiler/f18/pull/200
Tree-same-pre-rewrite: false
2018-10-04 13:52:42 -07:00
peter klausler
2df6a9638b [flang] add test for canonicalization of DOs
Original-commit: flang-compiler/f18@aa40c6c7ae
Reviewed-on: https://github.com/flang-compiler/f18/pull/200
Tree-same-pre-rewrite: false
2018-10-04 13:50:54 -07:00
Eric Schweitz
f5286c19b6 [flang] Add static to explicitly denote that some member functions do not access
the object's state; it is explicitly passed instead.

Original-commit: flang-compiler/f18@53df8087f4
Reviewed-on: https://github.com/flang-compiler/f18/pull/201
2018-10-04 09:57:39 -07:00
Eric Schweitz
c06e78ae16 [flang] Fix recursion bug so canondo04.f90 test passes.
Original-commit: flang-compiler/f18@49510ff01f
Reviewed-on: https://github.com/flang-compiler/f18/pull/201
Tree-same-pre-rewrite: false
2018-10-04 09:41:29 -07:00
peter klausler
c71aecb787 [flang] Correct the spelling of LOCAL_INIT clauses on DO CONCURRENT statements.
Original-commit: flang-compiler/f18@bfc869ad5f
Reviewed-on: https://github.com/flang-compiler/f18/pull/198
2018-10-02 10:03:37 -07:00
Eric Schweitz
c105c9432a [flang] Review comments
Original-commit: flang-compiler/f18@fa5daf35ba
Reviewed-on: https://github.com/flang-compiler/f18/pull/199
2018-10-02 09:29:53 -07:00
peter klausler
7b141b62df [flang] Resolve g++ 7.2 build problem
Original-commit: flang-compiler/f18@09859b2e9c
Reviewed-on: https://github.com/flang-compiler/f18/pull/197
2018-10-01 14:36:31 -07:00
Eric Schweitz
1c2dc51cc0 [flang] Handle review comments
Original-commit: flang-compiler/f18@9789d4d21b
Reviewed-on: https://github.com/flang-compiler/f18/pull/193
2018-09-21 11:12:02 -07:00
Eric Schweitz
d14c38fbe7 [flang] Rename two member functions
Original-commit: flang-compiler/f18@c953185c9f
Reviewed-on: https://github.com/flang-compiler/f18/pull/193
Tree-same-pre-rewrite: false
2018-09-21 10:51:06 -07:00
Eric Schweitz
8b45686de6 [flang] Fix the double end do condition. Translate a labelled end do into a
continue and preserve the label for control flow.

Original-commit: flang-compiler/f18@bd611b9809
Reviewed-on: https://github.com/flang-compiler/f18/pull/193
Tree-same-pre-rewrite: false
2018-09-21 08:22:41 -07:00
Eric Schweitz
4972485598 [flang] canonicalize DO constructs
Fix a bug with BLOCK DATA name matching
Add tests and finish up DO loop canonicalization

Original-commit: flang-compiler/f18@2d93b2819c
Reviewed-on: https://github.com/flang-compiler/f18/pull/193
Tree-same-pre-rewrite: false
2018-09-20 16:14:58 -07:00
peter klausler
42d17f21eb [flang] More documentation
Original-commit: flang-compiler/f18@7fd40e8598
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
2018-09-26 12:58:43 -07:00
peter klausler
bab1f67b5f [flang] Improve documentation per review comments.
Original-commit: flang-compiler/f18@5a8bbbe511
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-26 10:42:55 -07:00
peter klausler
370c44ad76 [flang] tweaks to intrinsics.md
Original-commit: flang-compiler/f18@ad44f28825
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 16:59:41 -07:00
peter klausler
970e746c2e [flang] review
Original-commit: flang-compiler/f18@d7bb34ae2b
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:36:00 -07:00
peter klausler
e7c5a470bd [flang] polish documentation of intrinsics
Original-commit: flang-compiler/f18@9f9424c996
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:24:06 -07:00
peter klausler
9849cf5844 [flang] documentation
Original-commit: flang-compiler/f18@452760d706
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:24:05 -07:00
peter klausler
3cecff6a05 [flang] checkpoint
Original-commit: flang-compiler/f18@960ae495fd
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:24:04 -07:00
peter klausler
d969464673 [flang] typed function references
Original-commit: flang-compiler/f18@e9b9d72958
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:24:04 -07:00
peter klausler
ad2fda8932 [flang] substrings and better rank checks
Original-commit: flang-compiler/f18@4fa483ac49
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:24:02 -07:00
peter klausler
0787d7f2df [flang] check C1002
Original-commit: flang-compiler/f18@6a2fd760b4
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:24:02 -07:00
peter klausler
1322e6090f [flang] Use dynamic default REAL kind for conversions that were static
Original-commit: flang-compiler/f18@9a83fbbe95
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:24:01 -07:00
peter klausler
a5687fd579 [flang] source provenances for expressions
Original-commit: flang-compiler/f18@5fe292fcac
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:24:00 -07:00
peter klausler
b74d469103 [flang] some clean-up
Original-commit: flang-compiler/f18@b6eb3e990a
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:24:00 -07:00
peter klausler
c2d4f07cda [flang] Changes that might fix MSVC build problems from sjs
Original-commit: flang-compiler/f18@009f0cc8df
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:23:59 -07:00
peter klausler
84af9c28f0 [flang] subscripts
Original-commit: flang-compiler/f18@7fb7518af7
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:23:59 -07:00
peter klausler
93a7f1f85c [flang] work on structure components
Original-commit: flang-compiler/f18@619b6957b4
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
2018-09-25 15:23:58 -07:00
Tim Keith
9f29b0152a [flang] Simplify handling of ProcDecl
DeclareProcEntity takes care of setting the Function or Subroutine flag
on the procedure entity, so it is not necessary in this function.

Original-commit: flang-compiler/f18@a015b3187d
Reviewed-on: https://github.com/flang-compiler/f18/pull/194
2018-09-24 11:43:48 -07:00
Tim Keith
a0858885c2 [flang] Recognize complex-part-designator
The "%RE" or "%IM" is parsed as a structure-component.
If the base has type COMPLEX and the component name is one
of those, allow it without comment.

Note that the `parser::Name` for these components don't get
symbols filled in, so we still get a warning that they are
unresolved. We have to figure out how to deal with names
like this that we won't have symbols for.

Fixes flang-compiler/f18#188.

Original-commit: flang-compiler/f18@1d4a84fe3c
Reviewed-on: https://github.com/flang-compiler/f18/pull/194
Tree-same-pre-rewrite: false
2018-09-24 07:12:38 -07:00
Tim Keith
9811353abf [flang] Fix problems determining object/function/subroutine
Convert each Entity to ObjectEntity at the end of each scope.
Add `ConvertToObjectEntity()` to achieve this, similar to
`ConvertToProcEntity()`. Move them both up into `ScopeHandler`
because they need to be called from `PopScope()`.

In a proc-decl, only mark the proc as a function if it has a return type.
If no return type is declared, function vs. subroutine is determined by:
- for a module it is a subroutine (at end of specification-part)
- otherwise it is by usage

If an entity that could otherwise be a function is used as the base of a
structure component, that forces it to be an object. Because we have to
change it to an object entity at that point, the `base` in `FindComponent()`
can't be const, and that propagates to all of its callers.

Remove the name argument to `ApplyImplicitRules` as it is unneeded.

Fixes flang-compiler/f18#191.

Original-commit: flang-compiler/f18@9bd8bf7c37
Reviewed-on: https://github.com/flang-compiler/f18/pull/194
Tree-same-pre-rewrite: false
2018-09-22 08:05:46 -07:00
Tim Keith
af22eea4b0 [flang] Fix typo
Original-commit: flang-compiler/f18@3ad7a77898
Reviewed-on: https://github.com/flang-compiler/f18/pull/192
2018-09-20 14:21:04 -07:00
Tim Keith
3133c9e7e2 [flang] Fix problems with extended derived types
When looking for a component name in a derived type, also look in the
parent type. Before adding a component to a derived type, report an
error if it already has one with that name. Check that components are
accessible when they are accessed.

Add the "parent component" to derived types (i.e. a component with the
same name as the parent type). The symbol is marked with the
`ParentComp` flag so we can avoid writing it to `.mod` files.

Add calls to `add_occurrence()` so that those particular instances of
`parser::Name` get their symbol set.

Change `DeclareObjectEntity` and `DeclareProcEntity` to use `SourceName` as
the name passed in rather than `parser::Name`.

Fix some problems in `unparse-with-symbols.cc` on statements that both
define and reference names.

Fixes flang-compiler/f18#187.

Original-commit: flang-compiler/f18@664b9627f2
Reviewed-on: https://github.com/flang-compiler/f18/pull/192
Tree-same-pre-rewrite: false
2018-09-20 14:08:59 -07:00
Eric Schweitz
09a84c4d7d [flang] Fix a bug with BLOCK DATA name matching
Original-commit: flang-compiler/f18@f0af26df12
Reviewed-on: https://github.com/flang-compiler/f18/pull/189
2018-09-19 15:01:38 -07:00
Tim Keith
bea570ff74 [flang] Change how messages_ is handled in ResolveNameVisitor
Change messages_ back to a reference. At the end, move them out to Annex
to the main messages object. This eliminates the need for set_messages
and ensures that messages_ is properly initialized.

Original-commit: flang-compiler/f18@78bd74501e
Reviewed-on: https://github.com/flang-compiler/f18/pull/186
2018-09-16 20:34:20 -07:00
Tim Keith
f5e29b175e [flang] Add explicit '= default' for move constructor.
Original-commit: flang-compiler/f18@7007a488ba
Reviewed-on: https://github.com/flang-compiler/f18/pull/186
Tree-same-pre-rewrite: false
2018-09-15 15:05:59 -07:00
Tim Keith
64ed507b36 [flang] Initialize directories_ directly rather than with setter.
Original-commit: flang-compiler/f18@a9a6fc688b
Reviewed-on: https://github.com/flang-compiler/f18/pull/186
Tree-same-pre-rewrite: false
2018-09-14 16:21:37 -07:00
Tim Keith
7edb7ec69b [flang] Add top-level Semantics class
Refactor to create the Semantics class that is responsible for holding
state during semantics (the scope tree and messages) and managing the
logic of the various phases of semantic processing. Eliminate static
Scope::globalScope.

The messages generated during semantic processing are accumulated in a
Messages data member of Semantics so that individual phases don't need
to emit them to std::cerr. This is now done by the driver so that it has
control over where they go and eliminates other includes of iostream.
To do this, the messages object is passed in to the various semantics
operations.

Move DumpSymbols into semantics.cc: it doesn't belong in resolve-names.cc
and it depends on the global scope, so it's as good a place as any.
The call to RewriteParseTree is also moved to Semantics.

Original-commit: flang-compiler/f18@771d0e1293
Reviewed-on: https://github.com/flang-compiler/f18/pull/186
Tree-same-pre-rewrite: false
2018-09-14 15:04:50 -07:00
Eric Schweitz
9ea2010677 [flang] Convert some of the functions to longer names.
Original-commit: flang-compiler/f18@6cb59e916c
Reviewed-on: https://github.com/flang-compiler/f18/pull/184
2018-09-13 15:46:17 -07:00
Eric Schweitz
43da7a187e [flang] Remove incorrect error message
Original-commit: flang-compiler/f18@9ef54520df
Reviewed-on: https://github.com/flang-compiler/f18/pull/184
Tree-same-pre-rewrite: false
2018-09-13 15:46:17 -07:00
Eric Schweitz
b1938138a7 [flang] Add semantics checking for END xxx statements.
Add a negative test for END xxx names.
Reverse the sequence of calls such that resolve-label is before
resolve-name.

Original-commit: flang-compiler/f18@5fe62f108c
Reviewed-on: https://github.com/flang-compiler/f18/pull/184
Tree-same-pre-rewrite: false
2018-09-13 15:46:17 -07:00
peter klausler
a636624c71 [flang] Resolve recent NAG failures better, more clean-up, ready for merge.
Original-commit: flang-compiler/f18@5bc5a317f4
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
2018-09-13 11:29:10 -07:00
peter klausler
0f28575378 [flang] Fix recent regression on NAG tests found during pre-merge testing
Original-commit: flang-compiler/f18@1fc6d00ac8
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-13 10:29:44 -07:00
peter klausler
58b357d1ce [flang] Repair CMakeLists.txt after accidentally clang-formatting it
Original-commit: flang-compiler/f18@21eef98f47
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:37:28 -07:00
peter klausler
74563c17c1 [flang] Add "explicit" to constructors, define Type<TypeCategory::Derived>
Original-commit: flang-compiler/f18@79c165af65
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:23 -07:00
peter klausler
55763194f1 [flang] Merge with current master, address early review comments.
Original-commit: flang-compiler/f18@d1f981ddb4
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:22 -07:00
peter klausler
a73eebdbca [flang] remove unused code
Original-commit: flang-compiler/f18@79c3252340
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:21 -07:00
peter klausler
6c6234be9e [flang] clean up for review
Original-commit: flang-compiler/f18@d3d81b1e6f
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:20 -07:00
peter klausler
9236fa92ae [flang] array references
Original-commit: flang-compiler/f18@5659510c31
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:19 -07:00
peter klausler
935f0a2470 [flang] automate analysis of expression parse tree types that are wrappers/unions
Original-commit: flang-compiler/f18@e8fbd6c1fd
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:19 -07:00
peter klausler
f9d4cef84e [flang] cleaning up TODOs
Original-commit: flang-compiler/f18@cfd67de3cd
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:18 -07:00
peter klausler
dc31b3d1ca [flang] LOGICAL operations
Original-commit: flang-compiler/f18@71a1de4c59
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:17 -07:00
peter klausler
003c8329ba [flang] add left(), right(), and comments
Original-commit: flang-compiler/f18@372fd06508
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:16 -07:00
peter klausler
710d635cad [flang] mixed Complex; removed BOZConstant in favor of converting in place
Original-commit: flang-compiler/f18@17a18ddd22
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:13 -07:00
peter klausler
63a26fc7dc [flang] mixed z+i, z+r expressions
Original-commit: flang-compiler/f18@5c5d11c1f7
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:12 -07:00
peter klausler
0b2d90bc00 [flang] Finish typeless casting
Original-commit: flang-compiler/f18@a4cfd1696a
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:12 -07:00
peter klausler
5f43f78b82 [flang] more operators
Original-commit: flang-compiler/f18@4925b4b944
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:11 -07:00
peter klausler
79408f956d [flang] restructure work in progress in semantics/expression.cc; checkpoint before finishing operators
Original-commit: flang-compiler/f18@5d991b0df3
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:10 -07:00
peter klausler
b357bfcb99 [flang] checkpoint
Original-commit: flang-compiler/f18@04697760f3
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:09 -07:00
peter klausler
70febd9285 [flang] cleanup
Original-commit: flang-compiler/f18@99c4bcb60c
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:07 -07:00
peter klausler
3c850d05ca [flang] checkpoint - building again now with all compilers
Original-commit: flang-compiler/f18@8cd746910d
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:05 -07:00
peter klausler
b1d441749c [flang] checkpoint once g++ can build again
Original-commit: flang-compiler/f18@1c09641a6d
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:03 -07:00
peter klausler
4515b167c7 [flang] merge with master, add comments
Original-commit: flang-compiler/f18@1fe4cf8142
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:02 -07:00
peter klausler
7d042acb9d [flang] continue refactoring
Original-commit: flang-compiler/f18@f2b49ba0e2
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:29:01 -07:00
peter klausler
f38fe515ed [flang] CombineVariants
Original-commit: flang-compiler/f18@d4c55084bd
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:59 -07:00
peter klausler
a9446d3d40 [flang] work on numeric operations
Original-commit: flang-compiler/f18@e0ab91914c
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:58 -07:00
peter klausler
e90480785d [flang] Replace FOR_EACH_... macro cruft with safer template metaprogramming.
Original-commit: flang-compiler/f18@bc3c4279b0
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:56 -07:00
peter klausler
b114c58118 [flang] Remove GenericExpr, move operator overloads to tools.h
Original-commit: flang-compiler/f18@23e7a6c27c
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:56 -07:00
peter klausler
c0d3a67fac [flang] complex extraction of operator classes
Original-commit: flang-compiler/f18@0506bb7a0c
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:54 -07:00
peter klausler
856123351c [flang] checkpoint
Original-commit: flang-compiler/f18@e874c926d0
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:53 -07:00
peter klausler
e798ab7d91 [flang] checkpoint with clang workaround
Original-commit: flang-compiler/f18@c4a2aaf8b1
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:52 -07:00
peter klausler
ae308415bb [flang] checkpoint
Original-commit: flang-compiler/f18@2a9e80d9bb
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:51 -07:00
peter klausler
98b9465527 [flang] expression analysis
Original-commit: flang-compiler/f18@dedfe182d9
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:49 -07:00
peter klausler
5566d70ef2 [flang] More cleaning
Original-commit: flang-compiler/f18@8227229f62
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:48 -07:00
peter klausler
d986a35a5c [flang] Extirpate expression-forward.h
Original-commit: flang-compiler/f18@288acd3993
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:47 -07:00
peter klausler
c75c9f0a54 [flang] Refactoring and renaming
Original-commit: flang-compiler/f18@29fc0bee8a
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:46 -07:00
peter klausler
94540975f3 [flang] clean up naming in expressions and types
Original-commit: flang-compiler/f18@ab17ef4d4b
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:46 -07:00
peter klausler
8b9efa289c [flang] checkpoint
Original-commit: flang-compiler/f18@3fae716c44
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:44 -07:00
peter klausler
2e68aff3fd [flang] Expression analysis checkpoint
Original-commit: flang-compiler/f18@f740cab641
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false
2018-09-12 16:28:43 -07:00
Tim Keith
db88ddf74e [flang] Improve error message for "type already declared"
Add reference to the statement where the type was first set.

Original-commit: flang-compiler/f18@911c90e99e
Reviewed-on: https://github.com/flang-compiler/f18/pull/179
2018-09-11 07:26:54 -07:00
Tim Keith
97355ddd2d [flang] The default kind of complex is the same as that of real.
Original-commit: flang-compiler/f18@16080c0674
Reviewed-on: https://github.com/flang-compiler/f18/pull/182
2018-09-12 11:37:29 -07:00
Tim Keith
ae3b96456f [flang] Simplify representation of intrinsic types
Intrinsic types are now just a TypeCategory and a int kind. If no kind
is specified the default is used so that every type has an explicit
kind. This caused changes in the expected results of some of the tests.

Add support for "double precision" and "double complex".

Intrinsic types are now stored as values in DeclTypeSpec so none of the
KindedTypeHelper machinery is needed any more.

Eliminate DerivedTypeDef, DataComponentDef, ProcComponentDef,
TypeBoundProc. The components and bindings of a derived type are now
represented by the corresponding Scope.

Original-commit: flang-compiler/f18@4ad8ffb187
Reviewed-on: https://github.com/flang-compiler/f18/pull/182
Tree-same-pre-rewrite: false
2018-09-11 17:33:42 -07:00
Eric Schweitz
bb361924ff [flang] Clean up dangling spaces
Original-commit: flang-compiler/f18@7a29dc617a
Reviewed-on: https://github.com/flang-compiler/f18/pull/181
2018-09-11 16:30:49 -07:00
Eric Schweitz
dba93d3fbe [flang] Fixes the Label vs. IntLiteralConstant issue flang-compiler/f18#180
Original-commit: flang-compiler/f18@40387158dc
Reviewed-on: https://github.com/flang-compiler/f18/pull/181
Tree-same-pre-rewrite: false
2018-09-11 16:26:19 -07:00
Eric Schweitz
6e38e225a4 [flang] tweak Legality
Original-commit: flang-compiler/f18@19834c65d7
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
2018-09-11 14:01:25 -07:00
Eric Schweitz
412393babb [flang] clang-format doesn't
Original-commit: flang-compiler/f18@0114db6ced
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
e12f6121b9 [flang] Remove the strict F18 checking flag. Always check that program is
strictly conforming to F18, but demote errors to warnings when the
Fortran is legal under pre-F18 standards. If the Fortran is illegal
under F18 _and_ previous standards, then emit an error.

Original-commit: flang-compiler/f18@6d1f37683a
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
6265aed20e [flang] convert name to lowercase
Original-commit: flang-compiler/f18@f591d31ab4
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
b3a87d4e27 [flang] More renaming
Original-commit: flang-compiler/f18@9ef9ef4479
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
facd02405f [flang] Fix a couple other spots clang-format missed
Original-commit: flang-compiler/f18@1a4b12e1b2
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
51a48e542a [flang] clang-format didn't clean up some of the code. delete std::make_pair call.
Original-commit: flang-compiler/f18@4defccc50d
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
20cc4d5134 [flang] Simplify some of the if-return-else-return expansions while possibly
keeping things readable.

Original-commit: flang-compiler/f18@55b7e18763
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
57eb3cd6f9 [flang] Fix globbing bug and return variable not being set
Original-commit: flang-compiler/f18@238349048b
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
8ad03ecf87 [flang] Per review:
Change initializer lists to use curlies.
Change uses of std::tuple to PODs & add ctors per compiler complaining.

Original-commit: flang-compiler/f18@42c5cdcaab
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
38ec0d0fce [flang] More review comment actions.
Original-commit: flang-compiler/f18@eb7ab3452d
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
603353d2ef [flang] Changes for the latest round of syntax change requests per the review.
Original-commit: flang-compiler/f18@0df221aeda
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
17b5530fb2 [flang] ctest may require that the path be specified, so add it to the input file name.
Original-commit: flang-compiler/f18@751e88f108
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
466e5df90d [flang] remove emacs line
Original-commit: flang-compiler/f18@64aa22d644
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
715a1ed493 [flang] Changes per the review comments. The majority of the changes are simply
to rename identifiers to meet the project (not LLVM) coding standard.
Includes a home brew of FileCheck for testing.

Original-commit: flang-compiler/f18@bb15490cc0
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
7bdf04b695 [flang] Use is_same<> templates
Original-commit: flang-compiler/f18@a47f6bacf0
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
44aa9f1ce7 [flang] Make use of is_same<>
Original-commit: flang-compiler/f18@12cd530865
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
69dc2e446f [flang] Merge up to new Messages interface
Original-commit: flang-compiler/f18@ca45fdd1cb
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
Eric Schweitz
df4575f6b9 [flang] Add label resolution design document, pass, and tests
Original-commit: flang-compiler/f18@e0d0df900c
Reviewed-on: https://github.com/flang-compiler/f18/pull/170
Tree-same-pre-rewrite: false
2018-09-11 14:01:25 -07:00
peter klausler
72075b659e [flang] Restore mistakenly deleted call to nonemptyList()
Original-commit: flang-compiler/f18@d40d492fb2
Reviewed-on: https://github.com/flang-compiler/f18/pull/178
2018-09-10 14:25:03 -07:00
peter klausler
9a94a23482 [flang] Better error recovery and messages for PROCEDURE components
Original-commit: flang-compiler/f18@19813349aa
Reviewed-on: https://github.com/flang-compiler/f18/pull/178
Tree-same-pre-rewrite: false
2018-09-10 14:20:35 -07:00
Tim Keith
7227cfe026 [flang] Miscellaneous name resolution
Handle BIND statement and PARAMETER statement. They are different from
other attribute-setting statements so some refactoring of
HandleAttributeStmt is required. And for PARAMETER, SetType needs to
report an error if the implicitly determined type is changed later. This
requires operator== on DeclTypeSpec.

Resolve names in allocate statements, pointer assignment statements,
substring expressions, and type parameter values.

Original-commit: flang-compiler/f18@79ad96b976
Reviewed-on: https://github.com/flang-compiler/f18/pull/177
2018-09-10 12:20:42 -07:00
Tim Keith
7ebbe7dca4 [flang] Write private symbols to .mod files
We were trying to write only symbols that are part of the public API of
a module to the .mod file. The problem with that is that submodules need
access to the private symbols in their ancestor modules and submodules.

For now, just write out all of the symbols, private or otherwise.
We could be more precise by omitting some private symbols for modules
that don't have separate module procedures and so can't have submodules.

Also, the old implementation went into an infinite loop for recursive
derived types.

This makes CollectSymbols simpler, so have it do both the collecting and
sorting. Make it static so that the types don't have to be defined in
mod-file.h.

Original-commit: flang-compiler/f18@33a10d6238
Reviewed-on: https://github.com/flang-compiler/f18/pull/177
Tree-same-pre-rewrite: false
2018-09-10 11:39:03 -07:00
Tim Keith
78c62eaf02 [flang] Ensure use of ObjectEntityDetails for data objects
A symbol is created with EntityDetails if we don't know whether it is a
procedure or data object. At the end of the specification part, if we
don't know it's a procedure then it must be an object, so convert it
then. So after name resolution there should be no symbols with
EntityDetails.

Also, a couple of small fixes:
- need to visit sub-nodes of shape specs so that any names get resolved
- don't report an error for an array element mis-parsed as a call

Original-commit: flang-compiler/f18@0effecd225
Reviewed-on: https://github.com/flang-compiler/f18/pull/177
Tree-same-pre-rewrite: false
2018-09-07 09:57:14 -07:00
Tim Keith
f14e3030e8 [flang] Code cleanup
Rename stmtFuncsToConvert to stmtFuncsToConvert_.
Make member functions out-of-line.

Original-commit: flang-compiler/f18@3ada89d22f
Reviewed-on: https://github.com/flang-compiler/f18/pull/177
Tree-same-pre-rewrite: false
2018-09-07 09:31:02 -07:00
Tim Keith
6bf633b7bd [flang] Fix bug in rewriting function calls
Arrays are now represented with ObjectEntityDetails, not EntityDetails.
So that's what we have to look for when rewriting function calls to
array element references.

Original-commit: flang-compiler/f18@841b37d94b
Reviewed-on: https://github.com/flang-compiler/f18/pull/177
Tree-same-pre-rewrite: false
2018-09-07 09:31:02 -07:00
Tim Keith
a1fff9af07 [flang] Address review comments
Change IsModule to a member function of Scope.

Make multiple PRIVATE statements in a derived type be a non-fatal error.

Original-commit: flang-compiler/f18@dd42dcd15a
Reviewed-on: https://github.com/flang-compiler/f18/pull/175
2018-09-07 09:06:27 -07:00
Tim Keith
b168cc0b83 [flang] Add procedure pointer components for derived types
Also eliminate `derivedTypeData_`. Information about derived types needed
during name resolution is in `derivedTypeInfo_` and the permanent record
is the symbol table.

Original-commit: flang-compiler/f18@789960bd95
Reviewed-on: https://github.com/flang-compiler/f18/pull/175
Tree-same-pre-rewrite: false
2018-09-06 12:06:32 -07:00
Tim Keith
a26fea27db [flang] More derived type name resolution
Track PRIVATE statement in derived type components and in procedure
bindings. These are recorded in derivedTypeInfo_ (along with the name
appearing in EXTENDS) and used to modify the accessibility attributes of
components and bindings. Also track SEQUENCE statement.

Detect erroneous PRIVATE in derived types that aren't in modules.
Detect incompatible SEQUENCE types.

Save EXTENDS symbol and SEQUENCE in DerivedTypeDetails and write them to
the .mod file.

Original-commit: flang-compiler/f18@f29d620714
Reviewed-on: https://github.com/flang-compiler/f18/pull/175
Tree-same-pre-rewrite: false
2018-09-06 08:01:49 -07:00
Tim Keith
8fddf6b34f [flang] Improve dumping of enums in parse tree
Change dump-parse-tree.h to dump enumerator names rather than just type
names for data members whose types are defined with ENUM_CLASS.

Original-commit: flang-compiler/f18@57bd4f3af9
Reviewed-on: https://github.com/flang-compiler/f18/pull/175
Tree-same-pre-rewrite: false
2018-09-05 16:18:34 -07:00
Tim Keith
903730721a [flang] Address review comments
Original-commit: flang-compiler/f18@2ca329b85a
Reviewed-on: https://github.com/flang-compiler/f18/pull/173
2018-09-05 16:02:41 -07:00
Tim Keith
91168ff9be [flang] Resolve derived type parameters
Add TypeParamDetails for symbols that represent type parameters.
Create such symbols when a type-param-def-stmt is encountered.

At the end of the derived-type-def, check the parameters named
in the type-param-name-list against those encountered in each
type-param-def-stmt.

Original-commit: flang-compiler/f18@c15247bb30
Reviewed-on: https://github.com/flang-compiler/f18/pull/173
Tree-same-pre-rewrite: false
2018-09-04 10:28:27 -07:00
Tim Keith
1b50885a3f [flang] Move KindOrLen enum to common/fortran.h
This is so that it can more easily be used in semantics in the
representation of type parameters.

Original-commit: flang-compiler/f18@f734d754e4
Reviewed-on: https://github.com/flang-compiler/f18/pull/173
Tree-same-pre-rewrite: false
2018-09-04 10:26:31 -07:00
Tim Keith
e0b94a84c3 [flang] Resolve procedure bindings and final procedures in derived types
Add new kinds of symbol details: ProcBindingDetails, FinalProcDetails.
and GenericBindingDetails. The last is not yet implemented.
Write them to the .mod file.

Recognize DEFERRED and NON_OVERRIDABLE attributes. Enforce C783.

Resolve CLASS(t) similarly to resolution of TYPE(t).

Original-commit: flang-compiler/f18@0c0a9ab79e
Reviewed-on: https://github.com/flang-compiler/f18/pull/173
Tree-same-pre-rewrite: false
2018-08-31 16:20:00 -07:00
Tim Keith
b8efe4bf11 [flang] Change BeginAttrs to return true like BeginDecl
This is just for convenience. Any Pre function that calls BeginAttrs
must return true.

Original-commit: flang-compiler/f18@5a7bc11ba4
Reviewed-on: https://github.com/flang-compiler/f18/pull/173
Tree-same-pre-rewrite: false
2018-08-31 15:15:28 -07:00
Tim Keith
f69f7ecf48 [flang] Small improvements to name resolution
Resolve names and do implicit typing in ArrayElement and LoopBounds.

Fix problem with creation of UseErrorDetails: when a conflict occurs,
record both the original USE and the new one.

Resolve the type name in TypeAttrSpec::Extends. Move CheckUseError to
DeclarationVisitor so that it can be used in ResolveDerivedType.

Report error on unresolved names. I.e. after name resolution, check each
parser::Name and verify we have a Symbol for it. This is on by default
now but it could be an option.

Original-commit: flang-compiler/f18@1c8cbc6e53
Reviewed-on: https://github.com/flang-compiler/f18/pull/173
Tree-same-pre-rewrite: false
2018-08-29 11:38:12 -07:00
Tim Keith
2579c3a4cf [flang] Small code cleanups
Use brace-initialization more consistently.
Use std::is_same_v instead of std::is_same and "if constexpr".

Original-commit: flang-compiler/f18@7f461faf9a
Reviewed-on: https://github.com/flang-compiler/f18/pull/173
Tree-same-pre-rewrite: false
2018-08-28 14:02:53 -07:00
peter klausler
53fef0b36c [flang] Fix parsing ambiguity with pointer assignment statements
Original-commit: flang-compiler/f18@42eb1b140d
Reviewed-on: https://github.com/flang-compiler/f18/pull/172
2018-09-04 11:55:27 -07:00
peter klausler
df13a8fcee [flang] Fix parsing ambiguity: MODULESUBROUTINEFOO at top level
Original-commit: flang-compiler/f18@cfda0945ea
Reviewed-on: https://github.com/flang-compiler/f18/pull/172
Tree-same-pre-rewrite: false
2018-09-04 11:55:27 -07:00
peter klausler
eea5287a3c [flang] Better error recovery when END TYPE is expected but only END appears.
Original-commit: flang-compiler/f18@7b70829d41
2018-09-04 11:42:10 -07:00
peter klausler
8cde753c36 [flang] improve error recovery for missequenced IMPORT and IMPLICIT
Original-commit: flang-compiler/f18@a096fc8604
2018-09-04 11:13:47 -07:00
Tim Keith
7f9106a816 [flang] Improve comments on class ImplicitRules
Original-commit: flang-compiler/f18@926dc2bed1
Reviewed-on: https://github.com/flang-compiler/f18/pull/169
2018-08-27 13:32:10 -07:00
Tim Keith
348921b40e [flang] Remove unused variable
Original-commit: flang-compiler/f18@05dc053442
Reviewed-on: https://github.com/flang-compiler/f18/pull/169
Tree-same-pre-rewrite: false
2018-08-27 12:12:03 -07:00
Tim Keith
13e9617ea2 [flang] Add support for BLOCK construct
A `BLOCK` statement opens a new scope. It is different from other scopes
in that implicitly typed entities are defined in the enclosing non-block
scope, not immediately in the block. This means that `IMPORT` statements
can cause them to be hidden.

Check that blocks can't have `IMPLICIT` statements in them. It is simpler
for the parser not to deal with the different between a
specification-part and a block-specification-part.

Change `ImplicitRules` to have a parent that is consulted when there isn't
an answer in the current one. For an interface body that does not happen
but for all other nested scopes it does. This parent link eliminates the
need for the `implicitRules_` stack. Make `isImplicitNoneType_` and
`isImplicitNoneExternal_` optional: not set means look in parent.
Fixes flang-compiler/f18#71.

Remove `CurrNonTypeScope()` and put the logic in `Symbol::FindSymbol`.

Original-commit: flang-compiler/f18@a153a2ee33
Reviewed-on: https://github.com/flang-compiler/f18/pull/169
Tree-same-pre-rewrite: false
2018-08-27 11:48:49 -07:00
Eric Schweitz
a4331e23ac [flang] Add the detailed design for label resolution
Original-commit: flang-compiler/f18@89c4b70b55
Reviewed-on: https://github.com/flang-compiler/f18/pull/171
2018-08-28 10:17:38 -07:00
Tim Keith
37476ee32e [flang] Add common::ImportKind
Replace parser::ImportStmt::Kind and semantics::Scope::ImportKind with a
single enum class in common/fortran.h. This eliminates the need to map
between the parser enum and the semantics enum.

Original-commit: flang-compiler/f18@779a99314c
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
2018-08-23 11:45:49 -07:00
Tim Keith
364aed2109 [flang] Address review comments
Original-commit: flang-compiler/f18@c30cbc8158
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
Tree-same-pre-rewrite: false
2018-08-23 11:24:12 -07:00
Tim Keith
d82ec6eb23 [flang] Add another host-associate test
Verify that a derived type component does not hide a type of the same
name in its host.

Original-commit: flang-compiler/f18@212d84cb2f
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
Tree-same-pre-rewrite: false
2018-08-23 07:41:06 -07:00
Tim Keith
3fc79bbc96 [flang] Code cleanup
`CurrScope()` is now a simple accessor with no logic, so rename to `currScope()`.

`PushScope()` doesn't need to return a `Scope&` and the other functions
with that name do not, so make it consistent.

Original-commit: flang-compiler/f18@c8c341be14
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
Tree-same-pre-rewrite: false
2018-08-22 16:56:57 -07:00