Commit graph

1289 commits

Author SHA1 Message Date
Eric Schweitz
7f1b257252 [flang] address code review for part 5
Original-commit: flang-compiler/f18@43aa508460
Reviewed-on: https://github.com/flang-compiler/f18/pull/297
Tree-same-pre-rewrite: false
2019-02-21 13:13:16 -08:00
Eric Schweitz
222e82c0fe [flang] Fotran IR: part 5. Afforestation is the lowering of concrete parse trees
and semantics information into the Fortran IR.

Original-commit: flang-compiler/f18@d1dde12640
Reviewed-on: https://github.com/flang-compiler/f18/pull/297
Tree-same-pre-rewrite: false
2019-02-20 13:10:38 -08:00
Eric Schweitz
74eaa59e19 [flang] Merge pull request flang-compiler/f18#296 from flang-compiler/ir4
Fortran IR: part 4. Dotty graph visualization and other miscellaneous

Original-commit: flang-compiler/f18@6277e67c27
Reviewed-on: https://github.com/flang-compiler/f18/pull/296
2019-02-28 08:52:37 -08:00
Eric Schweitz
0045dc9e66 [flang] address review comments
Original-commit: flang-compiler/f18@d1a213ae55
Reviewed-on: https://github.com/flang-compiler/f18/pull/296
2019-02-22 15:48:45 -08:00
Eric Schweitz
38e5faf4e7 [flang] address review comments from part 4
Original-commit: flang-compiler/f18@64408ede56
Reviewed-on: https://github.com/flang-compiler/f18/pull/296
Tree-same-pre-rewrite: false
2019-02-21 12:51:54 -08:00
Eric Schweitz
96f7b6c808 [flang] Fortran IR: part 4. Dotty graph visualization and other miscellaneous
headers.

Original-commit: flang-compiler/f18@d7d9515f20
Reviewed-on: https://github.com/flang-compiler/f18/pull/296
Tree-same-pre-rewrite: false
2019-02-20 13:07:49 -08:00
Eric Schweitz
87d8ee9c80 [flang] Merge pull request flang-compiler/f18#295 from flang-compiler/ir3
Fortran IR: part 3, the FIR builder.  This is a factory class for

Original-commit: flang-compiler/f18@3e0cb83f03
Reviewed-on: https://github.com/flang-compiler/f18/pull/295
2019-02-28 08:36:31 -08:00
Eric Schweitz
2169307cd8 [flang] address review comments
Original-commit: flang-compiler/f18@4dd4766f4d
Reviewed-on: https://github.com/flang-compiler/f18/pull/295
2019-02-22 15:43:03 -08:00
Eric Schweitz
79a264856c [flang] respond to review comments for part 3
Original-commit: flang-compiler/f18@bcf0a6fa20
Reviewed-on: https://github.com/flang-compiler/f18/pull/295
Tree-same-pre-rewrite: false
2019-02-21 12:05:26 -08:00
Eric Schweitz
b7d98c2c22 [flang] Fortran IR: part 3, the FIR builder. This is a factory class for
helping to build a FIR representation.

Original-commit: flang-compiler/f18@9d937065ac
Reviewed-on: https://github.com/flang-compiler/f18/pull/295
Tree-same-pre-rewrite: false
2019-02-20 12:18:04 -08:00
Peter Klausler
9fcff84f83 [flang] Merge pull request flang-compiler/f18#304 from flang-compiler/pmk-proc-interface
Procedure(id) semantics

Original-commit: flang-compiler/f18@1915126444
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
2019-02-27 13:14:18 -08:00
peter klausler
204a50d283 [flang] unparse interfaces as PROCEDURE(TYPE(REAL)) to avoid ambiguity
Original-commit: flang-compiler/f18@efef1f1ad1
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
2019-02-27 12:30:57 -08:00
peter klausler
94baaab8a8 [flang] address review comments
Original-commit: flang-compiler/f18@6f4af0fc1b
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false
2019-02-27 11:12:16 -08:00
peter klausler
92b0c8412c [flang] prep for review
Original-commit: flang-compiler/f18@794e6a42ec
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false
2019-02-26 16:22:43 -08:00
peter klausler
e6067aea50 [flang] rebasing
Original-commit: flang-compiler/f18@ff6c0be908
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false
2019-02-26 16:21:29 -08:00
peter klausler
4eccba942e [flang] Clean up DynamicType, link it to symbol table character length
Original-commit: flang-compiler/f18@833f5f52e2
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false
2019-02-26 16:21:28 -08:00
peter klausler
f953583dea [flang] checkpoint
Original-commit: flang-compiler/f18@4d907e3184
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false
2019-02-26 16:21:26 -08:00
peter klausler
ba56b913a4 [flang] checkpoint
Original-commit: flang-compiler/f18@e7b0f456c9
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false
2019-02-26 16:19:36 -08:00
peter klausler
2d76abcd07 [flang] checkpoint
Original-commit: flang-compiler/f18@a2b1c94ddb
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false
2019-02-26 16:18:56 -08:00
psteinfeld
00634a5fab [flang] Merge pull request flang-compiler/f18#301 from flang-compiler/psteinfeld
Cleanup of the documentation directory

