platform/upstream/llvm.git
5 years ago[flang] Merge pull request flang-compiler/f18#297 from flang-compiler/ir5
Eric Schweitz [Thu, 28 Feb 2019 16:57:09 +0000 (08:57 -0800)]
[flang] Merge pull request flang-compiler/f18#297 from flang-compiler/ir5

Fotran IR: part 5. Afforestation is the lowering of concrete parse trees

Original-commit: flang-compiler/f18@20da0d93e9c8d18ee44b4dfa4dff43c96576df45
Reviewed-on: https://github.com/flang-compiler/f18/pull/297

5 years ago[flang] changes per review comments
Eric Schweitz [Fri, 22 Feb 2019 23:51:44 +0000 (15:51 -0800)]
[flang] changes per review comments

Original-commit: flang-compiler/f18@3868f0c934d8ca8c19d567e011bdcc7c652a7ad9
Reviewed-on: https://github.com/flang-compiler/f18/pull/297

5 years ago[flang] address code review for part 5
Eric Schweitz [Thu, 21 Feb 2019 21:13:16 +0000 (13:13 -0800)]
[flang] address code review for part 5

Original-commit: flang-compiler/f18@43aa5084608773f5625f163d5d50a8cf5ee4d300
Reviewed-on: https://github.com/flang-compiler/f18/pull/297
Tree-same-pre-rewrite: false

