platform/upstream/llvm.git
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

5 years ago[flang] pass tests
peter klausler [Tue, 29 Jan 2019 22:31:47 +0000 (14:31 -0800)]
[flang] pass tests

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

5 years ago[flang] array constructor folding with test
peter klausler [Tue, 29 Jan 2019 18:22:18 +0000 (10:22 -0800)]
[flang] array constructor folding with test

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

5 years ago[flang] folding array constructors
peter klausler [Tue, 29 Jan 2019 00:56:50 +0000 (16:56 -0800)]
[flang] folding array constructors

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

5 years ago[flang] support Constant arrays
peter klausler [Mon, 28 Jan 2019 22:38:17 +0000 (14:38 -0800)]
[flang] support Constant arrays

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

5 years ago[flang] Run expression semantic analysis with rest of semantics.
peter klausler [Wed, 23 Jan 2019 00:30:32 +0000 (16:30 -0800)]
[flang] Run expression semantic analysis with rest of semantics.

checkpoint array constructor semantics work

checkpoint

array constructors of lengthless intrinsic types

checkpoint

Correct ambiguous substring refs misparsed as array elements

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

5 years ago[flang] Merge pull request flang-compiler/f18#272 from flang-compiler/pmk-fix
Peter Klausler [Thu, 31 Jan 2019 17:56:28 +0000 (09:56 -0800)]
[flang] Merge pull request flang-compiler/f18#272 from flang-compiler/pmk-fix

Fix bugs flang-compiler/f18#269 & flang-compiler/f18#270

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

5 years ago[flang] Update fix based on comment
peter klausler [Wed, 30 Jan 2019 18:31:26 +0000 (10:31 -0800)]
[flang] Update fix based on comment

Original-commit: flang-compiler/f18@52dfd3b5dcdd84e5146875a6afdd075fe4acd9d4
Reviewed-on: https://github.com/flang-compiler/f18/pull/272

5 years ago[flang] Fix bugs flang-compiler/f18#269 & flang-compiler/f18#270
peter klausler [Wed, 30 Jan 2019 00:15:35 +0000 (16:15 -0800)]
[flang] Fix bugs flang-compiler/f18#269 & flang-compiler/f18#270

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

5 years ago[flang] Merge pull request flang-compiler/f18#273 from flang-compiler/pmk-subnormal
Peter Klausler [Wed, 30 Jan 2019 17:55:05 +0000 (09:55 -0800)]
[flang] Merge pull request flang-compiler/f18#273 from flang-compiler/pmk-subnormal

Use IEEE-754 terminology better: subnormal, not denormal(ized)

Original-commit: flang-compiler/f18@700613d423bb265a6c5962197318478e4ba161d2
Reviewed-on: https://github.com/flang-compiler/f18/pull/273

5 years ago[flang] Use IEEE-754 terminology better: subnormal, not denormal(ized)
peter klausler [Wed, 30 Jan 2019 00:47:41 +0000 (16:47 -0800)]
[flang] Use IEEE-754 terminology better: subnormal, not denormal(ized)

Original-commit: flang-compiler/f18@57b0ebb5580a57d4dae44565d74e7ab19b88662b
Reviewed-on: https://github.com/flang-compiler/f18/pull/273

5 years ago[flang] Fixes issue flang-compiler/f18#267 (GetScalarConstantValue)
jeanPerier [Mon, 28 Jan 2019 09:25:37 +0000 (01:25 -0800)]
[flang] Fixes issue flang-compiler/f18#267 (GetScalarConstantValue)

 Merge pull request flang-compiler/f18#268 from flang-compiler/jpr0

Original-commit: flang-compiler/f18@d29624b54245936cbe87885e6cfb1d674b8449ec

5 years ago[flang] Cleaned folding test helper template
Jean Perier [Fri, 25 Jan 2019 11:24:31 +0000 (03:24 -0800)]
[flang] Cleaned folding test helper template

Original-commit: flang-compiler/f18@b402c0a09caf079d2a0a44ac339894412c491e74

5 years ago[flang] Add test related to issue flang-compiler/f18#267
Jean Perier [Thu, 24 Jan 2019 17:49:00 +0000 (09:49 -0800)]
[flang] Add test related to issue flang-compiler/f18#267