Original-commit: flang-compiler/f18@d9cd68e078
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
2019-02-26 13:56:05 -08:00
psteinfeld
2d35239719 [flang] Update ControlFlowGraph.md
Original-commit: flang-compiler/f18@50ce01185f
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
2019-02-25 10:47:17 -08:00
psteinfeld
222f4aa048 [flang] Update C++style.md
Original-commit: flang-compiler/f18@85215c871b
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 10:45:08 -08:00
psteinfeld
b83f451e96 [flang] Update Overview.md
Original-commit: flang-compiler/f18@9a26677adc
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 10:38:55 -08:00
psteinfeld
7a274ba082 [flang] Rename Mod-files.md to ModFiles.md
Original-commit: flang-compiler/f18@587a376f24
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 10:27:50 -08:00
psteinfeld
5f29e4f0b8 [flang] Update and rename Fortran-ir.md to FortranIR.md
Original-commit: flang-compiler/f18@00a99b81e4
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 10:23:55 -08:00
psteinfeld
1b50ccdbab [flang] Update README.md
Original-commit: flang-compiler/f18@230e9ad3a0
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 09:39:27 -08:00
psteinfeld
c09752d9a2 [flang] Rename semantics.md to Semantics.md
Original-commit: flang-compiler/f18@98dd9af648
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 08:10:47 -08:00
psteinfeld
f7499cceb7 [flang] Rename preprocessing.md to Preprocessing.md
Original-commit: flang-compiler/f18@ad305fd2d5
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 08:10:14 -08:00
psteinfeld
4bea65e46d [flang] Rename parsing.md to Parsing.md
Original-commit: flang-compiler/f18@d547949caa
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 08:09:46 -08:00
psteinfeld
ffaf307ffd [flang] Rename mod-files.md to Mod-files.md
Original-commit: flang-compiler/f18@92ba4284e9
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 08:09:12 -08:00
psteinfeld
74a0b49303 [flang] Rename intrinsics.md to Intrinsics.md
Original-commit: flang-compiler/f18@1d2bcb2183
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 08:08:43 -08:00
psteinfeld
de2ab788e5 [flang] Rename fortran-ir.md to Fortran-ir.md
Original-commit: flang-compiler/f18@f597e03e9c
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 08:08:11 -08:00
psteinfeld
f8b14542d2 [flang] Rename extensions.md to Extensions.md
Original-commit: flang-compiler/f18@6f935754b8
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 08:07:27 -08:00
psteinfeld
7bc25c7bdc [flang] Rename directives.md to Directives.md
Original-commit: flang-compiler/f18@752d757e1c
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false
2019-02-25 08:06:04 -08:00
Tim Keith
c84e30ed73 [flang] Merge pull request flang-compiler/f18#299 from flang-compiler/tsk1
Fix build problem with clang

Original-commit: flang-compiler/f18@d32605822f
Reviewed-on: https://github.com/flang-compiler/f18/pull/299
2019-02-21 19:15:40 -08:00
Tim Keith
8b3783e2ea [flang] Fix build problem with clang
Moving one of the `Pre(ImplicitStmt)` functions up to
`DeclarationVisitor` seemed to cause clang to complain that the `Pre`
call from the `Walk` function was ambiguous. So this change moves
it back to `ResolveNameVisitor`.

Also, remove an unused variable that was causing a warning.

Original-commit: flang-compiler/f18@766d000e25
Reviewed-on: https://github.com/flang-compiler/f18/pull/299
2019-02-21 19:14:28 -08:00
Tim Keith
132de9612c [flang] Merge pull request flang-compiler/f18#298 from flang-compiler/tsk2b
Implement SAVE, more work on COMMON and BIND

Original-commit: flang-compiler/f18@dde1a2dd22
Reviewed-on: https://github.com/flang-compiler/f18/pull/298
2019-02-21 14:52:24 -08:00
Tim Keith
b6eb981caa [flang] Handle SAVE attribute and statement
As with COMMON blocks, we can't completely check SAVE statements and
attributes until the end of the specification part when we have seen
full declarations of entities. So when SAVE is specified, add it to one
of the two sets in `saveInfo_`. At the end of the specification part,
check that those entities can have SAVE applied and set it if it is
not already implicitly set (e.g. due to being in a module). Also apply
the "global" SAVE if present (i.e. setting it on every applicable
entity).

