platform/upstream/llvm.git
5 years ago[flang] Distinguish between unanalyzed and error expressions
Tim Keith [Sat, 20 Apr 2019 00:14:50 +0000 (17:14 -0700)]
[flang] Distinguish between unanalyzed and error expressions

When an Expr or Variable is analyzed, always fill in a GenericExprWrapper
for it. That now holds the result of expression analysis which is
std::nullopt when there is an error.

After the ExprChecker pass has finished, the typedExpr data member of
Variables and top-level Exprs should be filled in. Assert that is the
case when we access them.

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

5 years ago[flang] Merge pull request flang-compiler/f18#426 from flang-compiler/pmk-425
Peter Klausler [Mon, 22 Apr 2019 17:37:07 +0000 (10:37 -0700)]
[flang] Merge pull request flang-compiler/f18#426 from flang-compiler/pmk-425

Fix flang-compiler/f18#425, build fail with libc++

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

5 years ago[flang] Fix flang-compiler/f18#425, build fail with libc++
peter klausler [Mon, 22 Apr 2019 17:10:09 +0000 (10:10 -0700)]
[flang] Fix flang-compiler/f18#425, build fail with libc++

Original-commit: flang-compiler/f18@96a553b189ceb535a120b1f4d29ddc8e9d4a841c
Reviewed-on: https://github.com/flang-compiler/f18/pull/426

5 years ago[flang] Merge pull request flang-compiler/f18#421 from flang-compiler/pmk3
Peter Klausler [Mon, 22 Apr 2019 17:08:20 +0000 (10:08 -0700)]
[flang] Merge pull request flang-compiler/f18#421 from flang-compiler/pmk3

Add some utility functions to semantics/tools

Original-commit: flang-compiler/f18@80ef214fb8132584dafea20c763223cd7691a9bc
Reviewed-on: https://github.com/flang-compiler/f18/pull/421

5 years ago[flang] Add some utility functions to semantics/tools
peter klausler [Thu, 18 Apr 2019 22:07:40 +0000 (15:07 -0700)]
[flang] Add some utility functions to semantics/tools

Original-commit: flang-compiler/f18@59006b3a5ce6dba7f15831e60a83153cee998012
Reviewed-on: https://github.com/flang-compiler/f18/pull/421

5 years ago[flang] Merge pull request flang-compiler/f18#422 from flang-compiler/tsk-expr
Tim Keith [Fri, 19 Apr 2019 21:33:04 +0000 (14:33 -0700)]
[flang] Merge pull request flang-compiler/f18#422 from flang-compiler/tsk-expr

Continue semantics checks after expression errors

Original-commit: flang-compiler/f18@55cf9ee7aab95588fd7a4fc4423d17c2689c074e
Reviewed-on: https://github.com/flang-compiler/f18/pull/422

5 years ago[flang] Share code for analyzing Expr and Variable
Tim Keith [Fri, 19 Apr 2019 19:55:36 +0000 (12:55 -0700)]
[flang] Share code for analyzing Expr and Variable

Move check for empty CharBlock from here to SetLocation.
(Can an Expr ever have an empty source location?)

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

5 years ago[flang] Continue semantics checks after expression error
Tim Keith [Fri, 19 Apr 2019 16:21:12 +0000 (09:21 -0700)]
[flang] Continue semantics checks after expression error

Change statement semantics to continue with checks after an error
in expression analysis. This allows the compiler to report more
compilation errors. It requires that statement semantics not assume
that every parser::Expr has a valid evaluate::Expr.

For example, the test cases in coarrays02.f90 can now be moved to
coarrays01.f90. Previously the errors like "Must be a scalar value"
from ExprChecker prevented other errors from being detected by
CoarrayChecker.

Change to a stable sort of messages so that they come out in a
deterministic order. Otherwise when there are two errors at the
same location (e.g. line 71 of coarrays01.f90) the test can fail
randomly.

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

5 years ago[flang] Use SomeExpr rather than GenericExprWrapper in checkers
Tim Keith [Fri, 19 Apr 2019 15:22:28 +0000 (08:22 -0700)]
[flang] Use SomeExpr rather than GenericExprWrapper in checkers

Use GetExpr in checker classes to get analyzed expressions out of parse
tree nodes. Don't assume that they are always present. Change the
utility functions in tools.h to use SomeExpr rather than
GenericExprWrapper.

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

5 years ago[flang] Remove redundant checks enforced in the grammar
Tim Keith [Fri, 19 Apr 2019 14:11:19 +0000 (07:11 -0700)]
[flang] Remove redundant checks enforced in the grammar

Expression analysis enforces constraints implied by the grammar,
for example scalar-expr, scalar-int-expr, etc. These no longer need
to be checked during statement semantics.

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

