platform/upstream/llvm.git
5 years ago[flang] Placeholder for standard module iso_fortran_env
peter klausler [Thu, 6 Jun 2019 20:42:33 +0000 (13:42 -0700)]
[flang] Placeholder for standard module iso_fortran_env

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

5 years ago[flang] Merge pull request flang-compiler/f18#480 from flang-compiler/pmk-fixes
Peter Klausler [Wed, 5 Jun 2019 16:13:20 +0000 (09:13 -0700)]
[flang] Merge pull request flang-compiler/f18#480 from flang-compiler/pmk-fixes

Fix two bugs

Original-commit: flang-compiler/f18@9023d3c3ac5993d0703d77a2c48247aef999000e
Reviewed-on: https://github.com/flang-compiler/f18/pull/480

5 years ago[flang] Apply suggestion from code review
peter klausler [Wed, 5 Jun 2019 16:12:21 +0000 (09:12 -0700)]
[flang] Apply suggestion from code review

Original-commit: flang-compiler/f18@211c99917c60c6d2ae9efe260515b0b182a2136f
Reviewed-on: https://github.com/flang-compiler/f18/pull/480

5 years ago[flang] Fix two bugs
peter klausler [Wed, 5 Jun 2019 00:03:34 +0000 (17:03 -0700)]
[flang] Fix two bugs

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

5 years ago[flang] Merge pull request flang-compiler/f18#479 from flang-compiler/pmk-unparse...
Peter Klausler [Wed, 5 Jun 2019 16:11:50 +0000 (09:11 -0700)]
[flang] Merge pull request flang-compiler/f18#479 from flang-compiler/pmk-unparse-expr

Unparse the typedExpr from semantics

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

5 years ago[flang] Unparse the typedExpr from semantics, when present, rather than original...
peter klausler [Tue, 4 Jun 2019 23:25:06 +0000 (16:25 -0700)]
[flang] Unparse the typedExpr from semantics, when present, rather than original parse tree expressions

Original-commit: flang-compiler/f18@4274cc8eaa6e6ff3aa9b17646efb81f43e1e526a
Reviewed-on: https://github.com/flang-compiler/f18/pull/479

5 years ago[flang] Merge pull request flang-compiler/f18#477 from flang-compiler/pmk-fixes
Peter Klausler [Tue, 4 Jun 2019 22:20:29 +0000 (15:20 -0700)]
[flang] Merge pull request flang-compiler/f18#477 from flang-compiler/pmk-fixes

Roll up some minor fixes + tweak name resolution pass order

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

5 years ago[flang] Fix build warning, add comment about extension not supported
peter klausler [Tue, 4 Jun 2019 21:51:56 +0000 (14:51 -0700)]
[flang] Fix build warning, add comment about extension not supported

Original-commit: flang-compiler/f18@1033ae05ca3b8050c85992d3517eee6ea7ede260
Reviewed-on: https://github.com/flang-compiler/f18/pull/477

5 years ago[flang] Skim executable parts to detect dummy procedure calls
peter klausler [Tue, 4 Jun 2019 20:35:59 +0000 (13:35 -0700)]
[flang] Skim executable parts to detect dummy procedure calls

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

5 years ago[flang] INTRINSIC attribute should convert symbol to procedure; also check C840
peter klausler [Tue, 4 Jun 2019 18:41:30 +0000 (11:41 -0700)]
[flang] INTRINSIC attribute should convert symbol to procedure; also check C840

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

5 years ago[flang] Fix arg specs for CMPLX intrinsic
peter klausler [Tue, 4 Jun 2019 17:50:34 +0000 (10:50 -0700)]
[flang] Fix arg specs for CMPLX intrinsic

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

5 years ago[flang] Fix LEN(char array), it is not elemental.
peter klausler [Tue, 4 Jun 2019 17:09:54 +0000 (10:09 -0700)]
[flang] Fix LEN(char array), it is not elemental.

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

5 years ago[flang] allow alternate return indicators
peter klausler [Mon, 3 Jun 2019 20:36:47 +0000 (13:36 -0700)]
[flang] allow alternate return indicators

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

