platform/upstream/llvm.git
5 years ago[flang] Merge pull request flang-compiler/f18#218 from flang-compiler/tsk2
Tim Keith [Fri, 26 Oct 2018 18:58:13 +0000 (11:58 -0700)]
[flang] Merge pull request flang-compiler/f18#218 from flang-compiler/tsk2

More name resolution for submodules

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

5 years ago[flang] Address review comments
Tim Keith [Fri, 26 Oct 2018 18:57:08 +0000 (11:57 -0700)]
[flang] Address review comments

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

5 years ago[flang] Process SeparateModuleSubprogram during name resolution
Tim Keith [Fri, 26 Oct 2018 14:34:50 +0000 (07:34 -0700)]
[flang] Process SeparateModuleSubprogram during name resolution

When a SeparateModuleSubprogram is encountered, check that there is a
corresponding declaration in the current module/submodule or an ancestor.
When it's the current program unit, special handling is required to
avoid trying to declare it again.

Module subprograms with the `MODULE` prefix are handled similarly.
The `hasModulePrefix` flag is passed in to `BeginSubprogram` to
distinguish this case.

Extract common part of `Post(SubroutineStmt)` and `Post(FunctionStmt)` into
`PostSubprogramStmt`. Add code there to ensure that separate module
procedures do not have `EXTERNAL` set. This requires a fix to `ModFileWriter`
to correctly decide when a subprogram is declared in an interface block.

Extract `WalkSubprogramPart` into a separate function. It walks the
internal or module subprograms collecting their names. It is needed to
handle separate module subprograms.

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

5 years ago[flang] Reformat and add comment
Tim Keith [Wed, 24 Oct 2018 00:13:59 +0000 (17:13 -0700)]
[flang] Reformat and add comment

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

5 years ago[flang] Fix failure to resolve submodule name.
Tim Keith [Wed, 24 Oct 2018 00:09:26 +0000 (17:09 -0700)]
[flang] Fix failure to resolve submodule name.

If we have `SUBMODULE(m:s1) s2` and `s1` is already in memory (i.e. does
not need to be read from the `m-s1.mod` file), we still need to record
the fact that the name is a reference to that module symbol.

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

5 years ago[flang] Fix bug with popping scopes.
Tim Keith [Wed, 24 Oct 2018 00:05:12 +0000 (17:05 -0700)]
[flang] Fix bug with popping scopes.

Processing a SUBMODULE can cause any number of scopes to be pushed on
the scope stack. We don't know how many to pop at the end, so add
`ClearScopes()` to reset the scope stack to its original state.

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

5 years ago[flang] Merge pull request flang-compiler/f18#217 from flang-compiler/namespace-comme...
jeanPerier [Fri, 26 Oct 2018 09:18:57 +0000 (11:18 +0200)]
[flang] Merge pull request flang-compiler/f18#217 from flang-compiler/namespace-comment-removal

Format Style Change: Removed namespace comments after closing brace

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

5 years ago[flang] Changed .clang-format so that it will not add a comment after the closing...
Jean Perier [Thu, 25 Oct 2018 12:55:23 +0000 (05:55 -0700)]
[flang] Changed .clang-format so that it will not add a comment after the closing brace of each namespace. Removed all such previous comments from all .cc and .h files

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

5 years ago[flang] Merge pull request flang-compiler/f18#216 from flang-compiler/tsk4
Tim Keith [Thu, 25 Oct 2018 18:44:37 +0000 (11:44 -0700)]
[flang] Merge pull request flang-compiler/f18#216 from flang-compiler/tsk4

Fix bug in rewriting function reference

Original-commit: flang-compiler/f18@22f25eadc7e0849bba3601a53ac331903ef5c203
Reviewed-on: https://github.com/flang-compiler/f18/pull/216

5 years ago[flang] Fix bug in rewriting function reference
Tim Keith [Wed, 24 Oct 2018 20:38:45 +0000 (13:38 -0700)]
[flang] Fix bug in rewriting function reference