5 years ago[flang] Preserve source location when rewriting parse tree
Tim Keith [Fri, 19 Apr 2019 00:55:24 +0000 (17:55 -0700)]
[flang] Preserve source location when rewriting parse tree

When a Designator is created from a FunctionReference or
StmtFunctionStmt, copy the source data member too.

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

5 years ago[flang] Save and fetch analyzed Expr in Variable
Tim Keith [Fri, 19 Apr 2019 00:48:55 +0000 (17:48 -0700)]
[flang] Save and fetch analyzed Expr in Variable

Add typedExpr data member to Variable like that in Expr.
When expression analysis analyzed a Variable it stores the
resulting evaluate::Expr there.

Add GetExpr overloads in semantics/tools.h for using in statement
semantics. It gets an evaluate::Expr from an Expr, Variable, or
wrapper around one of those. It returns a const pointer so that
clients cannot modify the cached expression (and copies do not
have to be made).

Change CoarrayChecker to make use of GetExpr. It will eventually
replace all references to typedExpr in statement semantics.

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

5 years ago[flang] Merge pull request flang-compiler/f18#420 from flang-compiler/pmk2
Peter Klausler [Thu, 18 Apr 2019 22:09:25 +0000 (15:09 -0700)]
[flang] Merge pull request flang-compiler/f18#420 from flang-compiler/pmk2

Flatten and fold array operations

Original-commit: flang-compiler/f18@8693c80f33805cc48e6141d600e2898f02885173
Reviewed-on: https://github.com/flang-compiler/f18/pull/420

5 years ago[flang] Fold array operations
peter klausler [Thu, 18 Apr 2019 21:11:15 +0000 (14:11 -0700)]
[flang] Fold array operations

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

5 years ago[flang] Merge pull request flang-compiler/f18#419 from flang-compiler/pmk1
Peter Klausler [Thu, 18 Apr 2019 21:32:22 +0000 (14:32 -0700)]
[flang] Merge pull request flang-compiler/f18#419 from flang-compiler/pmk1

More work on classes to represent characteristics of procedures.

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

5 years ago[flang] Return a missing result
peter klausler [Thu, 18 Apr 2019 21:27:59 +0000 (14:27 -0700)]
[flang] Return a missing result

Original-commit: flang-compiler/f18@04f9fd39b91dff2987c87fbcd6db043b6811be02
Reviewed-on: https://github.com/flang-compiler/f18/pull/419

5 years ago[flang] Use Attr_enumSize rather than an arbitrary 32.
peter klausler [Thu, 18 Apr 2019 21:25:22 +0000 (14:25 -0700)]
[flang] Use Attr_enumSize rather than an arbitrary 32.

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

5 years ago[flang] More work on classes to represent characteristics of procedures.
peter klausler [Thu, 18 Apr 2019 20:25:20 +0000 (13:25 -0700)]
[flang] More work on classes to represent characteristics of procedures.

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

5 years ago[flang] Merge pull request flang-compiler/f18#367 from pawosm-arm/error-stop
Steve Scalpone [Wed, 17 Apr 2019 21:13:23 +0000 (14:13 -0700)]
[flang] Merge pull request flang-compiler/f18#367 from pawosm-arm/error-stop

Semantics checker for STOP and ERROR STOP statements.

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

5 years ago[flang] Semantics checker for STOP and ERROR STOP statements - trust in implied check
Paul Osmialowski [Tue, 16 Apr 2019 22:17:22 +0000 (23:17 +0100)]
[flang] Semantics checker for STOP and ERROR STOP statements - trust in implied check

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@7a98732f72649e65fdb1a286ae976aa3f3a9d4a0
Reviewed-on: https://github.com/flang-compiler/f18/pull/367

5 years ago[flang] Semantics checker for STOP and ERROR STOP statements - one more batch of...
Paul Osmialowski [Tue, 16 Apr 2019 18:50:52 +0000 (19:50 +0100)]
[flang] Semantics checker for STOP and ERROR STOP statements - one more batch of post-review tweaks

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@f49ee0df050cce83cc5cdd4c04a3d16465ebeacc
Reviewed-on: https://github.com/flang-compiler/f18/pull/367
Tree-same-pre-rewrite: false

5 years ago[flang] Semantics checker for STOP and ERROR STOP statements - remove one more functi...
Paul Osmialowski [Tue, 16 Apr 2019 09:32:02 +0000 (10:32 +0100)]
[flang] Semantics checker for STOP and ERROR STOP statements - remove one more function from tools

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@9937b524fab7408aac9885ce737716047ec3493e
Reviewed-on: https://github.com/flang-compiler/f18/pull/367
Tree-same-pre-rewrite: false