5 years ago[flang] Allow for FINAL procedures in PDT instantiation
peter klausler [Mon, 3 Jun 2019 19:28:20 +0000 (12:28 -0700)]
[flang] Allow for FINAL procedures in PDT instantiation

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

5 years ago[flang] Fix correction of misparsed struct const as actual arg, and semantics of...
peter klausler [Mon, 3 Jun 2019 19:18:52 +0000 (12:18 -0700)]
[flang] Fix correction of misparsed struct const as actual arg, and semantics of MODULE PROCEDURE in INTERFACE

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

5 years ago[flang] Allow some BOZ usage when unambiguous (extension)
peter klausler [Mon, 3 Jun 2019 17:51:51 +0000 (10:51 -0700)]
[flang] Allow some BOZ usage when unambiguous (extension)

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

5 years ago[flang] Rearrange references to AllSources singleton, fix FindScope for module files
peter klausler [Fri, 31 May 2019 23:37:00 +0000 (16:37 -0700)]
[flang] Rearrange references to AllSources singleton, fix FindScope for module files

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

5 years ago[flang] Fix spelling of ISHFT
peter klausler [Fri, 31 May 2019 23:36:29 +0000 (16:36 -0700)]
[flang] Fix spelling of ISHFT

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

5 years ago[flang] Placeholders for some standard modules
peter klausler [Fri, 31 May 2019 23:35:52 +0000 (16:35 -0700)]
[flang] Placeholders for some standard modules

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

5 years ago[flang] Merge pull request flang-compiler/f18#475 from flang-compiler/tsk-darwin
Tim Keith [Tue, 4 Jun 2019 15:55:28 +0000 (08:55 -0700)]
[flang] Merge pull request flang-compiler/f18#475 from flang-compiler/tsk-darwin

Fix test_folding.sh to work on MacOS

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

5 years ago[flang] Fix test_folding.sh to work on MacOS
Tim Keith [Mon, 3 Jun 2019 20:21:35 +0000 (13:21 -0700)]
[flang] Fix test_folding.sh to work on MacOS

There were a couple of small incompatibilities:
- There is no `ldd` on MacOS; instead use `otools -L`.
  This has not been tested when libpgmath is linked in to f18.
- `wc` outputs spaces where on Linux it outputs tabs; change how
  the number of lines is extracted to work on both.

Also, fix a bug: change `passed_warnings` to `$passed_warnings`.

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

5 years ago[flang] Merge pull request flang-compiler/f18#462 from flang-compiler/tsk-doc
Tim Keith [Mon, 3 Jun 2019 20:28:10 +0000 (13:28 -0700)]
[flang] Merge pull request flang-compiler/f18#462 from flang-compiler/tsk-doc

Update description of semantic analysis

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

5 years ago[flang] Address more review comments
Tim Keith [Wed, 15 May 2019 19:47:23 +0000 (12:47 -0700)]
[flang] Address more review comments

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

5 years ago[flang] Fix typos, adjust nested list formatting
Tim Keith [Wed, 15 May 2019 14:02:23 +0000 (07:02 -0700)]
[flang] Fix typos, adjust nested list formatting

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

5 years ago[flang] Update description of semantic analysis
Tim Keith [Wed, 15 May 2019 03:01:07 +0000 (20:01 -0700)]
[flang] Update description of semantic analysis

Semantics.md described the plans for semantic analysis as of some
time ago. Update it to document what has been implemented.

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

5 years ago[flang] Merge pull request flang-compiler/f18#472 from flang-compiler/pmk-ta-fixes
Peter Klausler [Thu, 30 May 2019 23:45:03 +0000 (16:45 -0700)]
[flang] Merge pull request flang-compiler/f18#472 from flang-compiler/pmk-ta-fixes

Roll up some fixes to problems found running more correctness tests

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

5 years ago[flang] Reformatting before merging
peter klausler [Thu, 30 May 2019 23:39:23 +0000 (16:39 -0700)]
[flang] Reformatting before merging

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

5 years ago[flang] Two more fixes made while waiting for code review
peter klausler [Thu, 30 May 2019 23:14:24 +0000 (16:14 -0700)]
[flang] Two more fixes made while waiting for code review

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