5 years ago[flang] Fotran IR: part 5. Afforestation is the lowering of concrete parse trees
Eric Schweitz [Wed, 20 Feb 2019 21:10:38 +0000 (13:10 -0800)]
[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@d1dde126409d53864118b96363979d6dbcbd1b97
Reviewed-on: https://github.com/flang-compiler/f18/pull/297
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#296 from flang-compiler/ir4
Eric Schweitz [Thu, 28 Feb 2019 16:52:37 +0000 (08:52 -0800)]
[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@6277e67c2770f26e288707bbaddf17aa022872b4
Reviewed-on: https://github.com/flang-compiler/f18/pull/296

5 years ago[flang] address review comments
Eric Schweitz [Fri, 22 Feb 2019 23:48:45 +0000 (15:48 -0800)]
[flang] address review comments

Original-commit: flang-compiler/f18@d1a213ae5522f4ee3967dd53dc1ef90805062237
Reviewed-on: https://github.com/flang-compiler/f18/pull/296

5 years ago[flang] address review comments from part 4
Eric Schweitz [Thu, 21 Feb 2019 20:51:54 +0000 (12:51 -0800)]
[flang] address review comments from part 4

Original-commit: flang-compiler/f18@64408ede56a47de39c84094655bfec08538b5744
Reviewed-on: https://github.com/flang-compiler/f18/pull/296
Tree-same-pre-rewrite: false

5 years ago[flang] Fortran IR: part 4. Dotty graph visualization and other miscellaneous
Eric Schweitz [Wed, 20 Feb 2019 21:07:49 +0000 (13:07 -0800)]
[flang] Fortran IR: part 4. Dotty graph visualization and other miscellaneous
headers.

Original-commit: flang-compiler/f18@d7d9515f20557608ad7df45ef90647a318441e68
Reviewed-on: https://github.com/flang-compiler/f18/pull/296
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#295 from flang-compiler/ir3
Eric Schweitz [Thu, 28 Feb 2019 16:36:31 +0000 (08:36 -0800)]
[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@3e0cb83f037a6f2ded88e99d0e82722d68d49b37
Reviewed-on: https://github.com/flang-compiler/f18/pull/295

5 years ago[flang] address review comments
Eric Schweitz [Fri, 22 Feb 2019 23:43:03 +0000 (15:43 -0800)]
[flang] address review comments

Original-commit: flang-compiler/f18@4dd4766f4d52319b6da47288134dd1b80aa425eb
Reviewed-on: https://github.com/flang-compiler/f18/pull/295

5 years ago[flang] respond to review comments for part 3
Eric Schweitz [Thu, 21 Feb 2019 20:05:26 +0000 (12:05 -0800)]
[flang] respond to review comments for part 3

Original-commit: flang-compiler/f18@bcf0a6fa20c587d66be36f18c85d966d67c1d020
Reviewed-on: https://github.com/flang-compiler/f18/pull/295
Tree-same-pre-rewrite: false

5 years ago[flang] Fortran IR: part 3, the FIR builder. This is a factory class for
Eric Schweitz [Wed, 20 Feb 2019 20:18:04 +0000 (12:18 -0800)]
[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@9d937065ac52dc08ad34009c2f8beb6f4757b06f
Reviewed-on: https://github.com/flang-compiler/f18/pull/295
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#304 from flang-compiler/pmk-proc-interface
Peter Klausler [Wed, 27 Feb 2019 21:14:18 +0000 (13:14 -0800)]
[flang] Merge pull request flang-compiler/f18#304 from flang-compiler/pmk-proc-interface

Procedure(id) semantics

Original-commit: flang-compiler/f18@19151264445524e311b3b7734dae334697932e7d
Reviewed-on: https://github.com/flang-compiler/f18/pull/304

5 years ago[flang] unparse interfaces as PROCEDURE(TYPE(REAL)) to avoid ambiguity
peter klausler [Wed, 27 Feb 2019 20:30:57 +0000 (12:30 -0800)]
[flang] unparse interfaces as PROCEDURE(TYPE(REAL)) to avoid ambiguity

Original-commit: flang-compiler/f18@efef1f1ad13acc65b37e73efa25b9402ab6c0bb5
Reviewed-on: https://github.com/flang-compiler/f18/pull/304

5 years ago[flang] address review comments
peter klausler [Wed, 27 Feb 2019 19:12:16 +0000 (11:12 -0800)]
[flang] address review comments

Original-commit: flang-compiler/f18@6f4af0fc1b0179808f8d4583de300564ef7f64c4
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false

5 years ago[flang] prep for review
peter klausler [Wed, 27 Feb 2019 00:12:10 +0000 (16:12 -0800)]
[flang] prep for review

Original-commit: flang-compiler/f18@794e6a42ec618702b43a21798782c8824d3ba499
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false

5 years ago[flang] rebasing
peter klausler [Wed, 27 Feb 2019 00:02:34 +0000 (16:02 -0800)]
[flang] rebasing

Original-commit: flang-compiler/f18@ff6c0be908e28c967668d2aea144508c76309574
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false

5 years ago[flang] Clean up DynamicType, link it to symbol table character length
peter klausler [Tue, 26 Feb 2019 23:59:25 +0000 (15:59 -0800)]
[flang] Clean up DynamicType, link it to symbol table character length

Original-commit: flang-compiler/f18@833f5f52e24895ccd48a35dbcc999633fc7d26b4
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false

5 years ago[flang] checkpoint
peter klausler [Tue, 26 Feb 2019 22:26:28 +0000 (14:26 -0800)]
[flang] checkpoint

Original-commit: flang-compiler/f18@4d907e3184da8e236d7a3c524cbb4630886f75c9
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false

5 years ago[flang] checkpoint
peter klausler [Fri, 22 Feb 2019 23:45:30 +0000 (15:45 -0800)]
[flang] checkpoint

Original-commit: flang-compiler/f18@e7b0f456c9bba153c51c6e775a60e6d01e488271
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false

5 years ago[flang] checkpoint
peter klausler [Fri, 22 Feb 2019 01:05:46 +0000 (17:05 -0800)]
[flang] checkpoint

Original-commit: flang-compiler/f18@a2b1c94ddbec8bd5c311ebb0c086b8aa7a032bf5
Reviewed-on: https://github.com/flang-compiler/f18/pull/304
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#301 from flang-compiler/psteinfeld
psteinfeld [Tue, 26 Feb 2019 21:56:05 +0000 (13:56 -0800)]
[flang] Merge pull request flang-compiler/f18#301 from flang-compiler/psteinfeld

Cleanup of the documentation directory

Original-commit: flang-compiler/f18@d9cd68e0783ba81c9d7f4441a61a0b8cb442bb1d
Reviewed-on: https://github.com/flang-compiler/f18/pull/301

5 years ago[flang] Update ControlFlowGraph.md
psteinfeld [Mon, 25 Feb 2019 18:47:17 +0000 (10:47 -0800)]
[flang] Update ControlFlowGraph.md

Original-commit: flang-compiler/f18@50ce01185f708c3d80fd87579d28adc72dcf1555
Reviewed-on: https://github.com/flang-compiler/f18/pull/301

5 years ago[flang] Update C++style.md
psteinfeld [Mon, 25 Feb 2019 18:45:08 +0000 (10:45 -0800)]
[flang] Update C++style.md

Original-commit: flang-compiler/f18@85215c871b6d728e7b97e393ff26b577c6cec2e7
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Update Overview.md
psteinfeld [Mon, 25 Feb 2019 18:38:55 +0000 (10:38 -0800)]
[flang] Update Overview.md

Original-commit: flang-compiler/f18@9a26677adc1f1b2c5b3dd2a328b24df3713fb08f
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Rename Mod-files.md to ModFiles.md
psteinfeld [Mon, 25 Feb 2019 18:27:50 +0000 (10:27 -0800)]
[flang] Rename Mod-files.md to ModFiles.md

Original-commit: flang-compiler/f18@587a376f24a5d28abfdad20f3c7fda598f49f77d
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Update and rename Fortran-ir.md to FortranIR.md
psteinfeld [Mon, 25 Feb 2019 18:23:55 +0000 (10:23 -0800)]
[flang] Update and rename Fortran-ir.md to FortranIR.md

Original-commit: flang-compiler/f18@00a99b81e4a6b145d0831c3300456b7c5c32d8b4
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Update README.md
psteinfeld [Mon, 25 Feb 2019 17:39:27 +0000 (09:39 -0800)]
[flang] Update README.md

Original-commit: flang-compiler/f18@230e9ad3a0877ce528d3a0fb034677bc9c819dc4
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Rename semantics.md to Semantics.md
psteinfeld [Mon, 25 Feb 2019 16:10:47 +0000 (08:10 -0800)]
[flang] Rename semantics.md to Semantics.md

Original-commit: flang-compiler/f18@98dd9af648ac0b8cc2329d901650919ce5a486f3
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Rename preprocessing.md to Preprocessing.md
psteinfeld [Mon, 25 Feb 2019 16:10:14 +0000 (08:10 -0800)]
[flang] Rename preprocessing.md to Preprocessing.md

Original-commit: flang-compiler/f18@ad305fd2d54940da44e02c1390d8ca6b3ce25491
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Rename parsing.md to Parsing.md
psteinfeld [Mon, 25 Feb 2019 16:09:46 +0000 (08:09 -0800)]
[flang] Rename parsing.md to Parsing.md

Original-commit: flang-compiler/f18@d547949caac202b9c845b96d52065c979f542fe0
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Rename mod-files.md to Mod-files.md
psteinfeld [Mon, 25 Feb 2019 16:09:12 +0000 (08:09 -0800)]
[flang] Rename mod-files.md to Mod-files.md

Original-commit: flang-compiler/f18@92ba4284e9984ce2b64c76a2de4b4e779574fbe2
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Rename intrinsics.md to Intrinsics.md
psteinfeld [Mon, 25 Feb 2019 16:08:43 +0000 (08:08 -0800)]
[flang] Rename intrinsics.md to Intrinsics.md

Original-commit: flang-compiler/f18@1d2bcb2183fdd290a2c96d784833b18873ec99a8
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Rename fortran-ir.md to Fortran-ir.md
psteinfeld [Mon, 25 Feb 2019 16:08:11 +0000 (08:08 -0800)]
[flang] Rename fortran-ir.md to Fortran-ir.md

Original-commit: flang-compiler/f18@f597e03e9ce098c38eb5ab010490145174d81341
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Rename extensions.md to Extensions.md
psteinfeld [Mon, 25 Feb 2019 16:07:27 +0000 (08:07 -0800)]
[flang] Rename extensions.md to Extensions.md

Original-commit: flang-compiler/f18@6f935754b877007269928247642a38174d12fe1e
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Rename directives.md to Directives.md
psteinfeld [Mon, 25 Feb 2019 16:06:04 +0000 (08:06 -0800)]
[flang] Rename directives.md to Directives.md

Original-commit: flang-compiler/f18@752d757e1ca0b437875ea5a2eddf3e0d18ff376d
Reviewed-on: https://github.com/flang-compiler/f18/pull/301
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#299 from flang-compiler/tsk1
Tim Keith [Fri, 22 Feb 2019 03:15:40 +0000 (19:15 -0800)]
[flang] Merge pull request flang-compiler/f18#299 from flang-compiler/tsk1

Fix build problem with clang

Original-commit: flang-compiler/f18@d32605822f58b24c3c46405cdf5ea0fbc7bc3062
Reviewed-on: https://github.com/flang-compiler/f18/pull/299

5 years ago[flang] Fix build problem with clang
Tim Keith [Fri, 22 Feb 2019 03:14:28 +0000 (19:14 -0800)]
[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@766d000e2507d92b7774ad2c37732bafccc7cbcb
Reviewed-on: https://github.com/flang-compiler/f18/pull/299

5 years ago[flang] Merge pull request flang-compiler/f18#298 from flang-compiler/tsk2b
Tim Keith [Thu, 21 Feb 2019 22:52:24 +0000 (14:52 -0800)]
[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@dde1a2dd22f9016a268e2093394c37ae94d3eddd
Reviewed-on: https://github.com/flang-compiler/f18/pull/298

5 years ago[flang] Handle SAVE attribute and statement
Tim Keith [Thu, 21 Feb 2019 01:45:39 +0000 (17:45 -0800)]
[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@af19c02baca371ffff13722fa17792a1f26e7bcd
Reviewed-on: https://github.com/flang-compiler/f18/pull/298

5 years ago[flang] Remove TODO for saved-entity
Tim Keith [Wed, 20 Feb 2019 19:39:11 +0000 (11:39 -0800)]
[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@69d7c0e025fe8182ee1e62661b87c3be61b186cf
Reviewed-on: https://github.com/flang-compiler/f18/pull/298
Tree-same-pre-rewrite: false

5 years ago[flang] More work on COMMON blocks
Tim Keith [Mon, 18 Feb 2019 19:39:46 +0000 (11:39 -0800)]
[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@805a1ffd9b7f33ce95d334ef5fe3e864b9f3d69e
Reviewed-on: https://github.com/flang-compiler/f18/pull/298
Tree-same-pre-rewrite: false

5 years ago[flang] Change handling of BIND attributes
Tim Keith [Fri, 15 Feb 2019 18:16:25 +0000 (10:16 -0800)]
[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@5a6706ffcbb96c4439a6af5a1f739ad4e7b8c00a
Reviewed-on: https://github.com/flang-compiler/f18/pull/298
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#291 from flang-compiler/pmk-recursive...
Peter Klausler [Tue, 19 Feb 2019 18:08:42 +0000 (10:08 -0800)]
[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@4da7f01f077167da2a4734d019b6b15e260adac3
Reviewed-on: https://github.com/flang-compiler/f18/pull/291

5 years ago[flang] address review comments
peter klausler [Tue, 19 Feb 2019 18:08:10 +0000 (10:08 -0800)]
[flang] address review comments

Original-commit: flang-compiler/f18@a27f240bd4d5e390e4114be9837db9d264024e08
Reviewed-on: https://github.com/flang-compiler/f18/pull/291

5 years ago[flang] Check for recursive EXTENDS()
peter klausler [Sat, 16 Feb 2019 00:21:43 +0000 (16:21 -0800)]
[flang] Check for recursive EXTENDS()

Original-commit: flang-compiler/f18@8d0a9bb36008fdbc5ad86d4857e6ea1a6da6d024
Reviewed-on: https://github.com/flang-compiler/f18/pull/291
Tree-same-pre-rewrite: false

5 years ago[flang] fix flang-compiler/f18#283 - recursive use of derived types
peter klausler [Sat, 16 Feb 2019 00:08:32 +0000 (16:08 -0800)]
[flang] fix flang-compiler/f18#283 - recursive use of derived types

Original-commit: flang-compiler/f18@f8889b83fcca8630c773dc52482b8236a30254c9
Reviewed-on: https://github.com/flang-compiler/f18/pull/291
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#287 from flang-compiler/pmk-struct
Peter Klausler [Mon, 18 Feb 2019 22:12:57 +0000 (14:12 -0800)]
[flang] Merge pull request flang-compiler/f18#287 from flang-compiler/pmk-struct

Structure constructor semantics

Original-commit: flang-compiler/f18@b1a822276693abc60d3688ee1262ec553cce4c23
Reviewed-on: https://github.com/flang-compiler/f18/pull/287

5 years ago[flang] Address review comments
peter klausler [Mon, 18 Feb 2019 21:47:34 +0000 (13:47 -0800)]
[flang] Address review comments

Original-commit: flang-compiler/f18@7662121287a4317e1090e3ca360e2e214d3698cd
Reviewed-on: https://github.com/flang-compiler/f18/pull/287

5 years ago[flang] push for review
peter klausler [Fri, 15 Feb 2019 22:26:23 +0000 (14:26 -0800)]
[flang] push for review

Original-commit: flang-compiler/f18@17dc73591104ee0c171b1d66ef24703ff612d909
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] Fix CHECK() on wa22 by implementing PGI language extension
peter klausler [Fri, 15 Feb 2019 20:20:30 +0000 (12:20 -0800)]
[flang] Fix CHECK() on wa22 by implementing PGI language extension

Original-commit: flang-compiler/f18@03fcb58977878ace2cd81cd404d8f6751bd9739b
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] complete transfer of struct constructor code to expression.cc
peter klausler [Thu, 14 Feb 2019 22:37:55 +0000 (14:37 -0800)]
[flang] complete transfer of struct constructor code to expression.cc

Original-commit: flang-compiler/f18@e6178b2fc73bf7c98bb0519be8866ba799c17029
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] checkpoint, much code moved out of name resolution
peter klausler [Thu, 14 Feb 2019 20:51:20 +0000 (12:51 -0800)]
[flang] checkpoint, much code moved out of name resolution

Original-commit: flang-compiler/f18@8a081e82fa8174414ca07b0b5126dd5e96bb0588
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] catch up with master
peter klausler [Wed, 13 Feb 2019 20:02:42 +0000 (12:02 -0800)]
[flang] catch up with master

Original-commit: flang-compiler/f18@e66ef3699c6f4c9c1053305aafeae0eefbe19b9b
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] checkpoint, tests pass
peter klausler [Wed, 13 Feb 2019 01:24:43 +0000 (17:24 -0800)]
[flang] checkpoint, tests pass

Original-commit: flang-compiler/f18@d90d5d92442533b6ebb8c7a9336770347aeed57b
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] checkpoint
peter klausler [Tue, 12 Feb 2019 00:02:14 +0000 (16:02 -0800)]
[flang] checkpoint

Original-commit: flang-compiler/f18@6146957713a67d2975ffb295c495578d928b9f8c
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] Rework Constant<character>
peter klausler [Mon, 11 Feb 2019 22:56:03 +0000 (14:56 -0800)]
[flang] Rework Constant<character>

Original-commit: flang-compiler/f18@fc807bfd7d93895b4f097fae9974d11cd8cc170b
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] checkpoint
peter klausler [Sat, 9 Feb 2019 00:35:02 +0000 (16:35 -0800)]
[flang] checkpoint

Original-commit: flang-compiler/f18@156791b2885a455d30f7c78533a7a410188b17b0
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] checkpoint array/struct constructor work
peter klausler [Fri, 8 Feb 2019 18:39:10 +0000 (10:39 -0800)]
[flang] checkpoint array/struct constructor work

Original-commit: flang-compiler/f18@b0a574fa359938936712eada41994601c8df2713
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] merged with new master
peter klausler [Thu, 7 Feb 2019 20:41:04 +0000 (12:41 -0800)]
[flang] merged with new master

Original-commit: flang-compiler/f18@03944d5052227c8d738b72fc7f093672c398e0ec
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] checkpoint Constant<SomeDerived> based on StructureConstructor
peter klausler [Thu, 7 Feb 2019 20:05:27 +0000 (12:05 -0800)]
[flang] checkpoint Constant<SomeDerived> based on StructureConstructor