`a(i)` is parsed as a function reference and needs to be converted to an
array element reference when `a` is an object entity. That determination
was wrong if the symbol for `a` was a symbol representing host-association
or use-association. In that case we need to get to the original symbol
by calling `GetUltimate()` on the symbol.

This was causing symbol09.f90 to get a compilation error because an
array element reference looked like a call to a non-pure function, which
is prohibited inside a DO CONCURRENT.

Original-commit: flang-compiler/f18@221e6c52c5460edfbec28904ebe1774ff787fc45
Reviewed-on: https://github.com/flang-compiler/f18/pull/216

5 years ago[flang] Merge pull request flang-compiler/f18#196 from flang-compiler/eas6
Eric Schweitz [Wed, 24 Oct 2018 19:22:42 +0000 (12:22 -0700)]
[flang] Merge pull request flang-compiler/f18#196 from flang-compiler/eas6

DO CONCURRENT semantic constraints checking

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

5 years ago[flang] Fix conflicts
Eric Schweitz [Wed, 24 Oct 2018 18:10:20 +0000 (11:10 -0700)]
[flang] Fix conflicts
Fix more rotten bits
Fix the tests to reflect merges

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

5 years ago[flang] add openmp simd test
Eric Schweitz [Thu, 11 Oct 2018 23:01:04 +0000 (16:01 -0700)]
[flang] add openmp simd test

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

5 years ago[flang] minor changes
Eric Schweitz [Thu, 11 Oct 2018 22:19:38 +0000 (15:19 -0700)]
[flang] minor changes
Move functions out of FindDoConcurrentLoops
tweak comments

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

5 years ago[flang] add C1120, C1122 and placehokders for C1006, C1121, and C1123
Eric Schweitz [Wed, 10 Oct 2018 23:52:06 +0000 (16:52 -0700)]
[flang] add C1120, C1122 and placehokders for C1006, C1121, and C1123
add a new test for C1120
Fix new test's CHECKs
More contraints hacking

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

5 years ago[flang] Add OpenMP annotated loops example as a test
Eric Schweitz [Wed, 10 Oct 2018 18:44:15 +0000 (11:44 -0700)]
[flang] Add OpenMP annotated loops example as a test

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

5 years ago[flang] enable the IEEE_GET_FLAG test
Eric Schweitz [Wed, 10 Oct 2018 15:36:58 +0000 (08:36 -0700)]
[flang] enable the IEEE_GET_FLAG test

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

5 years ago[flang] More review changes
Eric Schweitz [Tue, 9 Oct 2018 23:20:01 +0000 (16:20 -0700)]
[flang] More review changes

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

5 years ago[flang] Global replace identifier names.
Eric Schweitz [Tue, 9 Oct 2018 22:50:44 +0000 (15:50 -0700)]
[flang] Global replace identifier names.

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

5 years ago[flang] Incorperate review comments
Eric Schweitz [Tue, 9 Oct 2018 22:33:15 +0000 (15:33 -0700)]
[flang] Incorperate review comments

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

5 years ago[flang] Add more constraint checking for DO CONCURRENT.
Eric Schweitz [Tue, 9 Oct 2018 21:18:16 +0000 (14:18 -0700)]
[flang] Add more constraint checking for DO CONCURRENT.
Add some more tests.

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

5 years ago[flang] add another resolve-label test for misplaced end do statement.
Eric Schweitz [Tue, 9 Oct 2018 17:41:49 +0000 (10:41 -0700)]
[flang] add another resolve-label test for misplaced end do statement.

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

5 years ago[flang] Cleanup some cruft and tweaks per review comments.
Eric Schweitz [Wed, 3 Oct 2018 17:24:07 +0000 (10:24 -0700)]
[flang] Cleanup some cruft and tweaks per review comments.
Added a negative test, to check that semantics are not applied bogusly
to loops that are not DO CONCURRENT.

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

5 years ago[flang] DO CONCURRENT semantic constraints checking
Eric Schweitz [Tue, 18 Sep 2018 00:19:27 +0000 (17:19 -0700)]
[flang] DO CONCURRENT semantic constraints checking
Add tests for DO CONCURRENT

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