5 years ago[flang] Address review comment
peter klausler [Thu, 30 May 2019 22:26:54 +0000 (15:26 -0700)]
[flang] Address review comment

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

5 years ago[flang] Handle large integer literals without kinds better
peter klausler [Thu, 30 May 2019 20:31:11 +0000 (13:31 -0700)]
[flang] Handle large integer literals without kinds better

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

5 years ago[flang] document non-support for PGI ALLOCATE(TYPE(t)::...)
peter klausler [Thu, 30 May 2019 19:08:06 +0000 (12:08 -0700)]
[flang] document non-support for PGI ALLOCATE(TYPE(t)::...)

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

5 years ago[flang] Final fixes before review
peter klausler [Wed, 29 May 2019 23:00:31 +0000 (16:00 -0700)]
[flang] Final fixes before review

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

5 years ago[flang] PRECISION, RANGE, RADIX
peter klausler [Wed, 29 May 2019 22:38:33 +0000 (15:38 -0700)]
[flang] PRECISION, RANGE, RADIX

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

5 years ago[flang] Complete folding of intermixed array and component references
peter klausler [Wed, 29 May 2019 20:22:35 +0000 (13:22 -0700)]
[flang] Complete folding of intermixed array and component references

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

5 years ago[flang] Fix intrinsic folding after merging changes
peter klausler [Tue, 28 May 2019 22:42:28 +0000 (15:42 -0700)]
[flang] Fix intrinsic folding after merging changes

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

5 years ago[flang] Defer conversions to objects; fix some intrinsic table entries
peter klausler [Tue, 21 May 2019 23:58:46 +0000 (16:58 -0700)]
[flang] Defer conversions to objects; fix some intrinsic table entries

more fixes

Access components of constant structures

Apply implicit typing to dummy args used in automatic array dimensions

SELECTED_INT_KIND and SELECTED_REAL_KIND

Finish SELECTED_{INT,REAL}_KIND and common cases of ALL()/ANY()

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

5 years ago[flang] Merge pull request flang-compiler/f18#468 from flang-compiler/jpr-folding...
jeanPerier [Mon, 27 May 2019 09:14:37 +0000 (02:14 -0700)]
[flang] Merge pull request flang-compiler/f18#468 from flang-compiler/jpr-folding-warnings

Add location to folding warnings and related tests and prevent spurious "re-folding"

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

5 years ago[flang] Add semantic error test for integer constant containing division by zero
Jean Perier [Fri, 24 May 2019 15:22:11 +0000 (08:22 -0700)]
[flang] Add semantic error test for integer constant containing division by zero

Original-commit: flang-compiler/f18@650cfac5397236373e3f8c4ca7a1e15e6f33e0a4
Reviewed-on: https://github.com/flang-compiler/f18/pull/468

5 years ago[flang] Make integer divide by zero in constants a fatal error
Jean Perier [Fri, 24 May 2019 14:54:47 +0000 (07:54 -0700)]
[flang] Make integer divide by zero in constants a fatal error

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

5 years ago[flang] removed a relicate comment
Jean Perier [Wed, 22 May 2019 14:04:19 +0000 (07:04 -0700)]
[flang] removed a relicate comment

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

5 years ago[flang] Fix support of parenthesized arguments in function folding
Jean Perier [Wed, 22 May 2019 13:18:02 +0000 (06:18 -0700)]
[flang] Fix support of parenthesized arguments in function folding

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

5 years ago[flang] more folding edge cases tests
Jean Perier [Wed, 22 May 2019 13:16:12 +0000 (06:16 -0700)]
[flang] more folding edge cases tests

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

5 years ago[flang] Adding tests for folding edge case (overflows...)
Jean Perier [Wed, 22 May 2019 07:56:35 +0000 (00:56 -0700)]
[flang] Adding tests for folding edge case (overflows...)

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