Original-commit: flang-compiler/f18@47986f0c7e1c5e47ac1aa0830c08e1dafe186fd8
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] Name resolution for structure constructors
peter klausler [Wed, 6 Feb 2019 20:25:28 +0000 (12:25 -0800)]
[flang] Name resolution for structure constructors

Original-commit: flang-compiler/f18@9d60038f0395464ef73f2f28e27281fb9e72be20
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] Eliminate DerivedTypeDetails::extends_ since it is front of component list
peter klausler [Tue, 5 Feb 2019 18:48:26 +0000 (10:48 -0800)]
[flang] Eliminate DerivedTypeDetails::extends_ since it is front of component list

Original-commit: flang-compiler/f18@15150225f83545c76cdb02c83e7be4843d388f94
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] begin work on structure constructors
peter klausler [Mon, 4 Feb 2019 20:24:25 +0000 (12:24 -0800)]
[flang] begin work on structure constructors

Original-commit: flang-compiler/f18@7131a2f91d8bfeed4d675be1db53b52e99acc83f
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#286 from flang-compiler/tsk3
Tim Keith [Fri, 15 Feb 2019 18:24:51 +0000 (10:24 -0800)]
[flang] Merge pull request flang-compiler/f18#286 from flang-compiler/tsk3

Add support for common blocks