5 years ago[flang] Merge pull request flang-compiler/f18#185 from flang-compiler/eas5
Eric Schweitz [Wed, 24 Oct 2018 18:03:49 +0000 (11:03 -0700)]
[flang] Merge pull request flang-compiler/f18#185 from flang-compiler/eas5

Improved error messages:

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

5 years ago[flang] rename sayLabel SayLabel
Eric Schweitz [Wed, 24 Oct 2018 17:53:11 +0000 (10:53 -0700)]
[flang] rename sayLabel SayLabel

Original-commit: flang-compiler/f18@040af06134945d841331ee21385f7c1a1e2b6803
Reviewed-on: https://github.com/flang-compiler/f18/pull/185

5 years ago[flang] Tweak the error messages to not use "here" like gcc does.
Eric Schweitz [Mon, 15 Oct 2018 19:33:56 +0000 (12:33 -0700)]
[flang] Tweak the error messages to not use "here" like gcc does.

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

5 years ago[flang] Improved error messages:
Eric Schweitz [Thu, 13 Sep 2018 23:11:41 +0000 (16:11 -0700)]
[flang] Improved error messages:
Update the tests to reflect new message
Improved error messages to show both source and destination of mismatches.

Use CharBlock::size.

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

5 years ago[flang] Merge pull request flang-compiler/f18#215 from flang-compiler/tsk2
Tim Keith [Tue, 23 Oct 2018 21:35:57 +0000 (14:35 -0700)]
[flang] Merge pull request flang-compiler/f18#215 from flang-compiler/tsk2

Refactoring: add SemanticsContext class

Original-commit: flang-compiler/f18@99b6ac0ddc4304d9e900c9acf7c31ef607334528
Reviewed-on: https://github.com/flang-compiler/f18/pull/215

5 years ago[flang] Rename PushLocation() to SetLocation().
Tim Keith [Tue, 23 Oct 2018 21:35:13 +0000 (14:35 -0700)]
[flang] Rename PushLocation() to SetLocation().

Original-commit: flang-compiler/f18@1b5593c12b23442b5f9fb2ea0a600f1efd5b168d
Reviewed-on: https://github.com/flang-compiler/f18/pull/215

5 years ago[flang] Add FoldingContext to SemanticsContext
Tim Keith [Mon, 22 Oct 2018 23:41:26 +0000 (16:41 -0700)]
[flang] Add FoldingContext to SemanticsContext

FoldingContext is now part of SemanticsContext. It is created at the
beginning with a default-constructed CharBlock as the location in its
ContextualMessages.

Add PushLocation() to ContextualMessages to remember the previous source
location and set a new one. The old one is restored when the returned
object goes out of scope.

SemanticsContext is now the only state passed in to class ExprAnalyzer,
class Mutator, AnalyzeExpr(), AnalyzeExpressions().

Add Say() convenience functions for reporting errors to ExprAnalyzer.

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

5 years ago[flang] Refactoring: add SemanticsContext class
Tim Keith [Mon, 22 Oct 2018 14:37:38 +0000 (07:37 -0700)]
[flang] Refactoring: add SemanticsContext class

The new SemanticsContext holds the state of semantics whose lifetime
spans all of the compilations. It contains the scope tree (and so all
symbols), the intrinsics table, messages, and the state of options that
affect semantics (default kinds, search directories, etc.)

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

5 years ago[flang] Merge pull request flang-compiler/f18#214 from flang-compiler/tsk2
Tim Keith [Thu, 18 Oct 2018 18:07:47 +0000 (11:07 -0700)]
[flang] Merge pull request flang-compiler/f18#214 from flang-compiler/tsk2

More name resolution for construct entities

Original-commit: flang-compiler/f18@848b067be81a6267c04b2b1fb9ab3163f85141c0
Reviewed-on: https://github.com/flang-compiler/f18/pull/214

5 years ago[flang] More name resolution for construct entities
Tim Keith [Thu, 18 Oct 2018 14:55:48 +0000 (07:55 -0700)]
[flang] More name resolution for construct entities

