platform/upstream/llvm.git
4 years ago[flang] Corrected check for required OpenMP clauses
David Truby [Tue, 17 Sep 2019 08:53:27 +0000 (09:53 +0100)]
[flang] Corrected check for required OpenMP clauses

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

4 years ago[flang] Corrections for map semantics to match coding style
David Truby [Mon, 16 Sep 2019 14:44:31 +0000 (15:44 +0100)]
[flang] Corrections for map semantics to match coding style

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

4 years ago[flang] Added semantic checks for map clauses
David Truby [Fri, 13 Sep 2019 14:42:19 +0000 (15:42 +0100)]
[flang] Added semantic checks for map clauses

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

4 years ago[flang] Merge pull request flang-compiler/f18#696 from schweitzpgi/fir-type
Eric Schweitz [Fri, 27 Sep 2019 22:07:44 +0000 (15:07 -0700)]
[flang] Merge pull request flang-compiler/f18#696 from schweitzpgi/fir-type

add fir types header

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

4 years ago[flang] sync latest changes to these files
Eric Schweitz [Thu, 26 Sep 2019 20:08:27 +0000 (13:08 -0700)]
[flang] sync latest changes to these files

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

4 years ago[flang] latest changes
Eric Schweitz [Tue, 17 Sep 2019 21:23:20 +0000 (14:23 -0700)]
[flang] latest changes

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

4 years ago[flang] add FIROps.h
Eric Schweitz [Tue, 10 Sep 2019 15:25:34 +0000 (08:25 -0700)]
[flang] add FIROps.h

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

4 years ago[flang] fix name of argument
Eric Schweitz [Mon, 9 Sep 2019 23:05:02 +0000 (16:05 -0700)]
[flang] fix name of argument

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

4 years ago[flang] add attributes
Eric Schweitz [Fri, 6 Sep 2019 23:15:37 +0000 (16:15 -0700)]
[flang] add attributes

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

4 years ago[flang] more cleanup
Eric Schweitz [Fri, 6 Sep 2019 20:37:14 +0000 (13:37 -0700)]
[flang] more cleanup

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

4 years ago[flang] changes per review comments
Eric Schweitz [Fri, 6 Sep 2019 20:25:42 +0000 (13:25 -0700)]
[flang] changes per review comments

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

4 years ago[flang] add fir types header
Eric Schweitz [Wed, 28 Aug 2019 20:53:50 +0000 (13:53 -0700)]
[flang] add fir types header

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

4 years ago[flang] Merge pull request flang-compiler/f18#766 from flang-compiler/pmk-fix-765
Peter Klausler [Fri, 27 Sep 2019 21:53:14 +0000 (14:53 -0700)]
[flang] Merge pull request flang-compiler/f18#766 from flang-compiler/pmk-fix-765

Fix flang-compiler/f18#765

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

4 years ago[flang] Fix flang-compiler/f18#765
peter klausler [Fri, 27 Sep 2019 21:08:09 +0000 (14:08 -0700)]
[flang] Fix flang-compiler/f18#765

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

4 years ago[flang] Merge pull request flang-compiler/f18#764 from flang-compiler/ps-do
psteinfeld [Thu, 26 Sep 2019 21:06:58 +0000 (14:06 -0700)]
[flang] Merge pull request flang-compiler/f18#764 from flang-compiler/ps-do

Added tests for image control statements in DO CONCURRENT

Original-commit: flang-compiler/f18@2856f0f2488c57874d2d06a6f40a02b4ddf1a109
Reviewed-on: https://github.com/flang-compiler/f18/pull/764

4 years ago[flang] Added tests for image control statements in DO CONCURRENT
Pete Steinfeld [Thu, 26 Sep 2019 20:33:48 +0000 (13:33 -0700)]
[flang] Added tests for image control statements in DO CONCURRENT
There was already code in check-do.cc to test for the presence of a
variety of different image control statements, but several of them did
not have associated tests.  This change adds tests for most of them.

Also, I removed the check for the END PROGRAM statement, since its
presence causes a syntax error which prevents the semantic check from
ever being reached.

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

4 years ago[flang] Merge pull request flang-compiler/f18#761 from flang-compiler/tsk-modfiles
Tim Keith [Wed, 25 Sep 2019 22:58:32 +0000 (15:58 -0700)]
[flang] Merge pull request flang-compiler/f18#761 from flang-compiler/tsk-modfiles