5 years ago[flang] Folding improvments:
Jean Perier [Wed, 22 May 2019 07:48:29 +0000 (00:48 -0700)]
[flang] Folding improvments:
  - Add location to non-fatal error message (context was not given
    a location before folding in semantics).
  - Avoid refolding expression from scratch several times (update GenericExprWrapper
    after folding). So far, warning messages were generated twice per parametere init
    expressions.

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

5 years ago[flang] Merge pull request flang-compiler/f18#470 from flang-compiler/by-mp-gram
Jinxin (Brian) Yang [Fri, 24 May 2019 21:25:16 +0000 (14:25 -0700)]
[flang] Merge pull request flang-compiler/f18#470 from flang-compiler/by-mp-gram

Re-write OpenMP 4.5 grammar documentation

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

5 years ago[flang] improvement for atomic construct
Jinxin Yang [Fri, 24 May 2019 20:54:58 +0000 (13:54 -0700)]
[flang] improvement for atomic construct

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

5 years ago[flang] improvement for 'Re-write OpenMP 4.5 grammar doc with BNF'
Jinxin Yang [Fri, 24 May 2019 20:45:15 +0000 (13:45 -0700)]
[flang] improvement for 'Re-write OpenMP 4.5 grammar doc with BNF'

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

5 years ago[flang] Re-write OpenMP 4.5 grammar doc with BNF
Jinxin Yang [Fri, 24 May 2019 00:13:52 +0000 (17:13 -0700)]
[flang] Re-write OpenMP 4.5 grammar doc with BNF

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

5 years ago[flang] Merge pull request flang-compiler/f18#469 from flang-compiler/jpr-fold-parame...
jeanPerier [Fri, 24 May 2019 08:39:00 +0000 (01:39 -0700)]
[flang] Merge pull request flang-compiler/f18#469 from flang-compiler/jpr-fold-parameter-fix

Prevent possible infinite loop in parameter folding

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

5 years ago[flang] add test for parameter infinite loop
Jean Perier [Thu, 23 May 2019 09:11:33 +0000 (02:11 -0700)]
[flang] add test for parameter infinite loop

Original-commit: flang-compiler/f18@552568c39764972b4e21ebeb6e9f4337eee2eb38
Reviewed-on: https://github.com/flang-compiler/f18/pull/469

5 years ago[flang] fix error message typo
Jean Perier [Thu, 23 May 2019 09:09:58 +0000 (02:09 -0700)]
[flang] fix error message typo

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

5 years ago[flang] Prevent possible infinte loop in parameter folding
Jean Perier [Wed, 22 May 2019 15:26:50 +0000 (08:26 -0700)]
[flang] Prevent possible infinte loop in parameter folding

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

5 years ago[flang] Merge pull request flang-compiler/f18#464 from flang-compiler/klausler-patch-1
Peter Klausler [Thu, 23 May 2019 15:40:19 +0000 (08:40 -0700)]
[flang] Merge pull request flang-compiler/f18#464 from flang-compiler/klausler-patch-1

Update FortranForCProgrammers.md

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

5 years ago[flang] Update FortranForCProgrammers.md
Peter Klausler [Wed, 15 May 2019 20:37:10 +0000 (13:37 -0700)]
[flang] Update FortranForCProgrammers.md

Refine the text describing differences between C and Fortran pointers to correct an erroneous statement (that pointers cannot point to allocatables).  Fixes bug flang-compiler/f18#461.

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

5 years ago[flang] Merge pull request flang-compiler/f18#467 from flang-compiler/jpr-allocate...
jeanPerier [Thu, 23 May 2019 07:40:42 +0000 (00:40 -0700)]
[flang] Merge pull request flang-compiler/f18#467 from flang-compiler/jpr-allocate-checks

Fix: catch subroutine symbols in ALLOCATE

Original-commit: flang-compiler/f18@730191fcafc66f398cd9c5085272be92ecfe0c68
Reviewed-on: https://github.com/flang-compiler/f18/pull/467

5 years ago[flang] Fix: catch subroutine symbols in ALLOCATE
Jean Perier [Wed, 22 May 2019 15:00:19 +0000 (08:00 -0700)]
[flang] Fix: catch subroutine symbols in ALLOCATE

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