Push a new scope for constructs and statements that require one
(DataStmt, DO CONCURRENT, ForallConstruct, ForallStmt -- there are more
to do). Currently we use the Block kind of scope because there is no
difference. Perhaps that kind should be renamed to Construct, though it
does apply to statements as well as constructs.

Add DeclareConstructEntity to create a construct or statement entity.
When the type is not specified it can come from the type of a symbol in
the enclosing scope with the same name. Change DeclareObjectEntity et al.
to return the symbol declared, for the benefit of DeclareConstructEntity.

Use DeclareConstructEntity for DO CONCURRENT index-name, LOCAL, and
LOCAL_INIT variables and the data-i-do-variable in DataImpliedDo

Names in SHARED locality spec need special handling: create a new kinds
of symbol with HostAssocDetails to represent the host-association of the
shared variables within the construct scope. That symbol gets the
LocalityShared flag without affecting the symbol in the outer scope.
HostAssoc symbols may be useful in other contexts, e.g. up-level
references to local variables.

Add parser::DoConstruct::IsDoConcurrent() because DO CONCURRENT loops
introduce a construct scope while other DO loops do not.

Move CanonicalizeDo to before name resolution so that name resolution
doesn't have to deal with labeled DO CONCURRENT loops.

Allow for type of index name to be specified in ConcurrentHeader.

Resolve the derived type name in an AllocateStmt, StructureConstructor

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

5 years ago[flang] Simplify unparse-with-symbols.cc
Tim Keith [Mon, 15 Oct 2018 21:44:01 +0000 (14:44 -0700)]
[flang] Simplify unparse-with-symbols.cc

Change it so that the first time a symbol is referenced, its full
definition is emitted, prefixed by "DEF:", and subsequent references
are prefixed with "REF:".

This doesn't give exactly the same results as before but it is
sufficient for testing and is simpler and easier to maintain.
The expected results need to be tweaked accordingly.

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

5 years ago[flang] Merge pull request flang-compiler/f18#213 from flang-compiler/pmk1
Peter Klausler [Tue, 16 Oct 2018 22:31:55 +0000 (15:31 -0700)]
[flang] Merge pull request flang-compiler/f18#213 from flang-compiler/pmk1

Fully parameterize default kinds of intrinsic types

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

5 years ago[flang] Add -i8, -r8, &c. options to f18 development driver
peter klausler [Tue, 16 Oct 2018 21:42:22 +0000 (14:42 -0700)]
[flang] Add -i8, -r8, &c. options to f18 development driver

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

5 years ago[flang] Eliminate DefaultInteger
peter klausler [Tue, 16 Oct 2018 20:24:57 +0000 (13:24 -0700)]
[flang] Eliminate DefaultInteger

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

5 years ago[flang] Eliminating old default type declarations
peter klausler [Tue, 16 Oct 2018 00:11:24 +0000 (17:11 -0700)]
[flang] Eliminating old default type declarations

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

5 years ago[flang] Extract IntrinsicTypeDefaultKinds, move it into semantics
peter klausler [Mon, 15 Oct 2018 22:28:47 +0000 (15:28 -0700)]
[flang] Extract IntrinsicTypeDefaultKinds, move it into semantics

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

5 years ago[flang] Merge pull request flang-compiler/f18#212 from flang-compiler/pmk0
Peter Klausler [Mon, 15 Oct 2018 21:09:41 +0000 (14:09 -0700)]
[flang] Merge pull request flang-compiler/f18#212 from flang-compiler/pmk0

Intrinsic function tables

Original-commit: flang-compiler/f18@795f790e93fd937decfab6d51eaa0f68a4f3cba1
Reviewed-on: https://github.com/flang-compiler/f18/pull/212

5 years ago[flang] review comments
peter klausler [Mon, 15 Oct 2018 20:39:51 +0000 (13:39 -0700)]
[flang] review comments

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

5 years ago[flang] improve naming, silence bogus warnings
peter klausler [Mon, 15 Oct 2018 19:17:30 +0000 (12:17 -0700)]
[flang] improve naming, silence bogus warnings

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