Fix clang build on MacOS

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

4 years ago[flang] Fix clang build on MacOS
Tim Keith [Wed, 25 Sep 2019 22:39:44 +0000 (15:39 -0700)]
[flang] Fix clang build on MacOS

clang doesn't consider `std::strlen` of a constant to be a constexpr,
so just replace with the actual length.

Original-commit: flang-compiler/f18@738deab4656478df41a3ef7fdb9f02fe503779c5
Reviewed-on: https://github.com/flang-compiler/f18/pull/761

4 years ago[flang] Merge pull request flang-compiler/f18#750 from DavidTruby/teams
Steve Scalpone [Wed, 25 Sep 2019 22:16:18 +0000 (15:16 -0700)]
[flang] Merge pull request flang-compiler/f18#750 from DavidTruby/teams

Semantic checks for OpenMP teams directive

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

4 years ago[flang] Added grammar for teams directive to semantic checks
David Truby [Thu, 19 Sep 2019 09:02:35 +0000 (10:02 +0100)]
[flang] Added grammar for teams directive to semantic checks

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

4 years ago[flang] Semantic checks for teams directive
David Truby [Tue, 17 Sep 2019 11:08:04 +0000 (12:08 +0100)]
[flang] Semantic checks for teams directive

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

4 years ago[flang] Merge pull request flang-compiler/f18#751 from flang-compiler/sjs-style-update
Steve Scalpone [Wed, 25 Sep 2019 21:59:58 +0000 (14:59 -0700)]
[flang] Merge pull request flang-compiler/f18#751 from flang-compiler/sjs-style-update

Update C++style.md

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

4 years ago[flang] Update C++style.md
Steve Scalpone [Wed, 18 Sep 2019 00:07:06 +0000 (17:07 -0700)]
[flang] Update C++style.md

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

4 years ago[flang] Update C++style.md
Steve Scalpone [Tue, 17 Sep 2019 19:31:37 +0000 (12:31 -0700)]
[flang] Update C++style.md

Add guidelines for error messages and commas.  Add a version number for clang-format. Add spaces before ### sections to restart numbering.

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

4 years ago[flang] Merge pull request flang-compiler/f18#758 from flang-compiler/tsk-modfiles
Tim Keith [Wed, 25 Sep 2019 21:55:40 +0000 (14:55 -0700)]
[flang] Merge pull request flang-compiler/f18#758 from flang-compiler/tsk-modfiles

Improve module file reading and writing

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

4 years ago[flang] Fix tests that use the same .mod file
Tim Keith [Mon, 23 Sep 2019 23:39:57 +0000 (16:39 -0700)]
[flang] Fix tests that use the same .mod file

The tests run by `test_any.sh` don't redirect their .mod files to
a different directory so they occasionally fail when the same file
is accessed by different tests at the same time. With locking of
module files implemented, this problem reproduces much more reliably

Work around it by changing the module names to be distinct. Also remove
some comments left over when copied from `test_symbols.sh` tests.

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

4 years ago[flang] Improve module file reading and writing
Tim Keith [Tue, 24 Sep 2019 00:10:58 +0000 (17:10 -0700)]
[flang] Improve module file reading and writing

Fix problems with writing a mod file while another compilation is
reading or writing. Write to a temp and then rename it:
- compute the new contents of the .mod file
- if it already exists, check if it is already correct
- if not, write new contents to a temp file
- rename the temp to the final destination

`mkstemps()` seems to be the best way to create the temp file.
It returns a file descriptor, so change the rest of the mod file
writing to use POSIX open/read/write/close. This seems to set
errno more reliably too.

There is some extra work around creating the temp to make it have
the same directory and suffix as the final file (so that if one gets
left behind by a crash, "rm *.mod" still cleans it up).
`mkstemps()` creates file with 0600 permissions so try to change it
to what it would have been if we just wrote the file.

Change module file reading to only read the file once; we used to
read it to verify the checksum and then again to parse it.
Instead, change `Parsing` so that we can get the file contents
after `Prescan()` and use that to verify the checksum. Also, it has
a mechanism for searching directories for files, so make use of that
instead of duplicating that functionality in `ModFileReader`.
This requires some changes to how errors are returned so they can
be reported in the right place.

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