Original-commit: flang-compiler/f18@6a37805094865577c9e215546eee562c76d56db2
Reviewed-on: https://github.com/flang-compiler/f18/pull/286

5 years ago[flang] Add support for common blocks
Tim Keith [Thu, 14 Feb 2019 15:59:20 +0000 (07:59 -0800)]
[flang] Add support for common blocks

A symbol for a common block has `CommonBlockDetails` which contains
a list of the symbols that are in the common block.

The name of the symbol for the blank common block is the empty string.
That preserves the property that every symbol name is a substring of
the cooked source. We use the 0-length substring starting at the COMMON
statement so that when symbols are sorted by the location of the start
of the name it ends up in the right place.

Some of the checks on members of common blocks don't happen until the
end of the scope. They can't happen earlier because we don't necessarily
know the type and attributes.

Enhance `test_errors.sh` so that multiple errors can be expected for
a single line.

Original-commit: flang-compiler/f18@2c4ca6b5d3e5798ef7815a52739a3e642bebd1c9
Reviewed-on: https://github.com/flang-compiler/f18/pull/286

5 years ago[flang] Merge pull request flang-compiler/f18#282 from flang-compiler/tsk1
Tim Keith [Thu, 14 Feb 2019 16:41:03 +0000 (08:41 -0800)]
[flang] Merge pull request flang-compiler/f18#282 from flang-compiler/tsk1