5 years ago[flang] more unit testing, fix a bug
peter klausler [Fri, 12 Oct 2018 23:25:39 +0000 (16:25 -0700)]
[flang] more unit testing, fix a bug

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

5 years ago[flang] unit testing, better error messages
peter klausler [Fri, 12 Oct 2018 23:01:55 +0000 (16:01 -0700)]
[flang] unit testing, better error messages

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

5 years ago[flang] begin unit testing
peter klausler [Fri, 12 Oct 2018 00:01:31 +0000 (17:01 -0700)]
[flang] begin unit testing

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

5 years ago[flang] finish most intrinsic table entries
peter klausler [Thu, 11 Oct 2018 21:51:14 +0000 (14:51 -0700)]
[flang] finish most intrinsic table entries

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

5 years ago[flang] a few more intrinsics and some style guide comments
peter klausler [Wed, 10 Oct 2018 23:45:17 +0000 (16:45 -0700)]
[flang] a few more intrinsics and some style guide comments

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

5 years ago[flang] more intrinsics
peter klausler [Wed, 10 Oct 2018 17:48:12 +0000 (10:48 -0700)]
[flang] more intrinsics

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

5 years ago[flang] remove arg->intValue field
peter klausler [Tue, 9 Oct 2018 19:07:29 +0000 (12:07 -0700)]
[flang] remove arg->intValue field

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

5 years ago[flang] debug initial intrinsic table probes
peter klausler [Mon, 8 Oct 2018 22:35:19 +0000 (15:35 -0700)]
[flang] debug initial intrinsic table probes

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

5 years ago[flang] error messages
peter klausler [Fri, 5 Oct 2018 18:32:54 +0000 (11:32 -0700)]
[flang] error messages

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

5 years ago[flang] checkpoint
peter klausler [Fri, 5 Oct 2018 16:57:53 +0000 (09:57 -0700)]
[flang] checkpoint

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

5 years ago[flang] intrinsic pattern matching
peter klausler [Thu, 4 Oct 2018 20:43:33 +0000 (13:43 -0700)]
[flang] intrinsic pattern matching

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

5 years ago[flang] buildable checkpoint before merging with master
peter klausler [Mon, 1 Oct 2018 18:27:45 +0000 (11:27 -0700)]
[flang] buildable checkpoint before merging with master

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

5 years ago[flang] initial intrinsics table
peter klausler [Sat, 29 Sep 2018 00:02:11 +0000 (17:02 -0700)]
[flang] initial intrinsics table

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

5 years ago[flang] Merge pull request flang-compiler/f18#210 from flang-compiler/tsk2
Tim Keith [Fri, 12 Oct 2018 14:06:18 +0000 (07:06 -0700)]
[flang] Merge pull request flang-compiler/f18#210 from flang-compiler/tsk2

More name resolution

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

5 years ago[flang] More miscellaneous name resolution
Tim Keith [Wed, 10 Oct 2018 23:20:46 +0000 (16:20 -0700)]
[flang] More miscellaneous name resolution

Resolve the index name in a FORALL, DO, or DO CONCURRENT.

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

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

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

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

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

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

5 years ago[flang] Check conflicting construct names
Tim Keith [Tue, 25 Sep 2018 15:53:53 +0000 (08:53 -0700)]
[flang] Check conflicting construct names

Check that construct names don't conflict with other construct names or
entities in the same scoping unit.

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

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

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

5 years ago[flang] Merge pull request flang-compiler/f18#209 from flang-compiler/pmk2
Peter Klausler [Wed, 10 Oct 2018 23:03:36 +0000 (16:03 -0700)]
[flang] Merge pull request flang-compiler/f18#209 from flang-compiler/pmk2

Undef HUGE for issue#202, remove some obsolete casts, clean up a little

Original-commit: flang-compiler/f18@498df684cf9e166cc636e8cea758854b55f13941
Reviewed-on: https://github.com/flang-compiler/f18/pull/209

5 years ago[flang] Prep for review
peter klausler [Wed, 10 Oct 2018 22:27:17 +0000 (15:27 -0700)]
[flang] Prep for review

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