4 years ago[flang] Merge pull request flang-compiler/f18#760 from flang-compiler/pmk-fix-build
Peter Klausler [Wed, 25 Sep 2019 17:57:24 +0000 (10:57 -0700)]
[flang] Merge pull request flang-compiler/f18#760 from flang-compiler/pmk-fix-build

Fix build on OSX

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

4 years ago[flang] Fix build on OSX
peter klausler [Wed, 25 Sep 2019 17:40:01 +0000 (10:40 -0700)]
[flang] Fix build on OSX

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

4 years ago[flang] Merge pull request flang-compiler/f18#755 from flang-compiler/pmk-spec-expr
Peter Klausler [Wed, 25 Sep 2019 16:23:29 +0000 (09:23 -0700)]
[flang] Merge pull request flang-compiler/f18#755 from flang-compiler/pmk-spec-expr

Check specification expression constraints (10.1.11)

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

4 years ago[flang] Address review comments
peter klausler [Tue, 24 Sep 2019 21:17:50 +0000 (14:17 -0700)]
[flang] Address review comments

Original-commit: flang-compiler/f18@2393157d3fa9cdb870035986b6f56c81f481c4e7
Reviewed-on: https://github.com/flang-compiler/f18/pull/755

4 years ago[flang] Clean up test results
peter klausler [Fri, 20 Sep 2019 21:28:15 +0000 (14:28 -0700)]
[flang] Clean up test results

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

4 years ago[flang] Prep for review
peter klausler [Fri, 20 Sep 2019 18:02:17 +0000 (11:02 -0700)]
[flang] Prep for review

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

4 years ago[flang] Remove dead code
peter klausler [Fri, 20 Sep 2019 16:58:19 +0000 (09:58 -0700)]
[flang] Remove dead code

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

4 years ago[flang] Build with all compilers * versions
peter klausler [Fri, 20 Sep 2019 16:46:00 +0000 (09:46 -0700)]
[flang] Build with all compilers * versions

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

4 years ago[flang] Complete conversions, delete old visitor
peter klausler [Thu, 19 Sep 2019 22:49:13 +0000 (15:49 -0700)]
[flang] Complete conversions, delete old visitor

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

4 years ago[flang] more conversions to Traverse
peter klausler [Thu, 19 Sep 2019 21:56:12 +0000 (14:56 -0700)]
[flang] more conversions to Traverse

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

4 years ago[flang] Refinements; replace several clients of old Visitor with new Traverse
peter klausler [Thu, 19 Sep 2019 19:19:17 +0000 (12:19 -0700)]
[flang] Refinements; replace several clients of old Visitor with new Traverse

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

4 years ago[flang] Redo IsInitialDataTarget
peter klausler [Wed, 18 Sep 2019 23:47:25 +0000 (16:47 -0700)]
[flang] Redo IsInitialDataTarget

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

4 years ago[flang] Repackaging; tests pass
peter klausler [Wed, 18 Sep 2019 22:43:12 +0000 (15:43 -0700)]
[flang] Repackaging; tests pass

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

4 years ago[flang] progress
peter klausler [Wed, 18 Sep 2019 00:08:32 +0000 (17:08 -0700)]
[flang] progress

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

4 years ago[flang] add test
peter klausler [Tue, 17 Sep 2019 22:21:20 +0000 (15:21 -0700)]
[flang] add test

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

4 years ago[flang] checkpoint
peter klausler [Tue, 17 Sep 2019 22:21:02 +0000 (15:21 -0700)]
[flang] checkpoint

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

4 years ago[flang] checkpoint
peter klausler [Mon, 16 Sep 2019 18:22:27 +0000 (11:22 -0700)]
[flang] checkpoint

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

4 years ago[flang] Merge pull request flang-compiler/f18#756 from flang-compiler/ps-do
psteinfeld [Wed, 25 Sep 2019 15:49:46 +0000 (08:49 -0700)]
[flang] Merge pull request flang-compiler/f18#756 from flang-compiler/ps-do

Implementation of semantic checks C1135, C1167, and C1168

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

4 years ago[flang] More responses to pull request comments.
Pete Steinfeld [Tue, 24 Sep 2019 22:33:51 +0000 (15:33 -0700)]
[flang] More responses to pull request comments.

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