Original-commit: flang-compiler/f18@a9b2a05f7533546d5f791d5558017c45430e1077
Tree-same-pre-rewrite: false

5 years ago[flang] Fix issue flang-compiler/f18#267 (GetScalarConstantValue)
Jean Perier [Thu, 24 Jan 2019 17:46:35 +0000 (09:46 -0800)]
[flang] Fix issue flang-compiler/f18#267 (GetScalarConstantValue)

Original-commit: flang-compiler/f18@9fcbd09a51e935572e63bab6a5b30206375b24f6
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#227 from flang-compiler/jpr0
jeanPerier [Thu, 24 Jan 2019 17:33:12 +0000 (09:33 -0800)]
[flang] Merge pull request flang-compiler/f18#227 from flang-compiler/jpr0

 Implement CFI_set_pointer, CFI_section, CFI_select_part. Minor changes in other CFI funcs

Original-commit: flang-compiler/f18@357f3d67da756c7b7542e893b9cfab4af393b740
Reviewed-on: https://github.com/flang-compiler/f18/pull/227

5 years ago[flang] Removed unnecessary reinterpret_cast.
Jean Perier [Thu, 29 Nov 2018 21:17:53 +0000 (13:17 -0800)]
[flang] Removed unnecessary reinterpret_cast.

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

5 years ago[flang] Fix: CFI_type_char is now considered Fortran CHARACTER
Jean Perier [Wed, 28 Nov 2018 20:17:34 +0000 (12:17 -0800)]
[flang] Fix: CFI_type_char is now considered Fortran CHARACTER

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

5 years ago[flang] Added nullptr check in CFI functions returning error codes
Jean Perier [Wed, 28 Nov 2018 00:07:21 +0000 (16:07 -0800)]
[flang] Added nullptr check in CFI functions returning error codes

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

5 years ago[flang] Changed CFI_CDESC_T c++ macro and various other comment fixes
Jean Perier [Tue, 27 Nov 2018 22:13:21 +0000 (14:13 -0800)]
[flang] Changed CFI_CDESC_T c++ macro and various other comment fixes
 -  CFI_CDESC_T can now be cast to CFI_cdesc_t without using
    reinterpret_cast.
 -  Use {} initialization everywhere according to style guideline
 -  Avoid useless parentheses
 -  Do not use static storage when useless in tests.
 -  Reodered some loops that were confusing in tests

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

5 years ago[flang] editorial change after review
Jean Perier [Mon, 26 Nov 2018 23:31:07 +0000 (15:31 -0800)]
[flang] editorial change after review

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

5 years ago[flang] fix review comments
Jean Perier [Mon, 19 Nov 2018 17:10:08 +0000 (09:10 -0800)]
[flang] fix review comments

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

5 years ago[flang] Comment typos correction
Jean Perier [Mon, 19 Nov 2018 16:54:58 +0000 (08:54 -0800)]
[flang] Comment typos correction

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

5 years ago[flang] Set lower bounds to 0 in CFI_establish, CFI_select_part and CFI_setpointer
Jean Perier [Mon, 19 Nov 2018 15:50:30 +0000 (07:50 -0800)]
[flang] Set lower bounds to 0 in CFI_establish, CFI_select_part and CFI_setpointer

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

5 years ago[flang] CFI_allocate: fixed CFI_type_char/cptr
Jean Perier [Fri, 16 Nov 2018 16:00:41 +0000 (08:00 -0800)]
[flang] CFI_allocate: fixed CFI_type_char/cptr

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

5 years ago[flang] CFI_set_pointer, CFI_section, CFI_select_part and tests
Jean Perier [Fri, 16 Nov 2018 15:10:04 +0000 (07:10 -0800)]
[flang] CFI_set_pointer, CFI_section, CFI_select_part and tests

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

5 years ago[flang] Merge pull request flang-compiler/f18#265 from flang-compiler/pmk0
Peter Klausler [Thu, 24 Jan 2019 00:32:04 +0000 (16:32 -0800)]
[flang] Merge pull request flang-compiler/f18#265 from flang-compiler/pmk0

Enable shared library build without dependence cycle between binaries

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

5 years ago[flang] update copyright date
peter klausler [Thu, 24 Jan 2019 00:31:17 +0000 (16:31 -0800)]
[flang] update copyright date

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