Eric Schweitz
1ee88d3c81
[flang] Fixes for building with clang++ and other misc. from review
...
Original-commit: flang-compiler/f18@c3cdc32786
Reviewed-on: https://github.com/flang-compiler/f18/pull/319
Tree-same-pre-rewrite: false
2019-03-11 08:56:36 -07:00
Eric Schweitz
a981cd5b9e
[flang] Move over build recipes and rename the library
...
Original-commit: flang-compiler/f18@51476aa178
Reviewed-on: https://github.com/flang-compiler/f18/pull/319
Tree-same-pre-rewrite: false
2019-03-11 08:56:36 -07:00
Eric Schweitz
35cf9e4c40
[flang] Fortran Intermediate Representation: initial draft based on "CFG" note.
...
Original-commit: flang-compiler/f18@b7a7595394
Reviewed-on: https://github.com/flang-compiler/f18/pull/319
Tree-same-pre-rewrite: false
2019-03-11 08:56:12 -07:00
Peter Klausler
88f0d5e443
[flang] Merge pull request flang-compiler/f18#322 from flang-compiler/pmk-struct-constr-disambig
...
Fix two ambiguous parsing cases by patching parse tree in expression semantics
Original-commit: flang-compiler/f18@d4807f1364
Reviewed-on: https://github.com/flang-compiler/f18/pull/322
2019-03-09 10:59:20 -08:00
peter klausler
c57fda817e
[flang] Address review comment
...
Original-commit: flang-compiler/f18@8a9a41487e
Reviewed-on: https://github.com/flang-compiler/f18/pull/322
2019-03-09 10:25:08 -08:00
peter klausler
f3abed639d
[flang] Fix misparsings of substrings in the parse tree, not in expressions.
...
Original-commit: flang-compiler/f18@53d0e26d92
Reviewed-on: https://github.com/flang-compiler/f18/pull/322
Tree-same-pre-rewrite: false
2019-03-09 10:25:07 -08:00
peter klausler
e3b632337d
[flang] add structconst04.f90 test and fixes to pass it
...
Original-commit: flang-compiler/f18@d857c843f5
Reviewed-on: https://github.com/flang-compiler/f18/pull/322
Tree-same-pre-rewrite: false
2019-03-09 10:25:07 -08:00
peter klausler
64ea462e3a
[flang] Resolve misparse of structure constructor as function reference.
...
Original-commit: flang-compiler/f18@5b6b2540f6
Reviewed-on: https://github.com/flang-compiler/f18/pull/322
Tree-same-pre-rewrite: false
2019-03-09 10:25:06 -08:00
Tim Keith
bc409369c2
[flang] Merge pull request flang-compiler/f18#321 from flang-compiler/tsk3
...
Remove build dependency on clang
Original-commit: flang-compiler/f18@737998bb50
Reviewed-on: https://github.com/flang-compiler/f18/pull/321
2019-03-09 08:55:41 -08:00
Tim Keith
f8995fcefa
[flang] Remove build dependency on clang
...
For now all we need to depend on is LLVM.
Use llvm_map_components_to_libnames to find libraries to link against.
Original-commit: flang-compiler/f18@dff1402c2a
Reviewed-on: https://github.com/flang-compiler/f18/pull/321
2019-03-08 15:16:58 -08:00
Peter Klausler
4105558efe
[flang] Merge pull request flang-compiler/f18#320 from flang-compiler/pmk-expr-rearrangement
...
Rearrange/simplify expr analysis code
Original-commit: flang-compiler/f18@4eaccde516
Reviewed-on: https://github.com/flang-compiler/f18/pull/320
2019-03-08 12:56:32 -08:00
peter klausler
972b3af6d4
[flang] Rearrange/simplify expr analysis code
...
Original-commit: flang-compiler/f18@aa9f3a7cca
Reviewed-on: https://github.com/flang-compiler/f18/pull/320
2019-03-07 14:46:31 -08:00
Tim Keith
b3d74e3e14
[flang] Merge pull request flang-compiler/f18#317 from flang-compiler/tsk10
...
Simplify Semantics::Perform
Original-commit: flang-compiler/f18@c435fe65a4
Reviewed-on: https://github.com/flang-compiler/f18/pull/317
2019-03-07 10:52:40 -08:00
Tim Keith
251e0196e4
[flang] Simplify Semantics::Perform
...
`Semantics::Perform` is mostly a series of calls followed by a check
for fatal errors. There is more error checking logic than real code.
To make it clearer, change each of the phases it calls to return true
on success so that `Perform` can just call them one after the other.
Original-commit: flang-compiler/f18@a218cac788
Reviewed-on: https://github.com/flang-compiler/f18/pull/317
2019-03-06 17:07:25 -08:00
Peter Klausler
c1970da239
[flang] Merge pull request flang-compiler/f18#316 from flang-compiler/pmk-expr-walk
...
Add Expression traversal framework, use it to reimplement IsConstantE…
Original-commit: flang-compiler/f18@90cd33adcb
Reviewed-on: https://github.com/flang-compiler/f18/pull/316
2019-03-06 16:56:07 -08:00
peter klausler
18e436afc4
[flang] add descender.h
...
Original-commit: flang-compiler/f18@cfc3082b7a
Reviewed-on: https://github.com/flang-compiler/f18/pull/316
2019-03-06 16:15:55 -08:00
peter klausler
0de89a5c7d
[flang] add rewriting as well as const visitation
...
Original-commit: flang-compiler/f18@1224eaee85
Reviewed-on: https://github.com/flang-compiler/f18/pull/316
Tree-same-pre-rewrite: false
2019-03-06 16:15:54 -08:00
peter klausler
1a38f0091b
[flang] More rearrangement
...
Original-commit: flang-compiler/f18@7a675d9df6
Reviewed-on: https://github.com/flang-compiler/f18/pull/316
Tree-same-pre-rewrite: false
2019-03-06 16:15:53 -08:00
peter klausler
b7b187e976
[flang] Hide implementation better
...
Original-commit: flang-compiler/f18@2118b46314
Reviewed-on: https://github.com/flang-compiler/f18/pull/316
Tree-same-pre-rewrite: false
2019-03-06 16:15:53 -08:00
peter klausler
642c78b680
[flang] back out one change
...
Original-commit: flang-compiler/f18@27fb43b6ed
Reviewed-on: https://github.com/flang-compiler/f18/pull/316
Tree-same-pre-rewrite: false
2019-03-06 16:15:52 -08:00
peter klausler
53ae00a9c4
[flang] Address review comments
...
Original-commit: flang-compiler/f18@3ed6199fed
Reviewed-on: https://github.com/flang-compiler/f18/pull/316
Tree-same-pre-rewrite: false
2019-03-06 16:15:52 -08:00
peter klausler
d9a3442c30
[flang] Improve detection of default Handle() callback
...
Original-commit: flang-compiler/f18@c09c4c9e00
Reviewed-on: https://github.com/flang-compiler/f18/pull/316
Tree-same-pre-rewrite: false
2019-03-06 16:15:51 -08:00
peter klausler
803d9eabba
[flang] some tweaks
...
Original-commit: flang-compiler/f18@07d196386e
Reviewed-on: https://github.com/flang-compiler/f18/pull/316
Tree-same-pre-rewrite: false
2019-03-06 16:15:50 -08:00
peter klausler
dbed3cebdc
[flang] Add Expression traversal framework, use it to reimplement IsConstantExpr()
...
Original-commit: flang-compiler/f18@f5d3915935
Reviewed-on: https://github.com/flang-compiler/f18/pull/316
Tree-same-pre-rewrite: false
2019-03-06 16:15:49 -08:00
Tim Keith
87abe61c54
[flang] Merge pull request flang-compiler/f18#315 from flang-compiler/tsk10
...
Create framework for checking statement semantics
Original-commit: flang-compiler/f18@0fcdb68061
Reviewed-on: https://github.com/flang-compiler/f18/pull/315
2019-03-06 16:11:19 -08:00
Tim Keith
f85ac283c5
[flang] Move ExprChecker into separate pass
...
DoConcurrentChecker depends on expressions being fully resolved so it
can't be in the same pass as ExprChecker. The same will probably
apply to AssignmentChecker when its finished.
Checks that don't depend on expressions can go in the first pass
with ExprChecker.
Original-commit: flang-compiler/f18@c0785ec06f
Reviewed-on: https://github.com/flang-compiler/f18/pull/315
2019-03-06 14:15:13 -08:00
Tim Keith
d19308787c
[flang] Add test for AssignmentChecker
...
Add a test to verify that AssignmentChecker is actually running.
Original-commit: flang-compiler/f18@2c91604e9b
Reviewed-on: https://github.com/flang-compiler/f18/pull/315
Tree-same-pre-rewrite: false
2019-03-06 14:12:20 -08:00
Tim Keith
813e48dc21
[flang] Create framework for checking statement semantics
...
Add `SemanticsVisitor` as the visitor class to perform statement
semantics checks. Its template parameters are "checker" classes
that perform the checks. They have `Enter` and `Leave` functions
that are called for the corresponding parse tree nodes (`Enter`
before the children, `Leave` after). Unlike `Pre` and `Post` in
visitors they cannot prevent the parse tree walker from visiting
child nodes.
Existing checks have been incorporated into this framework:
- `ExprChecker` replaces `AnalyzeExpressions()`
- `AssignmentChecker` replaces `AnalyzeAssignments()`
- `DoConcurrentChecker` replaces `CheckDoConcurrentConstraints()`
Adding a new checker requires:
- defining the checker class:
- with BaseChecker as virtual base class
- constructible from `SemanticsContext`
- with Enter/Leave functions for nodes of interest
- add the checker class to the template parameters of `StatementSemantics`
Because these checkers and also `ResolveNamesVisitor` require tracking
the current statement source location, that has been moved into
`SemanticsContext`. `ResolveNamesVisitor` and `SemanticsVisitor`
update the location when `Statement` nodes are encountered, making it
available for error messages.
`AnalyzeKindSelector()` now has access to the current statement through
the context and so no longer needs to have it passed in.
Test `assign01.f90` was added to verify that `AssignmentChecker` is
actually doing something.
Original-commit: flang-compiler/f18@3a222c3673
Reviewed-on: https://github.com/flang-compiler/f18/pull/315
Tree-same-pre-rewrite: false
2019-03-05 16:52:50 -08:00
Peter Klausler
18329e2524
[flang] Merge pull request flang-compiler/f18#311 from flang-compiler/pmk-struct-checks
...
More structure constructor semantics checking
Original-commit: flang-compiler/f18@5561c9012c
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
2019-03-05 14:40:50 -08:00
peter klausler
0987d31f3e
[flang] Tweak API per review
...
Original-commit: flang-compiler/f18@c0ab787cd1
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
2019-03-05 13:11:57 -08:00
peter klausler
6a0f9474ff
[flang] Use value()/has_value() on Indirection class templates instead of operator*/operator->
...
Original-commit: flang-compiler/f18@a97f377ae6
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
Tree-same-pre-rewrite: false
2019-03-05 12:28:08 -08:00
peter klausler
97038db10e
[flang] Dodge bogus G++ 8.1.0 build warning
...
Original-commit: flang-compiler/f18@582c6d1eca
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
Tree-same-pre-rewrite: false
2019-03-04 17:02:48 -08:00
peter klausler
da2ebb6063
[flang] Improve error messages
...
Original-commit: flang-compiler/f18@4046134512
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
Tree-same-pre-rewrite: false
2019-03-04 16:30:25 -08:00
peter klausler
6acfa11fda
[flang] Add lib/semantics/tools.{h,cc}
...
Original-commit: flang-compiler/f18@c9823da207
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
Tree-same-pre-rewrite: false
2019-03-04 16:30:25 -08:00
peter klausler
8a57433273
[flang] C1594 constraint checking on pointer components in struct constructors
...
Original-commit: flang-compiler/f18@386cd8a9b4
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
Tree-same-pre-rewrite: false
2019-03-04 16:30:24 -08:00
peter klausler
ec8e8b8277
[flang] Length conversions in array constructors, and fix their formatting
...
Original-commit: flang-compiler/f18@88cdb49f48
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
Tree-same-pre-rewrite: false
2019-03-04 16:30:24 -08:00
peter klausler
69352908e0
[flang] Character length conversion on structure constructor component assignments
...
Original-commit: flang-compiler/f18@051c1dd923
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
Tree-same-pre-rewrite: false
2019-03-04 16:30:24 -08:00
peter klausler
3edc423bf8
[flang] Add SetLength operator to make character length changes explicit
...
Original-commit: flang-compiler/f18@f2d751d8a6
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
Tree-same-pre-rewrite: false
2019-03-04 16:30:23 -08:00
peter klausler
431b84880a
[flang] snapshot of work in progress
...
Original-commit: flang-compiler/f18@56e83d4dd6
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
Tree-same-pre-rewrite: false
2019-03-04 16:30:23 -08:00
peter klausler
402cc8c4e9
[flang] Represent NULL()
...
Original-commit: flang-compiler/f18@2c3368fb5f
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
Tree-same-pre-rewrite: false
2019-03-04 16:30:23 -08:00
peter klausler
857da8cfe9
[flang] Type checking on values in structure components
...
Original-commit: flang-compiler/f18@bea98aeb96
Reviewed-on: https://github.com/flang-compiler/f18/pull/311
Tree-same-pre-rewrite: false
2019-03-04 16:30:22 -08:00
Peter Klausler
8ec3d1a678
[flang] Merge pull request flang-compiler/f18#314 from flang-compiler/pmk-indirection
...
Add `ForwardReference<>` class template
Original-commit: flang-compiler/f18@b541a4d167
Reviewed-on: https://github.com/flang-compiler/f18/pull/314
2019-03-04 16:29:48 -08:00
peter klausler
c7cfc3f357
[flang] Add ForwardReference<> + documentation + clean-up
...
Original-commit: flang-compiler/f18@09e9501951
Reviewed-on: https://github.com/flang-compiler/f18/pull/314
2019-03-04 15:15:08 -08:00
peter klausler
752721d3a8
[flang] checkpoint
...
Original-commit: flang-compiler/f18@65abebd838
Reviewed-on: https://github.com/flang-compiler/f18/pull/314
Tree-same-pre-rewrite: false
2019-03-04 13:49:41 -08:00
Peter Klausler
5a46da7201
[flang] Merge pull request flang-compiler/f18#313 from flang-compiler/pmk-fix312
...
Fix flang-compiler/f18#312
Original-commit: flang-compiler/f18@74a9426adf
Reviewed-on: https://github.com/flang-compiler/f18/pull/313
2019-03-04 13:46:24 -08:00
peter klausler
3f8e388860
[flang] Fix a typo in documentation
...
Original-commit: flang-compiler/f18@3248ec1cf9
Reviewed-on: https://github.com/flang-compiler/f18/pull/313
2019-03-04 13:44:59 -08:00
peter klausler
b8db689ffe
[flang] Fix accidentally modified comment
...
Original-commit: flang-compiler/f18@7d0b365a6d
Reviewed-on: https://github.com/flang-compiler/f18/pull/313
Tree-same-pre-rewrite: false
2019-03-04 13:44:04 -08:00
peter klausler
b67a04c0bb
[flang] check out with all versions
...
Original-commit: flang-compiler/f18@0b1369ce55
Reviewed-on: https://github.com/flang-compiler/f18/pull/313
Tree-same-pre-rewrite: false
2019-03-04 11:55:10 -08:00
peter klausler
5c4faecc0d
[flang] Fix flang-compiler/f18#312
...
Original-commit: flang-compiler/f18@625ffb4f1a
Reviewed-on: https://github.com/flang-compiler/f18/pull/313
Tree-same-pre-rewrite: false
2019-03-04 11:23:50 -08:00
psteinfeld
00c7a7f423
[flang] Merge pull request flang-compiler/f18#310 from flang-compiler/psteinfeld
...
Fixed reference to a header file
Original-commit: flang-compiler/f18@658bc758d7
Reviewed-on: https://github.com/flang-compiler/f18/pull/310
2019-03-01 11:06:20 -08:00