4 years ago[flang] More responses to comments in the pull request. The big change was to
Pete Steinfeld [Tue, 24 Sep 2019 17:44:44 +0000 (10:44 -0700)]
[flang] More responses to comments in the pull request.  The big change was to
implement an enum class to indicate whether the statement being checked
is a CYCLE or EXIT statement.  This change rippled through a few
interfaces, resulting in cleaner, more readable code.  Thanks for the
tip, Tim!

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

4 years ago[flang] Responses to a comments in my previous pull request.
Pete Steinfeld [Tue, 24 Sep 2019 03:46:45 +0000 (20:46 -0700)]
[flang] Responses to a comments in my previous pull request.

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

4 years ago[flang] Implementation of semantic checks C1135, C1167, and C1168
Pete Steinfeld [Sun, 22 Sep 2019 17:01:03 +0000 (10:01 -0700)]
[flang] Implementation of semantic checks C1135, C1167, and C1168

These constraints state that CYCLE and EXIT statements should not leave DO
CONCURRENT, CRITICAL, or CHANGE TEAM constructs.

I added checking code to check-do.cc and removed some superseded code from
check-do.cc and semantics.cc.  The new code uses the construct stack
implemented in my previous pull request.

I also added a new test -- dosemantics11.f90 and modified the tests
dosemantics10.f90, doconcurrent05.f90, and doconcurrent06.f90 to adapt to
the new error messages.  I converted these latter two tests to use
test_error.sh since they only reported errors.

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

4 years ago[flang] Merge pull request flang-compiler/f18#749 from flang-compiler/jpr-fix-724-2
jeanPerier [Mon, 23 Sep 2019 09:35:04 +0000 (02:35 -0700)]
[flang] Merge pull request flang-compiler/f18#749 from flang-compiler/jpr-fix-724-2

Allow more argument types in some specific intrinsic

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

4 years ago[flang] Fix typos and style in some comments
Jean Perier [Wed, 18 Sep 2019 15:04:52 +0000 (08:04 -0700)]
[flang] Fix typos and style in some comments

Original-commit: flang-compiler/f18@621ded353f6179045e8fc4c18ef13a4aa05293b9
Reviewed-on: https://github.com/flang-compiler/f18/pull/749

4 years ago[flang] Refactor IntrinsicProcTable::Implementation::Probe for readability
Jean Perier [Tue, 17 Sep 2019 10:11:35 +0000 (03:11 -0700)]
[flang] Refactor IntrinsicProcTable::Implementation::Probe for readability

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

4 years ago[flang] Address editorial comments and use oxford comma
Jean Perier [Tue, 17 Sep 2019 08:54:51 +0000 (01:54 -0700)]
[flang] Address editorial comments and use oxford comma

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

4 years ago[flang] Allow more argument types in some specific intrinsic
Jean Perier [Mon, 16 Sep 2019 16:34:10 +0000 (09:34 -0700)]
[flang] Allow more argument types in some specific intrinsic
Fix flang-compiler/f18#724.
Allow all type kinds for arguments in restricted specific conversion
intrinisc (no warning, this is ubiquitous).
Allow MAX/MIN restricted intrinsic (AMAX0...) to be replaced by the
related generic foolowed by a type conversion to the expected result
type of the specific. Emit a warning because xlf and ifort are doing so
but pgfortran is converting the arguments instead.

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

4 years ago[flang] Merge pull request flang-compiler/f18#752 from flang-compiler/tsk-issue746
Tim Keith [Thu, 19 Sep 2019 22:36:04 +0000 (15:36 -0700)]
[flang] Merge pull request flang-compiler/f18#752 from flang-compiler/tsk-issue746

Handle alternative names for relational operators

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

4 years ago[flang] Handle alternative names for relational operators
Tim Keith [Tue, 17 Sep 2019 23:57:09 +0000 (16:57 -0700)]
[flang] Handle alternative names for relational operators

10.1.6.2 says:
> The operators <, <=, >, >=, ==, and /= always have the same interpretations
> as the operators .LT., .LE., .GT., .GE., .EQ., and .NE., respectively.
That means we have to treat `operator(<)` like `operator(.lt.)`,
for example. `<>` is a third alias for `.NE.`.

We can't just choose always to use one form (e.g. replacing `operator(.lt.)`
with `operator(<)`). This is because all symbols names are `CharBlock`s
referring to the cooked character stream so that they have proper source
provenance. Also, if a user prefers one style and uses it consistently,
that's the form they should see in messages.