5 years ago[flang] Semantics checker for STOP and ERROR STOP statements - fix compilation broken...
Paul Osmialowski [Tue, 16 Apr 2019 09:30:29 +0000 (10:30 +0100)]
[flang] Semantics checker for STOP and ERROR STOP statements - fix compilation broken by merge commit

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@1d36ab1f432e9d5de00e072db36e028ac310a8be
Reviewed-on: https://github.com/flang-compiler/f18/pull/367
Tree-same-pre-rewrite: false

5 years ago[flang] Semantics checker for STOP and ERROR STOP statements - remove tools function...
Paul Osmialowski [Mon, 15 Apr 2019 19:53:32 +0000 (20:53 +0100)]
[flang] Semantics checker for STOP and ERROR STOP statements - remove tools function not needed after recent commit

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@1a3dbd97528a0a158cf747c33ab2156c6b48f7a7
Reviewed-on: https://github.com/flang-compiler/f18/pull/367
Tree-same-pre-rewrite: false

5 years ago[flang] Semantics checker for STOP and ERROR STOP statements - remove overhead checks...
Paul Osmialowski [Fri, 12 Apr 2019 10:43:34 +0000 (11:43 +0100)]
[flang] Semantics checker for STOP and ERROR STOP statements - remove overhead checks and corresponding test cases

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@6ce6234acc5dbed42fbacc111be075810f65c554
Reviewed-on: https://github.com/flang-compiler/f18/pull/367
Tree-same-pre-rewrite: false

5 years ago[flang] Semantics checker for STOP and ERROR STOP statements - better variable names
Paul Osmialowski [Thu, 11 Apr 2019 20:43:35 +0000 (21:43 +0100)]
[flang] Semantics checker for STOP and ERROR STOP statements - better variable names

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@8b32caa287149e72834aad3cdc45473678b57605
Reviewed-on: https://github.com/flang-compiler/f18/pull/367
Tree-same-pre-rewrite: false

5 years ago[flang] Semantics checker for STOP and ERROR STOP statements - ExprTypeKindIsDefault...
Paul Osmialowski [Thu, 11 Apr 2019 20:25:45 +0000 (21:25 +0100)]
[flang] Semantics checker for STOP and ERROR STOP statements - ExprTypeKindIsDefault added to the tools

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@669b05b27d7ad5bee6689507d40199e941838b9a
Reviewed-on: https://github.com/flang-compiler/f18/pull/367
Tree-same-pre-rewrite: false

5 years ago[flang] Semantics checker for STOP and ERROR STOP statements - test file rename
Paul Osmialowski [Thu, 11 Apr 2019 18:28:47 +0000 (19:28 +0100)]
[flang] Semantics checker for STOP and ERROR STOP statements - test file rename

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@b89137b6148d5d515757fb6ea9191ba23681f4c4
Reviewed-on: https://github.com/flang-compiler/f18/pull/367
Tree-same-pre-rewrite: false

5 years ago[flang] Semantics checker for STOP and ERROR STOP statements - namespaces sorted
Paul Osmialowski [Thu, 11 Apr 2019 18:27:50 +0000 (19:27 +0100)]
[flang] Semantics checker for STOP and ERROR STOP statements - namespaces sorted

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@d608779668e1c4f328ebb02dcc21536b2c0fdf2c
Reviewed-on: https://github.com/flang-compiler/f18/pull/367
Tree-same-pre-rewrite: false

5 years ago[flang] Semantics checker for STOP and ERROR STOP statements - post review changes
Paul Osmialowski [Thu, 11 Apr 2019 17:42:12 +0000 (18:42 +0100)]
[flang] Semantics checker for STOP and ERROR STOP statements - post review changes

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@08b564832c8a2439f35698d55f1d2a4482e6a54d
Reviewed-on: https://github.com/flang-compiler/f18/pull/367
Tree-same-pre-rewrite: false

5 years ago[flang] Semantics checker for STOP and ERROR STOP statements.
Paul Osmialowski [Mon, 18 Mar 2019 16:19:41 +0000 (16:19 +0000)]
[flang] Semantics checker for STOP and ERROR STOP statements.

This commit introduces a new checker (StopChecker) for STOP
and ERROR STOP Fortran statements along with a test code.

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@c5541745628a8c0c4d252386675c36ea83a68006
Reviewed-on: https://github.com/flang-compiler/f18/pull/367
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#417 from flang-compiler/tsk6
Tim Keith [Wed, 17 Apr 2019 17:31:49 +0000 (10:31 -0700)]
[flang] Merge pull request flang-compiler/f18#417 from flang-compiler/tsk6

Fix bug resolving internal and module functions

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

5 years ago[flang] Dump parse tree even if semantic error occurs
Tim Keith [Wed, 17 Apr 2019 14:44:58 +0000 (07:44 -0700)]
[flang] Dump parse tree even if semantic error occurs