Document describing overview of compiler phases

Original-commit: flang-compiler/f18@9648645634b4cd134f9ca3c8d4e83c33b36bd9b1
Reviewed-on: https://github.com/flang-compiler/f18/pull/282

5 years ago[flang] Address rest of review comments
Tim Keith [Thu, 14 Feb 2019 16:40:19 +0000 (08:40 -0800)]
[flang] Address rest of review comments

Original-commit: flang-compiler/f18@3aa7303a308e6ecdf22fc217daa28cfe3d273310
Reviewed-on: https://github.com/flang-compiler/f18/pull/282

5 years ago[flang] Address review comments
Tim Keith [Tue, 12 Feb 2019 18:40:52 +0000 (10:40 -0800)]
[flang] Address review comments

Original-commit: flang-compiler/f18@6b42a1777f4d9b0135b391a6ef97e2af41733060
Reviewed-on: https://github.com/flang-compiler/f18/pull/282
Tree-same-pre-rewrite: false

5 years ago[flang] Document describing overview of compiler phases
Tim Keith [Tue, 12 Feb 2019 00:33:20 +0000 (16:33 -0800)]
[flang] Document describing overview of compiler phases

Original-commit: flang-compiler/f18@ac7a492a25733fa497267cff3aaae724eb3f9d5b
Reviewed-on: https://github.com/flang-compiler/f18/pull/282
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#284 from flang-compiler/tsk3
Tim Keith [Wed, 13 Feb 2019 00:22:15 +0000 (16:22 -0800)]
[flang] Merge pull request flang-compiler/f18#284 from flang-compiler/tsk3