So the fix is to use whatever form is found in the source, but also to
look up symbols by the other names when necessary. To assist this, add
`GenericSpecInfo::GetAllNames()` to return all of the names of a generic
spec. Each place a generic spec can occur we have to use these to look
for the symbol.

Also reorganize the `AddUse()` overloads to work with this change.

Fixes flang-compiler/f18#746.

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

4 years ago[flang] Merge pull request flang-compiler/f18#754 from flang-compiler/tsk6
Tim Keith [Thu, 19 Sep 2019 18:01:42 +0000 (11:01 -0700)]
[flang] Merge pull request flang-compiler/f18#754 from flang-compiler/tsk6

Clean up temp dirs

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

4 years ago[flang] Clean up temp dirs
Tim Keith [Wed, 18 Sep 2019 20:17:48 +0000 (13:17 -0700)]
[flang] Clean up temp dirs

A temp directory is created in `common.sh` and it is cleaned up by
`trap ... EXIT`. If the test script has its own trap, as this one does,
it seems to replace the first one. So the cleanup from `common.sh` was
not being executed when the `%t` feature was used and empty temp
directories were being left in the directory where the tests ran.

Since we already have a temp directory that is cleaned up, just use
that for `%t` and don't bother with another `mktemp`.

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

4 years ago[flang] [OpenMP] Simplify `OmpObject` with `std::variant`
Jinxin Yang [Wed, 18 Sep 2019 16:43:31 +0000 (09:43 -0700)]
[flang] [OpenMP] Simplify `OmpObject` with `std::variant`

Instead of using an `ENUM_CLASS Kind` to distinguish a `Designator`
or common-block name, change it to `std::variant`. If the `Name`
is available, then it is common-block name.

Original-commit: flang-compiler/f18@abf5db6171bc57eeddb58d22cd09e2344b023cad

4 years ago[flang] Merge pull request flang-compiler/f18#743 from flang-compiler/jpr-fix-726
jeanPerier [Tue, 17 Sep 2019 08:33:43 +0000 (01:33 -0700)]
[flang] Merge pull request flang-compiler/f18#743 from flang-compiler/jpr-fix-726

Prevent RESULT name from being the same as the function name

Original-commit: flang-compiler/f18@648d6b9eeaac17134ec5850493a3e60d7c7ad09b
Reviewed-on: https://github.com/flang-compiler/f18/pull/743

4 years ago[flang] Address comment: make error a warning instead and ignore RESULT
Jean Perier [Mon, 16 Sep 2019 10:36:12 +0000 (03:36 -0700)]
[flang] Address comment: make error a warning instead and ignore RESULT
Instead of emitting an error when RESULT has the same name as the
function, emit a warning and ignore RESULT in the rest of the
compilation.

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

4 years ago[flang] Prevent RESULT name from being the same as the function.
Jean Perier [Fri, 13 Sep 2019 16:44:05 +0000 (09:44 -0700)]
[flang] Prevent RESULT name from being the same as the function.
Fix flang-compiler/f18#726.
Add test and error messsage for such scenario and set error on the
result symbol because it is unclear what it is inside the function.

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

4 years ago[flang] Merge pull request flang-compiler/f18#740 from flang-compiler/tsk5
Tim Keith [Mon, 16 Sep 2019 14:54:27 +0000 (07:54 -0700)]
[flang] Merge pull request flang-compiler/f18#740 from flang-compiler/tsk5

Fix bugs with use-association renames

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

4 years ago[flang] Fix bugs with use-associated derived type with rename
Tim Keith [Thu, 12 Sep 2019 20:43:16 +0000 (13:43 -0700)]
[flang] Fix bugs with use-associated derived type with rename

When a derived type is use-associated with a rename, like
`use m, only: t2 => t1`
we need to record in the `DerivedTypeSpec` both the local-name in this
scope and the symbol for the derived type.

In most cases we need to work the the type symbol and its
`DerivedTypeDetails`, but when writing the type to the module file
we need the local-name. The name of the type symbol may be hidden
or not use-associated.

When analyzing a `parser::Name` we don't want to follow use-associations
because we could end up with the wrong name in a `DataRef` (i.e. the
use-name rather than the local-name). But that means that
`GetNamedConstantValue()` does have to follow them or named constants
won't always be folded.