5 years ago[flang] Remove some obsolete casts now that Integer has a better constructor
peter klausler [Wed, 10 Oct 2018 21:40:32 +0000 (14:40 -0700)]
[flang] Remove some obsolete casts now that Integer has a better constructor

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

5 years ago[flang] Fix issue#202 by avoiding clang+BSD/Darwin header bug
peter klausler [Wed, 10 Oct 2018 21:29:35 +0000 (14:29 -0700)]
[flang] Fix issue#202 by avoiding clang+BSD/Darwin header bug

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

5 years ago[flang] Merge pull request flang-compiler/f18#208 from flang-compiler/pmk1
Peter Klausler [Wed, 10 Oct 2018 21:59:06 +0000 (14:59 -0700)]
[flang] Merge pull request flang-compiler/f18#208 from flang-compiler/pmk1

Removed obsolete comments and conversions

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

5 years ago[flang] Removed obsolete comments and conversions
Paul Henning [Wed, 10 Oct 2018 20:54:25 +0000 (14:54 -0600)]
[flang] Removed obsolete comments and conversions

The addition of a more robust Integer constructor for POD types has
made some comments and static_cast expressions obsolete.

Original-commit: flang-compiler/f18@847b8a768417bb3ccfa5dd919364ac39880bbb5e
Reviewed-on: https://github.com/flang-compiler/f18/pull/208

5 years ago[flang] Merge pull request flang-compiler/f18#206 from flang-compiler/pmk1
Peter Klausler [Wed, 10 Oct 2018 21:07:56 +0000 (14:07 -0700)]
[flang] Merge pull request flang-compiler/f18#206 from flang-compiler/pmk1

Make conversions between C++ integral types and Integer fully generic.

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

5 years ago[flang] Make conversions between C++ integral types and Integer fully generic.
peter klausler [Wed, 10 Oct 2018 20:06:01 +0000 (13:06 -0700)]
[flang] Make conversions between C++ integral types and Integer fully generic.

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

5 years ago[flang] Merge pull request flang-compiler/f18#205 from flang-compiler/tsk8
Tim Keith [Wed, 10 Oct 2018 18:47:28 +0000 (11:47 -0700)]
[flang] Merge pull request flang-compiler/f18#205 from flang-compiler/tsk8

Use fundamental types in overloadings of Unparse.

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

5 years ago[flang] Use fundamental types in overloadings of Unparse.
Tim Keith [Wed, 10 Oct 2018 14:24:27 +0000 (07:24 -0700)]
[flang] Use fundamental types in overloadings of Unparse.

Different systems map std::size_t, string::size_type, etc. to different
fundamental types. To ensure they are all covered, make the overloadings
of Unparse for integer types use only fundamental types.

This fixes compilations problems on Darwin and *BSD systems.

Original-commit: flang-compiler/f18@5576ed49a2ebe4bfae4a53772a6e0a0d98c18fa0
Reviewed-on: https://github.com/flang-compiler/f18/pull/205

5 years ago[flang] Merge pull request flang-compiler/f18#203 from flang-compiler/eas7
Eric Schweitz [Mon, 8 Oct 2018 18:23:19 +0000 (11:23 -0700)]
[flang] Merge pull request flang-compiler/f18#203 from flang-compiler/eas7

do a little polishing on the DO loop canonicalization code

Original-commit: flang-compiler/f18@93e68870530184fc0d7c0ce0584b956b0fbf373e
Reviewed-on: https://github.com/flang-compiler/f18/pull/203

5 years ago[flang] Build the label stack locally and thread the iterators explicitly rather
Eric Schweitz [Fri, 5 Oct 2018 20:59:43 +0000 (13:59 -0700)]
[flang] Build the label stack locally and thread the iterators explicitly rather
than as implied state within the Mutator object.

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

5 years ago[flang] Use move semantics directly to move the LoopControl object.
Eric Schweitz [Fri, 5 Oct 2018 18:10:47 +0000 (11:10 -0700)]
[flang] Use move semantics directly to move the LoopControl object.

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