When -fdebug-dump-parse-tree is specified, dump the parse tree even
if semantic errors have occurred. This is necessary to see the parse
tree after it has been transformed.

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

5 years ago[flang] Fix bug resolving internal and module functions
Tim Keith [Wed, 17 Apr 2019 14:42:16 +0000 (07:42 -0700)]
[flang] Fix bug resolving internal and module functions

When analyzing a function call in an expression we weren't properly
recognizing a ProcedureDesignator that was the name of an internal
or module function, i.e. a symbol with SubprogramDetails.

The fix is to add IsProcedure to identify symbols that correspond
to procedures. IsFunction and GetType also need to be extended to
handle this case.

Fixes flang-compiler/f18#391.

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

5 years ago[flang] Merge pull request flang-compiler/f18#416 from flang-compiler/pmk-val-fix
Peter Klausler [Wed, 17 Apr 2019 15:42:57 +0000 (08:42 -0700)]
[flang] Merge pull request flang-compiler/f18#416 from flang-compiler/pmk-val-fix

Resolve ambiguous I/O unit parse in favor of CharVariable.

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

5 years ago[flang] More clean-up
peter klausler [Tue, 16 Apr 2019 23:14:14 +0000 (16:14 -0700)]
[flang] More clean-up

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

5 years ago[flang] Generalize tools, clean up common/unwrap.h with new-found knowledge
peter klausler [Tue, 16 Apr 2019 22:59:04 +0000 (15:59 -0700)]
[flang] Generalize tools, clean up common/unwrap.h with new-found knowledge

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

5 years ago[flang] Address review comments
peter klausler [Tue, 16 Apr 2019 19:28:18 +0000 (12:28 -0700)]
[flang] Address review comments

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

5 years ago[flang] Rewrite I/O units in the parse tree when a variable is not character.
peter klausler [Tue, 16 Apr 2019 17:25:22 +0000 (10:25 -0700)]
[flang] Rewrite I/O units in the parse tree when a variable is not character.

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

5 years ago[flang] Resolve ambiguous I/O unit parse in favor of CharVariable.
peter klausler [Tue, 16 Apr 2019 00:09:48 +0000 (17:09 -0700)]
[flang] Resolve ambiguous I/O unit parse in favor of CharVariable.

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

5 years ago[flang] Add software subnormal flushing around host library calls for hosts that...
jeanPerier [Tue, 16 Apr 2019 08:56:08 +0000 (01:56 -0700)]
[flang] Add software subnormal flushing around host library calls for hosts that cannot do it in HW

Merge pull request flang-compiler/f18#403 from flang-compiler/jpr1

Original-commit: flang-compiler/f18@31125bb081b454f2879c687338a53fecf6d8945c

5 years ago[flang] Remove user warning messages for lack of subnormal HW flushing
Jean Perier [Mon, 15 Apr 2019 08:54:35 +0000 (01:54 -0700)]
[flang] Remove user warning messages for lack of subnormal HW flushing

Original-commit: flang-compiler/f18@4aecc1bceef9c0a7de6d2dfb57c92b0939943b4b

5 years ago[flang] also fix accessor name
Jean Perier [Fri, 12 Apr 2019 09:34:56 +0000 (02:34 -0700)]
[flang] also fix accessor name

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

5 years ago[flang] address comment. Follow style guideline
Jean Perier [Fri, 12 Apr 2019 09:31:54 +0000 (02:31 -0700)]
[flang] address comment. Follow style guideline

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

5 years ago[flang] removed unused func in tests
Jean Perier [Thu, 11 Apr 2019 14:59:12 +0000 (07:59 -0700)]
[flang] removed unused func in tests

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

5 years ago[flang] Add software subnormal flusing around host library call for host arch that...
Jean Perier [Thu, 11 Apr 2019 14:51:27 +0000 (07:51 -0700)]
[flang] Add software subnormal flusing around host library call for host arch that do not support it

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

5 years ago[flang] make host subnormal flsuhing control test runtime independent
Jean Perier [Tue, 9 Apr 2019 11:27:27 +0000 (04:27 -0700)]
[flang] make host subnormal flsuhing control test runtime independent

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

5 years ago[flang] Test host subnormal flushing setup when folding on host
Jean Perier [Thu, 4 Apr 2019 14:40:03 +0000 (07:40 -0700)]
[flang] Test host subnormal flushing setup when folding on host

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

5 years ago[flang] Merge pull request flang-compiler/f18#415 from flang-compiler/pmk-source...
Peter Klausler [Mon, 15 Apr 2019 23:06:26 +0000 (16:06 -0700)]
[flang] Merge pull request flang-compiler/f18#415 from flang-compiler/pmk-source-variables