Fixes flang-compiler/f18#729.

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

4 years ago[flang] Fix renames in module files
Tim Keith [Thu, 12 Sep 2019 16:24:04 +0000 (09:24 -0700)]
[flang] Fix renames in module files

When a module contains a use-association with rename, we have to be
careful to use the correct name (i.e. the local-name, not the use-name)
when writing out its `.mod` file.

When analyzing a `Name` in an expression, follow the use-association
for details, attributes, and constant values; but if we need to make a
`Designator` or `ProcedureDesignator`, use the local name.

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

4 years ago[flang] Refactoring
Tim Keith [Thu, 12 Sep 2019 01:21:07 +0000 (18:21 -0700)]
[flang] Refactoring

Eliminate two of the three overloadings of `Scope::MakeDerivedType()`.
Keep the one that has `Category` first because that's the order the
constructor of `DeclTypeSpec` uses.

In `mod-file.cc`, eliminate some calls to `PutLower()`. Symbols and
names are already lower case so they don't need to be converted.

In `modfile03.f90`, move the expected `.mod` file comments to right
after the corresponding modules. That makes it easier to work with.

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

4 years ago[flang] Merge pull request flang-compiler/f18#741 from flang-compiler/tsk-issue733
Tim Keith [Mon, 16 Sep 2019 14:30:54 +0000 (07:30 -0700)]
[flang] Merge pull request flang-compiler/f18#741 from flang-compiler/tsk-issue733

Fix bug merging generics on USE

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

4 years ago[flang] Address review comment
Tim Keith [Fri, 13 Sep 2019 21:39:40 +0000 (14:39 -0700)]
[flang] Address review comment

Original-commit: flang-compiler/f18@134190f75e0481a63fe97343977bb3fe895c9a5c
Reviewed-on: https://github.com/flang-compiler/f18/pull/741

4 years ago[flang] Better handling of merged generics
Tim Keith [Fri, 13 Sep 2019 21:27:33 +0000 (14:27 -0700)]
[flang] Better handling of merged generics

If a generic name is use-associated from two different modules and they
both have a specific procedure or both have a derived type with the same
name, report it as an error.

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

4 years ago[flang] Fix bug merging generics on USE
Tim Keith [Fri, 13 Sep 2019 00:38:40 +0000 (17:38 -0700)]
[flang] Fix bug merging generics on USE

When we use-associate the same generic name from two different modules
they are merged together. If the same specific procedure occurs in both
generics it should only occur once in the merged one.

Similarly, it's not an error if they both have a derived type or
specific procedure named the same as the generic, as long as they are
the same symbol.

Fixes flang-compiler/f18#733.

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

4 years ago[flang] Merge pull request flang-compiler/f18#719 from DavidTruby/target
Steve Scalpone [Sat, 14 Sep 2019 16:14:51 +0000 (09:14 -0700)]
[flang] Merge pull request flang-compiler/f18#719 from DavidTruby/target

Semantic checks for target construct

Original-commit: flang-compiler/f18@2752d09c3a7f599c27de14fcef3846f9db39e97e
Reviewed-on: https://github.com/flang-compiler/f18/pull/719

4 years ago[flang] Changed missing tofrom:scalar error message to be more descriptive
David Truby [Wed, 11 Sep 2019 10:23:36 +0000 (11:23 +0100)]
[flang] Changed missing tofrom:scalar error message to be more descriptive

Original-commit: flang-compiler/f18@18e0a55a026f96e7afecafedd385efa697391ac2
Reviewed-on: https://github.com/flang-compiler/f18/pull/719

4 years ago[flang] Added tofrom:scalar check for defaultmap clause
David Truby [Tue, 10 Sep 2019 10:02:17 +0000 (11:02 +0100)]
[flang] Added tofrom:scalar check for defaultmap clause

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

4 years ago[flang] Semantic checks for target construct
David Truby [Mon, 9 Sep 2019 10:14:10 +0000 (11:14 +0100)]
[flang] Semantic checks for target construct

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

4 years ago[flang] Merge pull request flang-compiler/f18#745 from flang-compiler/pmk-call
Peter Klausler [Fri, 13 Sep 2019 21:00:18 +0000 (14:00 -0700)]
[flang] Merge pull request flang-compiler/f18#745 from flang-compiler/pmk-call