5 years ago[flang] Merge pull request flang-compiler/f18#466 from flang-compiler/pmk1
Peter Klausler [Tue, 21 May 2019 18:04:56 +0000 (11:04 -0700)]
[flang] Merge pull request flang-compiler/f18#466 from flang-compiler/pmk1

Fixes to problems in (mostly) expression semantics

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

5 years ago[flang] Address review comments from Jean (thanks!)
peter klausler [Tue, 21 May 2019 17:24:30 +0000 (10:24 -0700)]
[flang] Address review comments from Jean (thanks!)

Original-commit: flang-compiler/f18@5183c6196e36fa361d1f18717d741c2fe36a31df
Reviewed-on: https://github.com/flang-compiler/f18/pull/466

5 years ago[flang] work in progress
peter klausler [Mon, 13 May 2019 16:33:18 +0000 (09:33 -0700)]
[flang] work in progress

checkpoint: changes build, tests all pass

many fixes, ready to test more

Further CLASS(*) support

More fixes for CLASS(*)

Hide data members of DynamicType

implement PRESENT() intrinsic

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

5 years ago[flang] Merge pull request flang-compiler/f18#465 from flang-compiler/pmk-fix-tim
Peter Klausler [Wed, 15 May 2019 22:42:30 +0000 (15:42 -0700)]
[flang] Merge pull request flang-compiler/f18#465 from flang-compiler/pmk-fix-tim

Fix crash reported by Tim

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

5 years ago[flang] Fix crash reported by Tim
peter klausler [Wed, 15 May 2019 20:23:31 +0000 (13:23 -0700)]
[flang] Fix crash reported by Tim

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

5 years ago[flang] Merge pull request flang-compiler/f18#463 from flang-compiler/pmk-fix-brian
Peter Klausler [Wed, 15 May 2019 20:24:03 +0000 (13:24 -0700)]
[flang] Merge pull request flang-compiler/f18#463 from flang-compiler/pmk-fix-brian

Fix bug with comment clipping on compiler directives

Original-commit: flang-compiler/f18@9307806d7ab8942d61294c97362a2031d1c4b0c5
Reviewed-on: https://github.com/flang-compiler/f18/pull/463

5 years ago[flang] Fix bug with comment clipping on compiler directives
peter klausler [Wed, 15 May 2019 19:35:36 +0000 (12:35 -0700)]
[flang] Fix bug with comment clipping on compiler directives

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

5 years ago[flang] Merge pull request flang-compiler/f18#460 from flang-compiler/pmk-fix-brian
Peter Klausler [Mon, 13 May 2019 16:30:53 +0000 (09:30 -0700)]
[flang] Merge pull request flang-compiler/f18#460 from flang-compiler/pmk-fix-brian

Strip comments from source and directive lines after macro replacement

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

5 years ago[flang] Strip comments from source and directive lines after macro replacement
peter klausler [Fri, 10 May 2019 23:04:10 +0000 (16:04 -0700)]
[flang] Strip comments from source and directive lines after macro replacement

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

5 years ago[flang] Merge pull request flang-compiler/f18#455 from flang-compiler/tsk4
Tim Keith [Thu, 9 May 2019 21:10:46 +0000 (14:10 -0700)]
[flang] Merge pull request flang-compiler/f18#455 from flang-compiler/tsk4

Change parse tree to allow DO loop over REAL

Original-commit: flang-compiler/f18@2771ee8dd8c69eadbaaab2b02e06f586b5f26af3
Reviewed-on: https://github.com/flang-compiler/f18/pull/455

5 years ago[flang] Update extensions doc for DO loop over REAL
Tim Keith [Thu, 9 May 2019 17:04:46 +0000 (10:04 -0700)]
[flang] Update extensions doc for DO loop over REAL

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

5 years ago[flang] Address review comments
Tim Keith [Thu, 9 May 2019 17:00:13 +0000 (10:00 -0700)]
[flang] Address review comments

Use better names for template parameters of `LoopBounds`, and also
for the constructor arguments.

Use two overloadings of `loopBounds()` instead of `std::is_same_v<>`.

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