Capture source locations for Designators and Calls

Original-commit: flang-compiler/f18@389423c71866205b7a3dc34f95a9de6f9daf4727
Reviewed-on: https://github.com/flang-compiler/f18/pull/415

5 years ago[flang] Fix bug found in testing
peter klausler [Mon, 15 Apr 2019 22:53:18 +0000 (15:53 -0700)]
[flang] Fix bug found in testing

Original-commit: flang-compiler/f18@45a1e6e3dc25132a2376a19c391242906426e3d2
Reviewed-on: https://github.com/flang-compiler/f18/pull/415

5 years ago[flang] Capture source locations for Designators and Calls
peter klausler [Mon, 15 Apr 2019 22:18:07 +0000 (15:18 -0700)]
[flang] Capture source locations for Designators and Calls

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

5 years ago[flang] Merge pull request flang-compiler/f18#414 from flang-compiler/tsk3
Tim Keith [Mon, 15 Apr 2019 21:07:11 +0000 (14:07 -0700)]
[flang] Merge pull request flang-compiler/f18#414 from flang-compiler/tsk3

More coarray name resolution and semantic checks

Original-commit: flang-compiler/f18@3008e8638d91b08e614a3a4619c6e5e387c41cec
Reviewed-on: https://github.com/flang-compiler/f18/pull/414

5 years ago[flang] Address review comments
Tim Keith [Mon, 15 Apr 2019 18:35:12 +0000 (11:35 -0700)]
[flang] Address review comments

Original-commit: flang-compiler/f18@577629f4895fab4f1e471694b0e728def2fe6ef5
Reviewed-on: https://github.com/flang-compiler/f18/pull/414

5 years ago[flang] More coarray name resolution and semantic checks
Tim Keith [Mon, 15 Apr 2019 17:26:20 +0000 (10:26 -0700)]
[flang] More coarray name resolution and semantic checks

Add CoarrayChecker to check for valid team-value in CHANGE TEAM,
SYNC TEAM, and image selector. Check that coarray names and selector
names are distinct in CHANGE TEAM.

Resolve the variable in a coarray-association.
Create a scope for the construct entities of a CHANGE TEAM construct.

Add ResolveSelector to resolve a parser::Selector into an Expr and
optional variable name (and a source location for messages). Make use of
ResolveSelector to handle coarray-association, as well as it's previous
use in associate-stmt.

Improve the check for C1157 in select-type-stmt and add a test.

Add a test for "Associate name must have a type".

Move ResolveName, ResolveDataRef, etc. from ResolveNamesVisitor
to DeclarationVisitor so that they are available in ConstructVisitor
as well. Add ResolveVariable and ResolveDesignator.

In the parse tree, change TeamValue from a type alias to a wrapper
class. We already had a wrapper class anyway, ImageSelectorSpec::Team,
so the new TeamValue can be used instead. This allows the member
of ImageSelectorSpec to be treated like other occurrences of TeamValue.

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

5 years ago[flang] Merge branch 'sjs-check-return'
Steve Scalpone [Mon, 15 Apr 2019 17:59:12 +0000 (10:59 -0700)]
[flang] Merge branch 'sjs-check-return'

Conflicts:
lib/semantics/semantics.cc
test/semantics/CMakeLists.txt

Original-commit: flang-compiler/f18@71ae0d091585537738059637144f1985fd4b05f1

5 years ago[flang] FindContainingSubprogram returns a pointer, not a reference.
Steve Scalpone [Mon, 15 Apr 2019 17:09:40 +0000 (10:09 -0700)]
[flang] FindContainingSubprogram returns a pointer, not a reference.

Original-commit: flang-compiler/f18@7d221b09bd9b77800d85e9bc2a0084a95237be65

5 years ago[flang] Avoid copying scope. Improve readability.
Steve Scalpone [Mon, 15 Apr 2019 16:41:27 +0000 (09:41 -0700)]
[flang] Avoid copying scope. Improve readability.

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

5 years ago[flang] Scope is only ever set to the address of a Scope,
Steve Scalpone [Mon, 15 Apr 2019 05:16:09 +0000 (22:16 -0700)]
[flang] Scope is only ever set to the address of a Scope,
so it can never be null. The condition should be
scope->kind() != Scope::Kind::Global.
And clang-format.

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

5 years ago[flang] Implement semantic checks for return and alt-return.
Steve Scalpone [Sun, 14 Apr 2019 03:58:25 +0000 (20:58 -0700)]
[flang] Implement semantic checks for return and alt-return.

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

5 years ago[flang] Merge pull request flang-compiler/f18#413 from flang-compiler/pmk-no-scope...
Peter Klausler [Mon, 15 Apr 2019 17:40:35 +0000 (10:40 -0700)]
[flang] Merge pull request flang-compiler/f18#413 from flang-compiler/pmk-no-scope-copy-constr