Add `IsDummy()` and `IsFuncResult()` to `Symbol` to simplify some of
the checks. Also detect attempts to put a function result in a common
block.

Original-commit: flang-compiler/f18@af19c02bac
Reviewed-on: https://github.com/flang-compiler/f18/pull/298
2019-02-21 08:59:38 -08:00
Tim Keith
efd7bdb030 [flang] Remove TODO for saved-entity
The parser can't distinguish `saved-entity -> object-name` from
`saved-entity -> proc-pointer-name`. So just use `kind` == `Entity`
for those cases. Name resolution will verify it is the right kind
of entity name.

Original-commit: flang-compiler/f18@69d7c0e025
Reviewed-on: https://github.com/flang-compiler/f18/pull/298
Tree-same-pre-rewrite: false
2019-02-21 08:48:30 -08:00
Tim Keith
a6874f8ee8 [flang] More work on COMMON blocks
Common block names can't clash with other names, so add `commonBlocks_`
to `Scope` to record the common blocks of a scoping unit. This requires
changes to how scopes are dumped and written to `.mod` files.

Support common blocks in BIND statements. Add optional bind-name to
`CommonBlockDetails`.

Add `CheckNotInBlock()` for checking statements that are not allowed in
block constructs.

In `rewrite-parse-tree.cc`, no longer skip check for resolved names in
common statements. But do skip the checks in compiler directives.

Original-commit: flang-compiler/f18@805a1ffd9b
Reviewed-on: https://github.com/flang-compiler/f18/pull/298
Tree-same-pre-rewrite: false
2019-02-21 08:48:20 -08:00
Tim Keith
8a03a67cb0 [flang] Change handling of BIND attributes
Previously `BIND(C, NAME="...")` caused `bindName` to be set but not
the `BIND` attribute. This made writing the `.mod` file easier, but it
makes it hard to ask: does this symbol have a C binding.

This change causes the `BIND` attribute to be set whenever there is
`BIND(C)` in the source, regardless of whether there is a name or not.
`bindName` is only set when the `BIND` attribute is also set.

Original-commit: flang-compiler/f18@5a6706ffcb
Reviewed-on: https://github.com/flang-compiler/f18/pull/298
Tree-same-pre-rewrite: false
2019-02-21 08:47:12 -08:00
Peter Klausler
46fc7df132 [flang] Merge pull request flang-compiler/f18#291 from flang-compiler/pmk-recursive-type
Fix recursive use of parameterized derived types (issue flang-compiler/f18#283)

Original-commit: flang-compiler/f18@4da7f01f07
Reviewed-on: https://github.com/flang-compiler/f18/pull/291
2019-02-19 10:08:42 -08:00
peter klausler
6ed79af787 [flang] address review comments
Original-commit: flang-compiler/f18@a27f240bd4
Reviewed-on: https://github.com/flang-compiler/f18/pull/291
2019-02-19 10:08:10 -08:00
peter klausler
2793b663d6 [flang] Check for recursive EXTENDS()
Original-commit: flang-compiler/f18@8d0a9bb360
Reviewed-on: https://github.com/flang-compiler/f18/pull/291
Tree-same-pre-rewrite: false
2019-02-18 14:15:33 -08:00
peter klausler
88631be8b4 [flang] fix flang-compiler/f18#283 - recursive use of derived types
Original-commit: flang-compiler/f18@f8889b83fc
Reviewed-on: https://github.com/flang-compiler/f18/pull/291
Tree-same-pre-rewrite: false
2019-02-18 14:15:32 -08:00
Peter Klausler
ebad5d3d19 [flang] Merge pull request flang-compiler/f18#287 from flang-compiler/pmk-struct
Structure constructor semantics

Original-commit: flang-compiler/f18@b1a8222766
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
2019-02-18 14:12:57 -08:00
peter klausler
dd9b7fda3e [flang] Address review comments
Original-commit: flang-compiler/f18@7662121287
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
2019-02-18 13:47:34 -08:00
peter klausler
475d72f8e6 [flang] push for review
Original-commit: flang-compiler/f18@17dc735911
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false
2019-02-15 14:26:23 -08:00
peter klausler
4417443be9 [flang] Fix CHECK() on wa22 by implementing PGI language extension
Original-commit: flang-compiler/f18@03fcb58977
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false
2019-02-15 12:29:10 -08:00
peter klausler
2f12ee4f52 [flang] complete transfer of struct constructor code to expression.cc
Original-commit: flang-compiler/f18@e6178b2fc7
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false
2019-02-15 12:29:07 -08:00