5 years ago[flang] Merge pull request flang-compiler/f18#200 from flang-compiler/pmk3
Peter Klausler [Thu, 4 Oct 2018 22:49:47 +0000 (15:49 -0700)]
[flang] Merge pull request flang-compiler/f18#200 from flang-compiler/pmk3

Add a test, a flag, a fix, and a parse tree visitor tweak.

Original-commit: flang-compiler/f18@5344ef9272f2f46702e96409c8d697b927542e20
Reviewed-on: https://github.com/flang-compiler/f18/pull/200

5 years ago[flang] Prep for review
peter klausler [Wed, 3 Oct 2018 17:31:37 +0000 (10:31 -0700)]
[flang] Prep for review

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

5 years ago[flang] Parse nonlabel DO within label DO better; add -fdebug-semantics; more testing
peter klausler [Tue, 2 Oct 2018 23:42:15 +0000 (16:42 -0700)]
[flang] Parse nonlabel DO within label DO better; add -fdebug-semantics; more testing

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

5 years ago[flang] rework non-block DO loop canonicalization
peter klausler [Tue, 2 Oct 2018 21:19:51 +0000 (14:19 -0700)]
[flang] rework non-block DO loop canonicalization

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

5 years ago[flang] add test for canonicalization of DOs
peter klausler [Tue, 2 Oct 2018 16:39:25 +0000 (09:39 -0700)]
[flang] add test for canonicalization of DOs

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

5 years ago[flang] Merge pull request flang-compiler/f18#201 from flang-compiler/eas8
Eric Schweitz [Thu, 4 Oct 2018 20:25:28 +0000 (13:25 -0700)]
[flang] Merge pull request flang-compiler/f18#201 from flang-compiler/eas8

Fix recursion bug so canondo04.f90 test passes.

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

5 years ago[flang] Add static to explicitly denote that some member functions do not access
Eric Schweitz [Thu, 4 Oct 2018 16:57:39 +0000 (09:57 -0700)]
[flang] Add static to explicitly denote that some member functions do not access
the object's state; it is explicitly passed instead.

Original-commit: flang-compiler/f18@53df8087f456bf6d1cdee9ab4009ae8d77498831
Reviewed-on: https://github.com/flang-compiler/f18/pull/201

5 years ago[flang] Fix recursion bug so canondo04.f90 test passes.
Eric Schweitz [Thu, 4 Oct 2018 16:25:58 +0000 (09:25 -0700)]
[flang] Fix recursion bug so canondo04.f90 test passes.

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

5 years ago[flang] Merge pull request flang-compiler/f18#198 from flang-compiler/pmk2
Peter Klausler [Tue, 2 Oct 2018 17:15:54 +0000 (10:15 -0700)]
[flang] Merge pull request flang-compiler/f18#198 from flang-compiler/pmk2

Correct the spelling of LOCAL_INIT clauses on DO CONCURRENT statements.

Original-commit: flang-compiler/f18@760c0641949a06fc351904bdf89f3668f3647c2d
Reviewed-on: https://github.com/flang-compiler/f18/pull/198

5 years ago[flang] Correct the spelling of LOCAL_INIT clauses on DO CONCURRENT statements.
peter klausler [Mon, 1 Oct 2018 22:00:09 +0000 (15:00 -0700)]
[flang] Correct the spelling of LOCAL_INIT clauses on DO CONCURRENT statements.

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

5 years ago[flang] Merge pull request flang-compiler/f18#199 from flang-compiler/eas8
Eric Schweitz [Tue, 2 Oct 2018 16:52:11 +0000 (09:52 -0700)]
[flang] Merge pull request flang-compiler/f18#199 from flang-compiler/eas8

Review comments

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

5 years ago[flang] Review comments
Eric Schweitz [Tue, 2 Oct 2018 16:29:53 +0000 (09:29 -0700)]
[flang] Review comments

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

5 years ago[flang] Merge pull request flang-compiler/f18#197 from flang-compiler/pmk1
Peter Klausler [Tue, 2 Oct 2018 16:38:12 +0000 (09:38 -0700)]
[flang] Merge pull request flang-compiler/f18#197 from flang-compiler/pmk1