Delete the default copy constructor for Scope.

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

5 years ago[flang] Delete the default copy constructor for Scope.
peter klausler [Mon, 15 Apr 2019 17:12:26 +0000 (10:12 -0700)]
[flang] Delete the default copy constructor for Scope.

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

5 years ago[flang] Merge pull request flang-compiler/f18#406 from flang-compiler/pmk-fix-expr...
Peter Klausler [Mon, 15 Apr 2019 17:29:41 +0000 (10:29 -0700)]
[flang] Merge pull request flang-compiler/f18#406 from flang-compiler/pmk-fix-expr-constraints

Reactivate tree-driven expression constraint checking

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

5 years ago[flang] Fix clang warning that crept into codebase over weekend
peter klausler [Mon, 15 Apr 2019 17:09:22 +0000 (10:09 -0700)]
[flang] Fix clang warning that crept into codebase over weekend

Original-commit: flang-compiler/f18@8c8ad4c0d8db06f5421cfeb5fe2529ed06fe53c9
Reviewed-on: https://github.com/flang-compiler/f18/pull/406

5 years ago[flang] reformatting
peter klausler [Mon, 15 Apr 2019 16:44:54 +0000 (09:44 -0700)]
[flang] reformatting

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

5 years ago[flang] pass all tests
peter klausler [Fri, 12 Apr 2019 23:50:58 +0000 (16:50 -0700)]
[flang] pass all tests

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

5 years ago[flang] Ensure no failed expression analyses without fatal errors.
peter klausler [Fri, 12 Apr 2019 18:43:03 +0000 (11:43 -0700)]
[flang] Ensure no failed expression analyses without fatal errors.

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

5 years ago[flang] Capitalize INTEGER in error messages
peter klausler [Fri, 12 Apr 2019 17:49:22 +0000 (10:49 -0700)]
[flang] Capitalize INTEGER in error messages

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

5 years ago[flang] Finish up
peter klausler [Fri, 12 Apr 2019 17:20:42 +0000 (10:20 -0700)]
[flang] Finish up

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

5 years ago[flang] Split doconcurrent04.f90 test into one with expression checks and one for...
peter klausler [Fri, 12 Apr 2019 00:25:43 +0000 (17:25 -0700)]
[flang] Split doconcurrent04.f90 test into one with expression checks and one for later semantics pass.

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

5 years ago[flang] Reactivate tree-driven constraint checking on expressions.
peter klausler [Fri, 12 Apr 2019 00:22:16 +0000 (17:22 -0700)]
[flang] Reactivate tree-driven constraint checking on expressions.

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

5 years ago[flang] Merge pull request flang-compiler/f18#409 from flang-compiler/klausler-patch-1
Peter Klausler [Mon, 15 Apr 2019 16:39:33 +0000 (09:39 -0700)]
[flang] Merge pull request flang-compiler/f18#409 from flang-compiler/klausler-patch-1

Update FortranForCProgrammers.md

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

5 years ago[flang] Update FortranForCProgrammers.md
Peter Klausler [Fri, 12 Apr 2019 18:26:36 +0000 (11:26 -0700)]
[flang] Update FortranForCProgrammers.md

Clean up grammar and fix errata.

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

5 years ago[flang] Merge pull request flang-compiler/f18#397 from pawosm-arm/ftz-aarch64
Steve Scalpone [Mon, 15 Apr 2019 08:16:29 +0000 (01:16 -0700)]
[flang] Merge pull request flang-compiler/f18#397 from pawosm-arm/ftz-aarch64

AArch64: Set flushing mode for subnormals on glibc and bionic based systems

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

5 years ago[flang] AArch64: Set flushing mode for subnormals on glibc and bionic based systems
Paul Osmialowski [Wed, 10 Apr 2019 11:38:36 +0000 (12:38 +0100)]
[flang] AArch64: Set flushing mode for subnormals on glibc and bionic based systems

Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@4881e3a91c34671a38ef410a771cd8e0e7a62e10
Reviewed-on: https://github.com/flang-compiler/f18/pull/397

5 years ago[flang] Merge pull request flang-compiler/f18#410 from flang-compiler/tsk6
Tim Keith [Sat, 13 Apr 2019 18:10:18 +0000 (11:10 -0700)]
[flang] Merge pull request flang-compiler/f18#410 from flang-compiler/tsk6

Remove ObjectName alternative from Designator

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

5 years ago[flang] Remove ObjectName alternative from Designator
Tim Keith [Fri, 12 Apr 2019 23:30:03 +0000 (16:30 -0700)]
[flang] Remove ObjectName alternative from Designator

A simple name in a `Designator` is always parsed as a `DataRef`, not
an `ObjectName`. So remove that alternative.