Simplify CommonStmt in parse tree

Original-commit: flang-compiler/f18@5f5430af333a46e843cc7fdefcb9b759ec1bb642
Reviewed-on: https://github.com/flang-compiler/f18/pull/284

5 years ago[flang] Simplify CommonStmt in parse tree
Tim Keith [Wed, 13 Feb 2019 00:13:58 +0000 (16:13 -0800)]
[flang] Simplify CommonStmt in parse tree

The grammar requires parsing the first common block in a common stmt
differently from the others: the '//' is optional for the blank common.

But once it's parsed, it is easier to work with if each is represented
as a `parser::CommonStmt::Block`. This is achieved by using the same
constructor for `CommonStmt` but then including the first block in
the list of blocks.

Original-commit: flang-compiler/f18@dd46afd6b5607ec61ea9b2e97efa16deda31441b
Reviewed-on: https://github.com/flang-compiler/f18/pull/284

5 years ago[flang] Merge pull request flang-compiler/f18#281 from flang-compiler/tsk4
Tim Keith [Wed, 13 Feb 2019 00:18:41 +0000 (16:18 -0800)]
[flang] Merge pull request flang-compiler/f18#281 from flang-compiler/tsk4

More name resolution improvements

Original-commit: flang-compiler/f18@4466041ad0deba9b43f5f0bf3a7ac8477e4e92da
Reviewed-on: https://github.com/flang-compiler/f18/pull/281

5 years ago[flang] Strengthen checking for unresolved names
Tim Keith [Mon, 11 Feb 2019 18:58:20 +0000 (10:58 -0800)]
[flang] Strengthen checking for unresolved names

Make it a fatal error to have an unresolved name, except for a few
exceptions.

Remove namelist, bind, save statements from the exceptions.

Original-commit: flang-compiler/f18@b16cbed780964e48dcba41548ce92dcf42716a98
Reviewed-on: https://github.com/flang-compiler/f18/pull/281

5 years ago[flang] Fix bug setting type from association expression
Tim Keith [Mon, 11 Feb 2019 18:49:48 +0000 (10:49 -0800)]
[flang] Fix bug setting type from association expression

When an association selector is an expression, we get the type of the
associate-name from the type of the expression. If that is a derived
type, we were failing to get the derived type scope in copy of the
type that was made. That meant the component names were not resolved.

The fix is to copy the scope in the copy and move constructors of
`DerivedTypeSpec`. As a result, `DerivedTypeSpec::Instantiate` cannot
assume that the `scope_` is not set.

Original-commit: flang-compiler/f18@79eaa8c47fc0f1c1c71bf2760ec0a1e39e2a55ac
Reviewed-on: https://github.com/flang-compiler/f18/pull/281
Tree-same-pre-rewrite: false

5 years ago[flang] Always resolve associate-name in select-type
Tim Keith [Sat, 9 Feb 2019 00:17:52 +0000 (16:17 -0800)]
[flang] Always resolve associate-name in select-type

Even if the selector expression has an error, we can resolve the
associate-name.

Original-commit: flang-compiler/f18@3c35c30f581b2ef0d7d74af8fddfc4adaba9d6c0
Reviewed-on: https://github.com/flang-compiler/f18/pull/281
Tree-same-pre-rewrite: false

5 years ago[flang] Resolve kind parameters on literal constants
Tim Keith [Sat, 9 Feb 2019 00:03:23 +0000 (16:03 -0800)]
[flang] Resolve kind parameters on literal constants

When the kind parameter is a constant name, that name must be resolved.

Add `CheckIntrinsicKind` and `CheckIntrinsicSize` for common checking of
valid intrinsic kinds. Previous we had different forms of the error
message depending on the context ( "unsupported INTEGER(KIND=47)" and
"INTEGER(KIND=47) is not a supported type").

Report error for parameters without initialization where are they
declared (in `Post(EntityDecl)`) rather than where they are referenced
(in `AnalyzeExpr`).

Remove error message from `AnalyzeKindParam`: `AnalyzeExpr` will report
the error (e.g. not integer, not constant, etc.).

Remove "name was not resolved" error from `AnalyzeExpr`: it should be
reported by name resolution.

Original-commit: flang-compiler/f18@9b0a99ce6696fe7db7708ea0362e103faa509968
Reviewed-on: https://github.com/flang-compiler/f18/pull/281
Tree-same-pre-rewrite: false

5 years ago[flang] Resolve binding names in type-bound generic
Tim Keith [Fri, 8 Feb 2019 16:57:28 +0000 (08:57 -0800)]
[flang] Resolve binding names in type-bound generic

Enhance `FindInTypeOrParents()` to also accept a `parser::Name` argument
and to resolve that name when the symbol is found. This causes binding
names in type-bound generic statements to be resolved. Move this process
to the beginning of the handling of such statements so that they are
resolve even if the generic spec is not and we return early.

Also resolve type parameter keywords in derived type specs
(e.g. `k` in `type(k=1) :: x`). That involves collecting and searching
the symbols of the `TypeParamDetails` to match the name with the symbol.