Implement checks for test/semantics/call02.f90

Original-commit: flang-compiler/f18@45604a2d72d5d541b5de68aadb482d2f06d2c66a
Reviewed-on: https://github.com/flang-compiler/f18/pull/745

4 years ago[flang] Remove periods from the ends of messages, per review comment
peter klausler [Fri, 13 Sep 2019 20:57:35 +0000 (13:57 -0700)]
[flang] Remove periods from the ends of messages, per review comment

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

4 years ago[flang] Implement checks for test/semantics/call02.f90
peter klausler [Fri, 13 Sep 2019 19:32:43 +0000 (12:32 -0700)]
[flang] Implement checks for test/semantics/call02.f90

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

4 years ago[flang] Improve flag dumping for -funparse-with-symbols
Jinxin Yang [Fri, 13 Sep 2019 06:03:06 +0000 (23:03 -0700)]
[flang] Improve flag dumping for -funparse-with-symbols

Original-commit: flang-compiler/f18@768fb1b36925c1e1ed563562ef01146c2bba4b2b

4 years ago[flang] Merge pull request flang-compiler/f18#736 from flang-compiler/pmk-fix-expo
Peter Klausler [Thu, 12 Sep 2019 17:41:09 +0000 (10:41 -0700)]
[flang] Merge pull request flang-compiler/f18#736 from flang-compiler/pmk-fix-expo

Do not emit a bogus exponent on zero (0.e-1)

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

4 years ago[flang] Do not emit a bogus exponent (0.e-1)
peter klausler [Wed, 11 Sep 2019 16:48:15 +0000 (09:48 -0700)]
[flang] Do not emit a bogus exponent (0.e-1)

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

4 years ago[flang] Merge pull request flang-compiler/f18#738 from flang-compiler/pmk-fix-735
Peter Klausler [Thu, 12 Sep 2019 17:27:46 +0000 (10:27 -0700)]
[flang] Merge pull request flang-compiler/f18#738 from flang-compiler/pmk-fix-735

Fix bug flang-compiler/f18#735

Original-commit: flang-compiler/f18@675ccd4208cc6061b7e3fe9b6c02441ceaea2e06
Reviewed-on: https://github.com/flang-compiler/f18/pull/738

4 years ago[flang] tweak test results
peter klausler [Wed, 11 Sep 2019 23:53:26 +0000 (16:53 -0700)]
[flang] tweak test results

Original-commit: flang-compiler/f18@360c6717e790b7160655677e6f160c4d467383f8
Reviewed-on: https://github.com/flang-compiler/f18/pull/738

4 years ago[flang] Fix bug flang-compiler/f18#735
peter klausler [Wed, 11 Sep 2019 23:48:15 +0000 (16:48 -0700)]
[flang] Fix bug flang-compiler/f18#735

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

4 years ago[flang] Improve error message (add types)
peter klausler [Wed, 11 Sep 2019 23:48:03 +0000 (16:48 -0700)]
[flang] Improve error message (add types)

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

4 years ago[flang] Merge pull request flang-compiler/f18#734 from flang-compiler/jpr-fix-700
jeanPerier [Thu, 12 Sep 2019 07:31:29 +0000 (00:31 -0700)]
[flang] Merge pull request flang-compiler/f18#734 from flang-compiler/jpr-fix-700

Add NEW_LINE intrinsic to the intrinsic table

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

4 years ago[flang] Add NEW_LINE intrinsic to the intrinsic table
Jean Perier [Wed, 11 Sep 2019 10:01:55 +0000 (03:01 -0700)]
[flang] Add NEW_LINE intrinsic to the intrinsic table
NEW_LINE intrinsic folding was already implemented but it had not
yet been added the the intrinsic table and was therefore not yet
recognised an intrinsic.
Add related tests.

Original-commit: flang-compiler/f18@42fcf5b5f1e63267a024afaad39f012982c8abc1
Reviewed-on: https://github.com/flang-compiler/f18/pull/734

4 years ago[flang] Merge pull request flang-compiler/f18#737 from flang-compiler/pmk-m-in-m
Peter Klausler [Wed, 11 Sep 2019 23:40:09 +0000 (16:40 -0700)]
[flang] Merge pull request flang-compiler/f18#737 from flang-compiler/pmk-m-in-m

Allow module, submodule, and program names to be used as local identiā€¦

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