`StmtFunctionStmt::ConvertToAssignment` was creating a `Designator` with
that alternative: change it to do the same thing as the parser.

Add `GetSimpleName` utility functions to check if an `Expr` or `Variable`
represents a simple name. Many of the places that checked for `ObjectName`
in `Designator` are trying to do that.

Clean up includes and forward declarations in `tools.h`.

Original-commit: flang-compiler/f18@97d44de7b146aee601caa0bc529f7af8a6be001e
Reviewed-on: https://github.com/flang-compiler/f18/pull/410

5 years ago[flang] Merge pull request flang-compiler/f18#408 from schweitzpgi/qualtype
Eric Schweitz [Fri, 12 Apr 2019 17:52:01 +0000 (10:52 -0700)]
[flang] Merge pull request flang-compiler/f18#408 from schweitzpgi/qualtype

various code cleanups from QualifiedSmt reviews

Original-commit: flang-compiler/f18@71c5859d077ca8fdfeb246f15ab65139c67da702
Reviewed-on: https://github.com/flang-compiler/f18/pull/408

5 years ago[flang] tweak comment
Eric Schweitz [Fri, 12 Apr 2019 17:22:09 +0000 (10:22 -0700)]
[flang] tweak comment

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

5 years ago[flang] handle review comment: make ctor private
Eric Schweitz [Fri, 12 Apr 2019 17:19:41 +0000 (10:19 -0700)]
[flang] handle review comment: make ctor private

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

5 years ago[flang] various code cleanups from QualifiedType reviews
Eric Schweitz [Thu, 11 Apr 2019 19:04:18 +0000 (12:04 -0700)]
[flang] various code cleanups from QualifiedType reviews

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

5 years ago[flang] Merge pull request flang-compiler/f18#405 from flang-compiler/tsk-include...
Tim Keith [Fri, 12 Apr 2019 15:03:18 +0000 (08:03 -0700)]
[flang] Merge pull request flang-compiler/f18#405 from flang-compiler/tsk-include-cleanup

Clean up includes

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

5 years ago[flang] Clean up includes
Tim Keith [Thu, 11 Apr 2019 23:12:10 +0000 (16:12 -0700)]
[flang] Clean up includes

indirection.h: Doesn't need ../common because it is in common.

expression.h: ../lib is the wrong path but the includes are needed.
They were probably coming in indirectly through other includes.

token-parsers.h: Include was not needed and parser shouldn't have
dependency on evaluate.

Original-commit: flang-compiler/f18@86f6b0023d8a72fd7ccf32b1754b5544b52d22ba
Reviewed-on: https://github.com/flang-compiler/f18/pull/405

5 years ago[flang] Merge pull request flang-compiler/f18#404 from flang-compiler/sjs-cleanup
Steve Scalpone [Thu, 11 Apr 2019 23:21:38 +0000 (16:21 -0700)]
[flang] Merge pull request flang-compiler/f18#404 from flang-compiler/sjs-cleanup

Misc code cleanup.

Original-commit: flang-compiler/f18@034c1317e6341c9abb14dda3f1614b7ceaba500a
Reviewed-on: https://github.com/flang-compiler/f18/pull/404

5 years ago[flang] Cleanup -- Remove unnecessary inline keyword,
Steve Scalpone [Thu, 11 Apr 2019 22:20:14 +0000 (15:20 -0700)]
[flang] Cleanup -- Remove unnecessary inline keyword,
remove unnecessary (void) casts when ignoring
return values, call context_.Say() directly
instead of via messages(), and fix up some
formatting issues using clang-format.

Original-commit: flang-compiler/f18@68e5c02541e1c74abc48327a97291dc2aee530bb
Reviewed-on: https://github.com/flang-compiler/f18/pull/404

5 years ago[flang] Merge pull request flang-compiler/f18#400 from flang-compiler/ps1-392
psteinfeld [Thu, 11 Apr 2019 22:35:44 +0000 (15:35 -0700)]
[flang] Merge pull request flang-compiler/f18#400 from flang-compiler/ps1-392

Removed unused parameter and tweaked the error message one more time.

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

5 years ago[flang] Hopefully the last fixup of messages that appear for bad termination
Peter Steinfeld [Thu, 11 Apr 2019 18:28:49 +0000 (11:28 -0700)]
[flang] Hopefully the last fixup of messages that appear for bad termination
of a DO loop.

Original-commit: flang-compiler/f18@23f7471f3a8490b348d3ca0871c7c377e3173b6d
Reviewed-on: https://github.com/flang-compiler/f18/pull/400

5 years ago[flang] My last change neglected to include the change to the message.
Peter Steinfeld [Wed, 10 Apr 2019 22:13:56 +0000 (15:13 -0700)]
[flang] My last change neglected to include the change to the message.

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