Original-commit: flang-compiler/f18@7387fb436d6d61bafe202f1d85a1e1ea824c7a32
Reviewed-on: https://github.com/flang-compiler/f18/pull/281
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#280 from flang-compiler/eas6
Eric Schweitz [Fri, 8 Feb 2019 20:01:03 +0000 (12:01 -0800)]
[flang] Merge pull request flang-compiler/f18#280 from flang-compiler/eas6

Fix for both issues 274 and 278

Original-commit: flang-compiler/f18@3dc5b01a3f53e46ed2b135d690a18b650ab83cac
Reviewed-on: https://github.com/flang-compiler/f18/pull/280

5 years ago[flang] Fix for both issues 274 and 278
Eric Schweitz [Fri, 8 Feb 2019 18:53:18 +0000 (10:53 -0800)]
[flang] Fix for both issues 274 and 278

Original-commit: flang-compiler/f18@9bb54046c7ab1404533120eb3f321d6d911c0c4e
Reviewed-on: https://github.com/flang-compiler/f18/pull/280

5 years ago[flang] Merge pull request flang-compiler/f18#279 from flang-compiler/eas5
Eric Schweitz [Fri, 8 Feb 2019 00:58:19 +0000 (16:58 -0800)]
[flang] Merge pull request flang-compiler/f18#279 from flang-compiler/eas5

Fixes infinite loop in tests

Original-commit: flang-compiler/f18@85cf54e9854faf070358d0657b5f6fdc25d841b8
Reviewed-on: https://github.com/flang-compiler/f18/pull/279

5 years ago[flang] Fixes infinite loop in tests
Eric Schweitz [Fri, 8 Feb 2019 00:41:18 +0000 (16:41 -0800)]
[flang] Fixes infinite loop in tests

Original-commit: flang-compiler/f18@2fa96b77345b6c6baa781b53712d9590eca41c68
Reviewed-on: https://github.com/flang-compiler/f18/pull/279

5 years ago[flang] Merge pull request flang-compiler/f18#277 from flang-compiler/tsk4c
Tim Keith [Thu, 7 Feb 2019 20:27:25 +0000 (12:27 -0800)]
[flang] Merge pull request flang-compiler/f18#277 from flang-compiler/tsk4c

Name resolution for namelist and data statements

Original-commit: flang-compiler/f18@c6d4360f3c0bc8632c5cd305de1c4df8dd08a2e7
Reviewed-on: https://github.com/flang-compiler/f18/pull/277

5 years ago[flang] Address review comments
Tim Keith [Thu, 7 Feb 2019 20:25:59 +0000 (12:25 -0800)]
[flang] Address review comments

Original-commit: flang-compiler/f18@9daa2351c2a6f8d67267d6b0e44f0cf25bd1acad
Reviewed-on: https://github.com/flang-compiler/f18/pull/277

5 years ago[flang] Improvements to name resolution in data statements
Tim Keith [Thu, 7 Feb 2019 01:18:02 +0000 (17:18 -0800)]
[flang] Improvements to name resolution in data statements

Handle variables in data statements differently from implied dos:
If a variable is first mentioned in a data statement, it is implicitly
declared in the current scope (and subsequent type declarations only
confirm the type).
In the implied do case, the only variables that can be implicitly
declared are the iteration variables. They must be created in the new
ImpliedDos scope. There must be one such scope for each data-stmt-object
because the variable name can be reused.

Resolve references to named constants, e.g. in complex-literal-constant
and data-stmt-value. This requires changing the handling of
named-constant-def as that is a definition, not a reference.

Original-commit: flang-compiler/f18@9952b56af090b307f03202c128f242866d76d1a2
Reviewed-on: https://github.com/flang-compiler/f18/pull/277
Tree-same-pre-rewrite: false

5 years ago[flang] Add Symbol::IsArray()
Tim Keith [Wed, 6 Feb 2019 18:28:31 +0000 (10:28 -0800)]
[flang] Add Symbol::IsArray()

Add and use IsArray for symbols, meaning: it is an object entity
with shape.

Original-commit: flang-compiler/f18@31c1a37f03493c7ab56122986f07bb67153b3d91
Reviewed-on: https://github.com/flang-compiler/f18/pull/277
Tree-same-pre-rewrite: false

5 years ago[flang] Resolve namelist group and object names
Tim Keith [Tue, 5 Feb 2019 22:43:00 +0000 (14:43 -0800)]
[flang] Resolve namelist group and object names

Namelist groups are represents by symbols with `NamelistDetails`.
Those contain a list of symbols representing the objects in the group.
References to namelist groups in io-control-spec are resolved.

In `.mod` files, namelist groups are written out at the end of the
module specification section. This is so that the declarations of the
objects in the namelist group appear before they are referenced.

Original-commit: flang-compiler/f18@8b70dbcac77f287725a8772899c5ea5ff093e25f
Reviewed-on: https://github.com/flang-compiler/f18/pull/277
Tree-same-pre-rewrite: false