Resolve g++ 7.2 build problem

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

5 years ago[flang] Resolve g++ 7.2 build problem
peter klausler [Mon, 1 Oct 2018 21:36:31 +0000 (14:36 -0700)]
[flang] Resolve g++ 7.2 build problem

Original-commit: flang-compiler/f18@09859b2e9c53195c877b89a288ea8aac43cb1804
Reviewed-on: https://github.com/flang-compiler/f18/pull/197

5 years ago[flang] Merge pull request flang-compiler/f18#193 from flang-compiler/eas8
Eric Schweitz [Mon, 1 Oct 2018 16:28:49 +0000 (09:28 -0700)]
[flang] Merge pull request flang-compiler/f18#193 from flang-compiler/eas8

canonicalization of DO constructs

Original-commit: flang-compiler/f18@9842890ed4e712f8292e995d22841526ce92d2d4
Reviewed-on: https://github.com/flang-compiler/f18/pull/193

5 years ago[flang] Handle review comments
Eric Schweitz [Fri, 21 Sep 2018 18:12:02 +0000 (11:12 -0700)]
[flang] Handle review comments

Original-commit: flang-compiler/f18@9789d4d21ba1fa0ab60d8d50fcfd831ff596b317
Reviewed-on: https://github.com/flang-compiler/f18/pull/193

5 years ago[flang] Rename two member functions
Eric Schweitz [Fri, 21 Sep 2018 17:51:06 +0000 (10:51 -0700)]
[flang] Rename two member functions

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

5 years ago[flang] Fix the double end do condition. Translate a labelled end do into a
Eric Schweitz [Fri, 21 Sep 2018 15:22:41 +0000 (08:22 -0700)]
[flang] Fix the double end do condition. Translate a labelled end do into a
continue and preserve the label for control flow.

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

5 years ago[flang] canonicalize DO constructs
Eric Schweitz [Wed, 19 Sep 2018 21:26:02 +0000 (14:26 -0700)]
[flang] canonicalize DO constructs
Fix a bug with BLOCK DATA name matching
Add tests and finish up DO loop canonicalization

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

5 years ago[flang] Merge pull request flang-compiler/f18#195 from flang-compiler/pmk0
Peter Klausler [Wed, 26 Sep 2018 19:59:12 +0000 (12:59 -0700)]
[flang] Merge pull request flang-compiler/f18#195 from flang-compiler/pmk0

Categorize Fortran intrinsic procedures (and some more work on expressions)

Original-commit: flang-compiler/f18@032be90fb0bcb1432cd9dba46f42744fcb3ddd8f
Reviewed-on: https://github.com/flang-compiler/f18/pull/195

5 years ago[flang] More documentation
peter klausler [Wed, 26 Sep 2018 19:58:43 +0000 (12:58 -0700)]
[flang] More documentation

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

5 years ago[flang] Improve documentation per review comments.
peter klausler [Wed, 26 Sep 2018 17:42:55 +0000 (10:42 -0700)]
[flang] Improve documentation per review comments.

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

5 years ago[flang] tweaks to intrinsics.md
peter klausler [Tue, 25 Sep 2018 23:59:41 +0000 (16:59 -0700)]
[flang] tweaks to intrinsics.md

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

5 years ago[flang] review
peter klausler [Tue, 25 Sep 2018 22:36:00 +0000 (15:36 -0700)]
[flang] review

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

5 years ago[flang] polish documentation of intrinsics
peter klausler [Tue, 25 Sep 2018 22:23:01 +0000 (15:23 -0700)]
[flang] polish documentation of intrinsics

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

5 years ago[flang] documentation
peter klausler [Tue, 25 Sep 2018 21:47:55 +0000 (14:47 -0700)]
[flang] documentation

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

5 years ago[flang] checkpoint
peter klausler [Tue, 25 Sep 2018 20:26:35 +0000 (13:26 -0700)]
[flang] checkpoint

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

5 years ago[flang] typed function references
peter klausler [Thu, 20 Sep 2018 19:34:29 +0000 (12:34 -0700)]
[flang] typed function references

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