4 years ago[flang] Extend comments
peter klausler [Wed, 11 Sep 2019 20:15:32 +0000 (13:15 -0700)]
[flang] Extend comments

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

4 years ago[flang] Allow module, submodule, and program names to be used as local identifiers...
peter klausler [Wed, 11 Sep 2019 19:30:24 +0000 (12:30 -0700)]
[flang] Allow module, submodule, and program names to be used as local identifiers.  Check for USE of m in m.

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

4 years ago[flang] Merge pull request flang-compiler/f18#698 from tinlun/master
Tim Keith [Wed, 11 Sep 2019 18:10:57 +0000 (11:10 -0700)]
[flang] Merge pull request flang-compiler/f18#698 from tinlun/master

Added -fget-definition and -fget-symbols-sources.

Original-commit: flang-compiler/f18@24caaea2bf729fdc46d29981b10c668d92b0ccb9
Reviewed-on: https://github.com/flang-compiler/f18/pull/698

4 years ago[flang] Using new Prov to Cooked mappings for get-definition.
Tin Huynh [Mon, 9 Sep 2019 18:36:42 +0000 (11:36 -0700)]
[flang] Using new Prov to Cooked mappings for get-definition.

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

4 years ago[flang] FindOffsetLineAndColumn also uses SourcePosition.
Tin Huynh [Thu, 5 Sep 2019 17:05:45 +0000 (10:05 -0700)]
[flang] FindOffsetLineAndColumn also uses SourcePosition.

New tests for COMMON and BLOCK.
Added CHECK-ONCE to test_any.sh. Make sure pattern only occurs once.

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

4 years ago[flang] Added -fget-definitions and -fget-all-symbols.
Tin Huynh [Mon, 26 Aug 2019 22:16:57 +0000 (15:16 -0700)]
[flang] Added -fget-definitions and -fget-all-symbols.

- -fget-definitions finds the definition of the symbol under specified source
position.
- -fget-all-symbols finds definition locations of all symbols in a document. For
symbols found in other modules, shows which module the symbol came from.
- Tests.
- New structure SourcePosition with file, line, column information.

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

4 years ago[flang] Merge pull request flang-compiler/f18#731 from flang-compiler/pmk-fix-728
Peter Klausler [Wed, 11 Sep 2019 16:16:29 +0000 (09:16 -0700)]
[flang] Merge pull request flang-compiler/f18#731 from flang-compiler/pmk-fix-728

Recover better from syntax errors on USE statements

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

4 years ago[flang] Recover better from syntax errors on USE statements
peter klausler [Tue, 10 Sep 2019 22:29:09 +0000 (15:29 -0700)]
[flang] Recover better from syntax errors on USE statements

Original-commit: flang-compiler/f18@29968698d9afe367de92d536e54a048cc998b359
Reviewed-on: https://github.com/flang-compiler/f18/pull/731

4 years ago[flang] Merge pull request flang-compiler/f18#732 from flang-compiler/pmk-call
Peter Klausler [Wed, 11 Sep 2019 00:09:07 +0000 (17:09 -0700)]
[flang] Merge pull request flang-compiler/f18#732 from flang-compiler/pmk-call

Begin semantic checks for calls

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

4 years ago[flang] Address review comment
peter klausler [Wed, 11 Sep 2019 00:08:18 +0000 (17:08 -0700)]
[flang] Address review comment

Original-commit: flang-compiler/f18@65dc8d4996b74148a06bc73d59c318a2bf38fe07
Reviewed-on: https://github.com/flang-compiler/f18/pull/732

4 years ago[flang] Add static declaration checker; get call01.f90 to pass
peter klausler [Tue, 10 Sep 2019 22:51:46 +0000 (15:51 -0700)]
[flang] Add static declaration checker; get call01.f90 to pass

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

4 years ago[flang] Check recursive calls for NON_RECURSIVE and assumed-length CHARACTER(*)
peter klausler [Tue, 10 Sep 2019 00:01:06 +0000 (17:01 -0700)]
[flang] Check recursive calls for NON_RECURSIVE and assumed-length CHARACTER(*)

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

4 years ago[flang] commit to switch branches
peter klausler [Wed, 4 Sep 2019 19:45:08 +0000 (12:45 -0700)]
[flang] commit to switch branches

Some groundwork

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