5 years ago[flang] Change parse tree to allow DO loop over REAL
Tim Keith [Thu, 9 May 2019 15:32:27 +0000 (08:32 -0700)]
[flang] Change parse tree to allow DO loop over REAL

It is a common extension to allow DO loops with REAL variable and
bounds. The parse tree currently parses those with the variable
as `scalar-int-variable-name` and the bounds as `scalar-int-expr`.
That causes the INTEGER constraint to be enforced automatically.

Change the grammar and parse tree to treat them as `scalar-variable-name`
and `scalar-expr`. This allows the name and expression to be REAL,
but we will have to verify that they aren't any other type (in a future
change).

To accomplish this, add a template parameter to `LoopBounds` for the type
of the variable name (always `Scalar<Name>` or `Scalar<Integer<Name>>`).
We sometimes need names for the instantiations of `LoopBounds` so add
type aliases like `LoopControl::Bounds` for each one.

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

5 years ago[flang] Merge pull request flang-compiler/f18#452 from flang-compiler/ps_do_c1121
psteinfeld [Thu, 9 May 2019 18:02:07 +0000 (11:02 -0700)]
[flang] Merge pull request flang-compiler/f18#452 from flang-compiler/ps_do_c1121

Added a test for C1121, DO scalar-mask-expr cannot reference IMPURE procedure

Original-commit: flang-compiler/f18@83842cc1b8e83fb2fc41911a410c2e5c335492ea
Reviewed-on: https://github.com/flang-compiler/f18/pull/452

5 years ago[flang] Added a TODO to include the name of the IMPURE procedure in the error
Peter Steinfeld [Thu, 9 May 2019 17:54:58 +0000 (10:54 -0700)]
[flang] Added a TODO to include the name of the IMPURE procedure in the error
message for referencing in IMPURE procedure in the scalar-mask-expr of
a DO CONCURRENT.

Also removed a bogus comment from the test.

Both of these changes were in response to review comments.

Original-commit: flang-compiler/f18@4447d59b3982218db131c5ce9a78b8ddb77bfe68
Reviewed-on: https://github.com/flang-compiler/f18/pull/452

5 years ago[flang] Added a test for C1121 -- in a concurrent DO loop, the
Peter Steinfeld [Wed, 8 May 2019 20:17:36 +0000 (13:17 -0700)]
[flang] Added a test for C1121 -- in a concurrent DO loop, the
scalar-mask-expr cannot reference an IMPURE procedure.

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

5 years ago[flang] Merge pull request flang-compiler/f18#453 from flang-compiler/by-mp-parser-fix
Jinxin (Brian) Yang [Wed, 8 May 2019 23:00:00 +0000 (16:00 -0700)]
[flang] Merge pull request flang-compiler/f18#453 from flang-compiler/by-mp-parser-fix

OpenMP 4.5 grammar related minor fixes

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

5 years ago[flang] OpenMP 4.5 grammar related minor fixes
Jinxin Yang [Wed, 8 May 2019 21:05:44 +0000 (14:05 -0700)]
[flang] OpenMP 4.5 grammar related minor fixes

1. typo and trailing spaces within OpenMP-4.5-grammar.txt

2. parse (openmp-grammar.h) and unparse(unparse.cc) for:

   SCHEDULE ([modifier [, modifier]:]kind[, chunk_size])
   Modifier ->  MONITONIC | NONMONOTONIC | SIMD

where ":" is optional except at least one modifier is present.

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

5 years ago[flang] Merge pull request flang-compiler/f18#451 from flang-compiler/pmk-fix-val-bug
Peter Klausler [Wed, 8 May 2019 19:19:56 +0000 (12:19 -0700)]
[flang] Merge pull request flang-compiler/f18#451 from flang-compiler/pmk-fix-val-bug

Allow use of (x?"a":"b") as a message argument

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

5 years ago[flang] Allow use of (x?"a":"b") as a message argument
peter klausler [Wed, 8 May 2019 18:10:21 +0000 (11:10 -0700)]
[flang] Allow use of (x?"a":"b") as a message argument

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