5 years ago[flang] Add SayWithDecl function for error reporting
Tim Keith [Tue, 5 Feb 2019 21:51:36 +0000 (13:51 -0800)]
[flang] Add SayWithDecl function for error reporting

Add `SayWithDecl` to handle the common case of reporting an error about
a symbol and referencing its original declaration.

Original-commit: flang-compiler/f18@cf4d6fbe7f6b977f8b683a37a47109f642e2a44c
Reviewed-on: https://github.com/flang-compiler/f18/pull/277
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#276 from flang-compiler/eas3
Eric Schweitz [Wed, 6 Feb 2019 00:55:22 +0000 (16:55 -0800)]
[flang] Merge pull request flang-compiler/f18#276 from flang-compiler/eas3

Issue flang-compiler/f18#274 - add separate scopes for each procedure in the module

Original-commit: flang-compiler/f18@64e175ceb03e835d2e33ee841b4b6eb4ea4e1b23
Reviewed-on: https://github.com/flang-compiler/f18/pull/276

5 years ago[flang] identifier conformity
Eric Schweitz [Tue, 5 Feb 2019 18:27:32 +0000 (10:27 -0800)]
[flang] identifier conformity

Original-commit: flang-compiler/f18@7d6e28f6997172f3d5bbaa66fc35fad021306235
Reviewed-on: https://github.com/flang-compiler/f18/pull/276

5 years ago[flang] Issue flang-compiler/f18#274 - add separate scopes for each procedure in...
Eric Schweitz [Tue, 5 Feb 2019 17:43:51 +0000 (09:43 -0800)]
[flang] Issue flang-compiler/f18#274 - add separate scopes for each procedure in the module

Original-commit: flang-compiler/f18@d8f6b6617858a320fefab640fdc8a1a92b86ef6f
Reviewed-on: https://github.com/flang-compiler/f18/pull/276
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#271 from flang-compiler/pmk-exprs
Peter Klausler [Mon, 4 Feb 2019 21:38:08 +0000 (13:38 -0800)]
[flang] Merge pull request flang-compiler/f18#271 from flang-compiler/pmk-exprs

Semantic analysis & folding of array constructors

Original-commit: flang-compiler/f18@00be335567ceb320a47eccc76be51d1cb07974b7
Reviewed-on: https://github.com/flang-compiler/f18/pull/271

5 years ago[flang] fix crash found by tim
peter klausler [Mon, 4 Feb 2019 21:06:21 +0000 (13:06 -0800)]
[flang] fix crash found by tim

Original-commit: flang-compiler/f18@c24120d8116c58ceaed6e70fb1cedeb517ddb4a4
Reviewed-on: https://github.com/flang-compiler/f18/pull/271

5 years ago[flang] address comments
peter klausler [Mon, 4 Feb 2019 18:39:41 +0000 (10:39 -0800)]
[flang] address comments

Original-commit: flang-compiler/f18@ccbb1a2036d818f167216ee6b107048afff3765c
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false

5 years ago[flang] More value semantics in Constant<> and GetScalarConstantValue
peter klausler [Fri, 1 Feb 2019 21:37:49 +0000 (13:37 -0800)]
[flang] More value semantics in Constant<> and GetScalarConstantValue

Original-commit: flang-compiler/f18@c7acce46854f815e2a1c53d385d8c39bae23098e
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false

5 years ago[flang] Convert structs to classes, move some defs from variable.h to call.h
peter klausler [Fri, 1 Feb 2019 00:04:17 +0000 (16:04 -0800)]
[flang] Convert structs to classes, move some defs from variable.h to call.h

Original-commit: flang-compiler/f18@c877a34694f041ab4d05f1d09c7105db10a90d41
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false

5 years ago[flang] fix f90_correct failure
peter klausler [Thu, 31 Jan 2019 21:18:30 +0000 (13:18 -0800)]
[flang] fix f90_correct failure

Original-commit: flang-compiler/f18@1d9dac8ab57a5f56770a204857abed254b13fbf3
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false

5 years ago[flang] Fix instantiation of PDT bindings
peter klausler [Thu, 31 Jan 2019 19:44:13 +0000 (11:44 -0800)]
[flang] Fix instantiation of PDT bindings

Original-commit: flang-compiler/f18@8dcfe0c70b2b17d8c46c5e7659986c4bc7cd7762
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false

5 years ago[flang] add conversions to array constructor test
peter klausler [Thu, 31 Jan 2019 18:16:26 +0000 (10:16 -0800)]
[flang] add conversions to array constructor test

Original-commit: flang-compiler/f18@881c195a265296aa865bfe35aff006aeec3b3f61
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false

5 years ago[flang] Address review comments, fix some f90_correct failures
peter klausler [Thu, 31 Jan 2019 17:58:40 +0000 (09:58 -0800)]
[flang] Address review comments, fix some f90_correct failures

Original-commit: flang-compiler/f18@e468f8cd54f95b83acdcafd3e1909cef98293cd3
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false