5 years ago[flang] Removed unused parameter and tweaked the error message one more time.
Peter Steinfeld [Wed, 10 Apr 2019 22:08:12 +0000 (15:08 -0700)]
[flang] Removed unused parameter and tweaked the error message one more time.

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

5 years ago[flang] Merge pull request flang-compiler/f18#401 from flang-compiler/check-deallocate
Steve Scalpone [Thu, 11 Apr 2019 21:37:49 +0000 (14:37 -0700)]
[flang] Merge pull request flang-compiler/f18#401 from flang-compiler/check-deallocate

Implement semantic checks for DEALLOCATE statements.

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

5 years ago[flang] Simply use context_.Say. Update test with duplicate dealloc opts.
Steve Scalpone [Thu, 11 Apr 2019 16:39:32 +0000 (09:39 -0700)]
[flang] Simply use context_.Say. Update test with duplicate dealloc opts.

Original-commit: flang-compiler/f18@61b7461552e69be3dde1059f597bd5140d50da8c
Reviewed-on: https://github.com/flang-compiler/f18/pull/401

5 years ago[flang] Correct constraint numbers. Fix spelling error. Run clang-format.
Steve Scalpone [Thu, 11 Apr 2019 11:16:14 +0000 (04:16 -0700)]
[flang] Correct constraint numbers. Fix spelling error. Run clang-format.

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

5 years ago[flang] Implement semantic checks for DEALLOCATE statements.
Steve Scalpone [Thu, 11 Apr 2019 05:17:44 +0000 (22:17 -0700)]
[flang] Implement semantic checks for DEALLOCATE statements.
The parser checks for duplicate dealloc-opts and expr
analysis checks that dealloc-opts are the right type.

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

5 years ago[flang] Merge pull request flang-compiler/f18#399 from schweitzpgi/qualtype
Eric Schweitz [Thu, 11 Apr 2019 16:55:23 +0000 (09:55 -0700)]
[flang] Merge pull request flang-compiler/f18#399 from schweitzpgi/qualtype

add QualifiedStmt class

Original-commit: flang-compiler/f18@984f9d7a297352d03a04adacb50d02b8fef61676
Reviewed-on: https://github.com/flang-compiler/f18/pull/399

5 years ago[flang] add std::move per review comments
Eric Schweitz [Thu, 11 Apr 2019 16:50:55 +0000 (09:50 -0700)]
[flang] add std::move per review comments

Original-commit: flang-compiler/f18@0f3c1616ed6e33eca7646f939c7d551b6fe8d95f
Reviewed-on: https://github.com/flang-compiler/f18/pull/399

5 years ago[flang] add QualifiedStmt class
Eric Schweitz [Fri, 5 Apr 2019 19:22:08 +0000 (12:22 -0700)]
[flang] add QualifiedStmt class

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

5 years ago[flang] Merge pull request flang-compiler/f18#398 from flang-compiler/ps-392
psteinfeld [Wed, 10 Apr 2019 20:13:27 +0000 (13:13 -0700)]
[flang] Merge pull request flang-compiler/f18#398 from flang-compiler/ps-392

Fix issue 392, improve the error message when a DO loop is terminated by something other than
END DO or CONTINUE

Original-commit: flang-compiler/f18@747858b7eba7fab93f2351410ed1717e3d4f9db9
Reviewed-on: https://github.com/flang-compiler/f18/pull/398

5 years ago[flang] Changed the DO loop termination message to be different for the error
Peter Steinfeld [Wed, 10 Apr 2019 20:06:48 +0000 (13:06 -0700)]
[flang] Changed the DO loop termination message to be different for the error
case.

Original-commit: flang-compiler/f18@51cf517ccaff65d56277a0d316a512c99839787d
Reviewed-on: https://github.com/flang-compiler/f18/pull/398

5 years ago[flang] Removed erroneous reference to "obsolete" and fixed up the message
Peter Steinfeld [Wed, 10 Apr 2019 18:40:52 +0000 (11:40 -0700)]
[flang] Removed erroneous reference to "obsolete" and fixed up the message
as per Peter Klauser's recommendation.

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

5 years ago[flang] Fixed up messages per comments from Peter Klausler.
Peter Steinfeld [Wed, 10 Apr 2019 17:52:47 +0000 (10:52 -0700)]
[flang] Fixed up messages per comments from Peter Klausler.

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

5 years ago[flang] Fix issue 392, improve the error message when a DO loop is
Peter Steinfeld [Wed, 10 Apr 2019 16:45:41 +0000 (09:45 -0700)]
[flang] Fix issue 392, improve the error message when a DO loop is
terminated by a statement other than END DO or CONTINUE.

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