5 years ago[flang] Merge pull request flang-compiler/f18#449 from flang-compiler/pmk-ps-bug
Peter Klausler [Wed, 8 May 2019 18:07:44 +0000 (11:07 -0700)]
[flang] Merge pull request flang-compiler/f18#449 from flang-compiler/pmk-ps-bug

Handle remaining cases in expression tree traversal

Original-commit: flang-compiler/f18@40cb0ada0f52ff352b09e88216a452c4faf11089
Reviewed-on: https://github.com/flang-compiler/f18/pull/449

5 years ago[flang] Add & use mutators for Substring, Triplet, CoarrayRef
peter klausler [Wed, 8 May 2019 17:22:56 +0000 (10:22 -0700)]
[flang] Add & use mutators for Substring, Triplet, CoarrayRef

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

5 years ago[flang] Fix warning
peter klausler [Wed, 8 May 2019 01:21:55 +0000 (18:21 -0700)]
[flang] Fix warning

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

5 years ago[flang] Address review comment
peter klausler [Wed, 8 May 2019 01:20:45 +0000 (18:20 -0700)]
[flang] Address review comment

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

5 years ago[flang] dodge clang build problem with constexpr
peter klausler [Wed, 8 May 2019 00:05:14 +0000 (17:05 -0700)]
[flang] dodge clang build problem with constexpr

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

5 years ago[flang] Remove debugging
peter klausler [Tue, 7 May 2019 23:26:47 +0000 (16:26 -0700)]
[flang] Remove debugging

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

5 years ago[flang] Fix folding of substring
peter klausler [Tue, 7 May 2019 23:24:50 +0000 (16:24 -0700)]
[flang] Fix folding of substring

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

5 years ago[flang] Handle remaining cases in expression traversal
peter klausler [Tue, 7 May 2019 23:19:45 +0000 (16:19 -0700)]
[flang] Handle remaining cases in expression traversal

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

5 years ago[flang] Merge pull request flang-compiler/f18#450 from flang-compiler/by-pgf90-mp
Brian [Wed, 8 May 2019 17:24:57 +0000 (10:24 -0700)]
[flang] Merge pull request flang-compiler/f18#450 from flang-compiler/by-pgf90-mp

Add -mp option for pgf90 in the presence of -fopenmp

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

5 years ago[flang] Add -mp option for pgf90 in the presence of -fopenmp
Jinxin Yang [Wed, 8 May 2019 15:43:20 +0000 (08:43 -0700)]
[flang] Add -mp option for pgf90 in the presence of -fopenmp

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

5 years ago[flang] Merge pull request flang-compiler/f18#444 from flang-compiler/pmk-msg-format
Peter Klausler [Tue, 7 May 2019 19:15:49 +0000 (12:15 -0700)]
[flang] Merge pull request flang-compiler/f18#444 from flang-compiler/pmk-msg-format

Replace formatting of CharBlock & string

Original-commit: flang-compiler/f18@359bedbefdea13c84182c1ba1691249fedaabfae
Reviewed-on: https://github.com/flang-compiler/f18/pull/444

5 years ago[flang] Remove support for Names in messages for now.
peter klausler [Tue, 7 May 2019 17:04:21 +0000 (10:04 -0700)]
[flang] Remove support for Names in messages for now.

Original-commit: flang-compiler/f18@15d38c7059352cb4d6d8df28a35cbde3b0fe92c5
Reviewed-on: https://github.com/flang-compiler/f18/pull/444

5 years ago[flang] Merge with recent changes
peter klausler [Tue, 7 May 2019 16:22:53 +0000 (09:22 -0700)]
[flang] Merge with recent changes

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

5 years ago[flang] Replace formatting of CharBlock & string
peter klausler [Mon, 6 May 2019 16:33:45 +0000 (09:33 -0700)]
[flang] Replace formatting of CharBlock & string

Preserve generated strings until consumed by formatting.

bugfix from premature push

Address review comments

Last fix(?)

Use %s formatting for CharBlocks and strings

Use new formatting and fix usage of std::forward<>()

Use forward_list rather than vector to save strings

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

5 years ago[flang] Change a user error to an internal error in ALLOCATE semantic check
jeanPerier [Tue, 7 May 2019 15:44:23 +0000 (08:44 -0700)]
[flang] Change a user error to an internal error in ALLOCATE semantic check

Merge pull request flang-compiler/f18#448 from flang-compiler/jpr-check-allocate

Original-commit: flang-compiler/f18@66e766ac9ae2b062c3b1d8aaee63c42be2ffacf2

5 years ago[flang] Change a user error to an internal error in ALLOCATE semantic check
Jean Perier [Tue, 7 May 2019 15:28:24 +0000 (08:28 -0700)]
[flang] Change a user error to an internal error in ALLOCATE semantic check

Original-commit: flang-compiler/f18@d9a9b59634761b328e1540ba9ef2b04c19318fd8

5 years ago[flang] Merge pull request flang-compiler/f18#443 from flang-compiler/tsk4b
Tim Keith [Tue, 7 May 2019 14:35:58 +0000 (07:35 -0700)]
[flang] Merge pull request flang-compiler/f18#443 from flang-compiler/tsk4b

Process specification parts before execution parts

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

5 years ago[flang] Re-enable test resolve51.f90
Tim Keith [Tue, 7 May 2019 14:35:10 +0000 (07:35 -0700)]
[flang] Re-enable test resolve51.f90

Original-commit: flang-compiler/f18@595e45fd3451079a5c1cb02028d7cfb84c5ae945
Reviewed-on: https://github.com/flang-compiler/f18/pull/443

5 years ago[flang] Move ProgramTree to its own file
Tim Keith [Mon, 6 May 2019 17:12:27 +0000 (10:12 -0700)]
[flang] Move ProgramTree to its own file

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

5 years ago[flang] Process specification parts before execution parts
Tim Keith [Mon, 6 May 2019 14:26:43 +0000 (07:26 -0700)]
[flang] Process specification parts before execution parts

Change the order in which names are resolved. Before resolving names
in the execution part of a subprogram we need to know the interface
of contained subprograms. This is because the type of some construct
entities can depend on the return type of contained functions, e.g.
```
  associate(x => f())
  end associate
contains
  function f()...
```

To do this, we now build a tree rooted at each program unit with
child nodes corresponding to subprograms contained in the parent.
This provides flexibility in choosing an order to resolve names.
The current implementation processes all specification parts before
any execution parts. This ensures contained subprogram interfaces
are know before analyzing constructs like ASSOCIATE.

Resolving a specification part involves first adding
`SubprogramNameDetails` symbols for each contained subprogram, then
processing the statement that introduces the program unit (`ModuleStmt`,
`SubroutineStmt`, etc.), then visiting all of the statements in the
specification part.

If it proves necessary, we can add a phase to do implicit declarations
in the execution part before processing the specification part of
contained subprograms.

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

5 years ago[flang] Add DIE macro
Tim Keith [Fri, 3 May 2019 15:02:31 +0000 (08:02 -0700)]
[flang] Add DIE macro

`DIE()` is like `common::die()` but with the source location appended,
as in `CHECK()`.

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

5 years ago[flang] Change how Scopes are mapped to ImplicitRules
Tim Keith [Thu, 2 May 2019 18:19:01 +0000 (11:19 -0700)]
[flang] Change how Scopes are mapped to ImplicitRules

Previously we maintained a stack of ImplicitRules in parallel with
the Scope stack. Change to maintaining a mapping from Scope to
ImplicitRules.

This makes things simpler in some cases: Block scopes don't have their
own implicit rules. And submodule scopes aren't just pushed and popped.
This will also help with future changes to the order in which scopes
are processed.

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

5 years ago[flang] Merge pull request flang-compiler/f18#445 from flang-compiler/pmk-fixes
Peter Klausler [Mon, 6 May 2019 18:44:36 +0000 (11:44 -0700)]
[flang] Merge pull request flang-compiler/f18#445 from flang-compiler/pmk-fixes

Fix or disable broken tests.

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

5 years ago[flang] Fix or disable broken tests.
peter klausler [Mon, 6 May 2019 18:33:33 +0000 (11:33 -0700)]
[flang] Fix or disable broken tests.

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