Tim Keith [Fri, 10 Jan 2020 22:09:39 +0000 (14:09 -0800)]
[flang] Detect incorrect use of assumed-type dummy arguments
Assumed-type dummy arguments can only be used as actual arguments. If
they are used in other contexts it is an error. Change argument analysis
to handle these differently depending on the context. `allowAssumedType`
is set when the argument can be assumed-type. These expressions now all
get `typedExpr` set to `nullopt`.
Change `AnalyzeSectionSubscripts` to analyze all of the subscripts
even if one has an error. This ensures they all get analyzed expressions
(or `nullopt` in case of error).
Fix a bug analyzing `BoundsRemapping`: the lower bound was analyzed
twice and the upper bound not at all.
These change mean that `typedExpr` is set in all known cases.
Fixes flang-compiler/f18#915.
Original-commit: flang-compiler/f18@
679ef69905e39f39454768264059afd85b615840
Reviewed-on: https://github.com/flang-compiler/f18/pull/923
Gary Klimowicz [Fri, 10 Jan 2020 21:05:23 +0000 (13:05 -0800)]
[flang] Merge pull request flang-compiler/f18#922 from flang-compiler/gak-fix-comments
Minor format change to LLVM license lines
Original-commit: flang-compiler/f18@
9c7406324dc3768886ec8d2baf92b0d9395291be
Reviewed-on: https://github.com/flang-compiler/f18/pull/922
Gary Klimowicz [Fri, 10 Jan 2020 20:12:03 +0000 (12:12 -0800)]
[flang] Minor format change to LLVM license lines
Replace comment lines containing all dashes with the
proper ===-----....----=== markers.
Original-commit: flang-compiler/f18@
a8936b0d4187a9a9ef43f9d34055a3213beeb9d2
Reviewed-on: https://github.com/flang-compiler/f18/pull/922
Peter Klausler [Fri, 10 Jan 2020 17:15:29 +0000 (09:15 -0800)]
[flang] Merge pull request flang-compiler/f18#919 from flang-compiler/pmk-fix-power-build
Dodge build problem in some Power environments
Original-commit: flang-compiler/f18@
5b7f08abd79d3c59723dad6e8de0568c834479e1
Reviewed-on: https://github.com/flang-compiler/f18/pull/919
peter klausler [Thu, 9 Jan 2020 22:01:40 +0000 (14:01 -0800)]
[flang] Dodge build problem in some Power environments
Original-commit: flang-compiler/f18@
f24abf19c4aac3869459cd0984473ea3b5232d12
Reviewed-on: https://github.com/flang-compiler/f18/pull/919
Peter Klausler [Thu, 9 Jan 2020 21:07:34 +0000 (13:07 -0800)]
[flang] Merge pull request flang-compiler/f18#914 from flang-compiler/pmk-runtime-1
Start, stop, and error routines for runtime
Original-commit: flang-compiler/f18@
42ff2d005242d71f80a9460c00cbcec3e8323971
Reviewed-on: https://github.com/flang-compiler/f18/pull/914
peter klausler [Wed, 8 Jan 2020 21:27:32 +0000 (13:27 -0800)]
[flang] Runtime starting and stopping
Define ImageTerminator as a mixin-able class
Turn start.cc into main.cc
Original-commit: flang-compiler/f18@
cbc6225213075a0bdd778fd25721aa8388908e07
Reviewed-on: https://github.com/flang-compiler/f18/pull/914
Peter Klausler [Thu, 9 Jan 2020 20:28:39 +0000 (12:28 -0800)]
[flang] Merge pull request flang-compiler/f18#917 from flang-compiler/pmk-fix-912
Address complaints in bug flang-compiler/f18#912
Original-commit: flang-compiler/f18@
66025c14e432ee3f2ceab9ad5176bd1c64cd147c
Reviewed-on: https://github.com/flang-compiler/f18/pull/917
peter klausler [Thu, 9 Jan 2020 17:39:09 +0000 (09:39 -0800)]
[flang] Address complaints in bug flang-compiler/f18#912
Original-commit: flang-compiler/f18@
829f5647d67131af57dcb84b0ed2d63a5324900d
Reviewed-on: https://github.com/flang-compiler/f18/pull/917
Peter Klausler [Wed, 8 Jan 2020 17:04:30 +0000 (09:04 -0800)]
[flang] Merge pull request flang-compiler/f18#911 from flang-compiler/pmk-fold-trim
Fold TRIM and (new intrinsic) IS_CONTIGUOUS
Original-commit: flang-compiler/f18@
2c6480a62dfb75884373a4fb8b00eadb2d09adf9
Reviewed-on: https://github.com/flang-compiler/f18/pull/911
peter klausler [Tue, 7 Jan 2020 21:39:42 +0000 (13:39 -0800)]
[flang] Fold TRIM
Accept IS_CONTIGUOUS and fold it
test folding is_contiguous
Original-commit: flang-compiler/f18@
c75a0791b14811477572c6a82a961071ed82c01e
Reviewed-on: https://github.com/flang-compiler/f18/pull/911
Peter Klausler [Tue, 7 Jan 2020 21:08:51 +0000 (13:08 -0800)]
[flang] Merge pull request flang-compiler/f18#910 from flang-compiler/pmk-fold-more
Fold more intrinsic functions
Original-commit: flang-compiler/f18@
4f737d4cf684fe84abaa3b44c70187f1f8b53072
Reviewed-on: https://github.com/flang-compiler/f18/pull/910
peter klausler [Mon, 6 Jan 2020 23:29:53 +0000 (15:29 -0800)]
[flang] Implement folding of INDEX, SCAN, & VERIFY
Fold LEN_TRIM
Fold REPEAT
Fix gcc build warning
Fix two tests that had illegal pointers to coarrays
Original-commit: flang-compiler/f18@
36769996fa9559b84dda59f3f9eceee9d2269e74
Reviewed-on: https://github.com/flang-compiler/f18/pull/910
Peter Klausler [Tue, 7 Jan 2020 19:42:20 +0000 (11:42 -0800)]
[flang] Merge pull request flang-compiler/f18#907 from flang-compiler/pmk-enable-semantics
Enable semantic analysis by default
Original-commit: flang-compiler/f18@
26ab8745110bcd8909024bb02720cc0f23b9ed9b
Reviewed-on: https://github.com/flang-compiler/f18/pull/907
peter klausler [Sat, 4 Jan 2020 00:32:23 +0000 (16:32 -0800)]
[flang] enable semantic analysis by default
back out -Mnolargearray default temporarily
Fix C_F_POINTER(SHAPE=) argument check, it can be any kind of integer
Revert default result kind of SIZE() & al. to standard by default
Remove needless usage of -fdebug-semantics
Original-commit: flang-compiler/f18@
57058a5b163eaa90c7e0f387ea4918f9efa8184c
Reviewed-on: https://github.com/flang-compiler/f18/pull/907
Peter Klausler [Sat, 4 Jan 2020 15:55:26 +0000 (07:55 -0800)]
[flang] Merge pull request flang-compiler/f18#897 from kiranchandramohan/critical-3
Semantic Checks for critical construct
Original-commit: flang-compiler/f18@
b17ab7f7bda573d33d6ca554ef1e46144148cf57
Reviewed-on: https://github.com/flang-compiler/f18/pull/897
Kiran Chandramohan [Thu, 26 Dec 2019 05:18:47 +0000 (05:18 +0000)]
[flang] Semantic checks for critical construct
The commit includes the following,
-> The name field in DoConcurrent*Enforce classes are not used anymore.
Removing the field and its collection and retrieval from
DoConcurrentBodyEnforce and its usage in DoConcurrentLabelEnforce.
-> DoConcurrentLabelEnforce is useful for checking that there
are no branches escaping from other constructs also. For enabling
use in other constructs (like critical) moving this to tools.h
and renaming it as LabelEnforce.
-> Checks for the constraints.
-> Tests for the constaints.
Original-commit: flang-compiler/f18@
4b7a007ff3d4a3e519c85e960fc262bb382f3af4
Reviewed-on: https://github.com/flang-compiler/f18/pull/897
Peter Klausler [Sat, 4 Jan 2020 00:22:18 +0000 (16:22 -0800)]
[flang] Merge pull request flang-compiler/f18#905 from flang-compiler/pmk-folding
Constant folding for ANINT, NINT, FLOOR, and CEILING intrinsic functions
Original-commit: flang-compiler/f18@
ccb3ae517be766436e1cd7bcdcbb06d494fe614b
Reviewed-on: https://github.com/flang-compiler/f18/pull/905
peter klausler [Fri, 3 Jan 2020 19:34:16 +0000 (11:34 -0800)]
[flang] Fold FLOOR, CEILING, NINT, and ANINT
Add GetUltimate() to ResolveAssociations(), fixing a UBOUND test case with use association
Fix folding of array-valued subscripts while I am in here
Original-commit: flang-compiler/f18@
f663d4fef4b4c561f99e8126ff3f1d5b8e868c84
Reviewed-on: https://github.com/flang-compiler/f18/pull/905
Peter Klausler [Fri, 3 Jan 2020 23:22:15 +0000 (15:22 -0800)]
[flang] Merge pull request flang-compiler/f18#906 from flang-compiler/pmk-fix
Another attempt to fix bug flang-compiler/f18#877
Original-commit: flang-compiler/f18@
a4540324a32d60cd5dd82f765256b1e6d57d9504
Reviewed-on: https://github.com/flang-compiler/f18/pull/906
peter klausler [Fri, 3 Jan 2020 21:15:18 +0000 (13:15 -0800)]
[flang] Another attempt to fix bug flang-compiler/f18#877
Original-commit: flang-compiler/f18@
2ad2330cda59459ccfe63a62f1f944a6151f436c
Reviewed-on: https://github.com/flang-compiler/f18/pull/906
Tim Keith [Fri, 3 Jan 2020 22:11:14 +0000 (14:11 -0800)]
[flang] Merge pull request flang-compiler/f18#904 from flang-compiler/tsk-assignment3
Add analyzed form of pointer assignment
Original-commit: flang-compiler/f18@
1f6cc18c7c1252026b2b673b138cefedd87b2a04
Reviewed-on: https://github.com/flang-compiler/f18/pull/904
Tim Keith [Fri, 3 Jan 2020 18:38:51 +0000 (10:38 -0800)]
[flang] Add analyzed form of pointer assignment
Add `typedAssignment` to `PointerAssignmentStmt` parse tree node and
extend `evaluate::Assignment` to include pointer assignment, including
analyzed bounds. Analyze pointer assignments and fill those in.
Emit them in unparsed output and parse tree dump when present.
Change assignment checking to use analyzed expressions and assignments
rather than calling AnalyzeExpr. Check bounds in pointer assignments
for impure function calls in FORALL context.
Add `Fold` convenience function to `ExpressionAnalyzer`.
Original-commit: flang-compiler/f18@
140c983423d3f49fad66bc67317af3684e96ba1b
Reviewed-on: https://github.com/flang-compiler/f18/pull/904
Tim Keith [Fri, 27 Dec 2019 17:02:28 +0000 (09:02 -0800)]
[flang] Use common SymbolSet type
Replace `std::set<const Symbol *>` with `SymbolSet` from `symbol.h`.
Original-commit: flang-compiler/f18@
78e3ff33cc21999a73a061daaf772ae5f14c8e02
Reviewed-on: https://github.com/flang-compiler/f18/pull/904
Tree-same-pre-rewrite: false
Tim Keith [Mon, 23 Dec 2019 22:19:24 +0000 (14:19 -0800)]
[flang] Fix type resolution in ConcurrentHeader
As it was implemented we weren't detecting non-constant kind parameters
in the integer-type-spec. The fix is just to walk the integer-type-spec
like was do any other one.
Also, there is not need for ResolveControlExpressions -- all it does is
walk that part of the parse tree.
Original-commit: flang-compiler/f18@
8c0d890eb8852e460ea247c0c0e873dfe2da0200
Reviewed-on: https://github.com/flang-compiler/f18/pull/904
Tree-same-pre-rewrite: false
Tim Keith [Mon, 23 Dec 2019 18:40:20 +0000 (10:40 -0800)]
[flang] Move forall01 to ERROR_TESTS
That seems to be what was intended and it provides for better checking
of errors.
Original-commit: flang-compiler/f18@
99376d77a07aa04173bd20dcc45d08b76cae4a73
Reviewed-on: https://github.com/flang-compiler/f18/pull/904
Tree-same-pre-rewrite: false
Peter Klausler [Fri, 3 Jan 2020 19:33:12 +0000 (11:33 -0800)]
[flang] Merge pull request flang-compiler/f18#903 from flang-compiler/pmk-fix
Remove needless std::move() that breaks clang build
Original-commit: flang-compiler/f18@
85f5cbecf16642b7be7416c1f6d83f85f8fbc9f2
Reviewed-on: https://github.com/flang-compiler/f18/pull/903
peter klausler [Fri, 3 Jan 2020 18:30:14 +0000 (10:30 -0800)]
[flang] Remove needless std::move() that breaks clang build
Add the std::move() to where it should have been
Original-commit: flang-compiler/f18@
54fe9b39a1551313da06e5c40ca2aa523288292d
Reviewed-on: https://github.com/flang-compiler/f18/pull/903
psteinfeld [Fri, 3 Jan 2020 17:09:02 +0000 (09:09 -0800)]
[flang] Merge pull request flang-compiler/f18#902 from flang-compiler/ps-do-call
Check for passing DO variables to OUT arguments in a CALL statement
Original-commit: flang-compiler/f18@
27220661c3ac15c3135510b551458bc01a0a8ba5
Reviewed-on: https://github.com/flang-compiler/f18/pull/902
Pete Steinfeld [Thu, 2 Jan 2020 20:26:47 +0000 (12:26 -0800)]
[flang] Check for passing DO variables to OUT arguments in a CALL statement
I added code to save the INTENT of a dummy argument in the checked expression
of the actual argument. When processing a CallStmt, I then retrieve the
ProcedureRef, which contains a list of the checked ActualArguments. I then
traverse this list looking for actual arguments that are active DO variable
that are being passed to dummy arguments whose INTENT is either OUT or INOUT.
For OUT dummies, I put out an error message and warn for INOUT dummies.
Original-commit: flang-compiler/f18@
0ff1d264284c51a0142df0b785eb5f6409e8ad51
Reviewed-on: https://github.com/flang-compiler/f18/pull/902
Peter Klausler [Thu, 2 Jan 2020 20:27:12 +0000 (12:27 -0800)]
[flang] Merge pull request flang-compiler/f18#901 from flang-compiler/pmk-operator-tbp
Fix type-bound user-defined operators
Original-commit: flang-compiler/f18@
db63c87fb0ba8784c6b16cef80d6ae715900fa67
Reviewed-on: https://github.com/flang-compiler/f18/pull/901
peter klausler [Thu, 2 Jan 2020 17:55:03 +0000 (09:55 -0800)]
[flang] Handle type-bound user-defined operators
Pre-review clean-up
Original-commit: flang-compiler/f18@
1d4e85563aad3fc28c4decdc27f4c52af229c3d4
Reviewed-on: https://github.com/flang-compiler/f18/pull/901
Tim Keith [Thu, 2 Jan 2020 16:29:19 +0000 (08:29 -0800)]
[flang] Merge pull request flang-compiler/f18#899 from flang-compiler/deps
Add .mod file dependencies
Original-commit: flang-compiler/f18@
74617f1d489ad211a81b91881ab8d4c199860fd8
Reviewed-on: https://github.com/flang-compiler/f18/pull/899
Tim Keith [Tue, 31 Dec 2019 22:08:12 +0000 (14:08 -0800)]
[flang] Add .mod file dependencies
Make compilation of other predefined module files depend on
__fortran_builtins.mod. Currently only iso_c_binding.f90 and
iso_fortran_env.f90 depend on it but others could in the future.
Create the .f18.mod files by copying from the .mod files so that
we don't have to worry about dependencies for those.
Original-commit: flang-compiler/f18@
8209ad3d32909573e9ef72327ba61932f8967587
Reviewed-on: https://github.com/flang-compiler/f18/pull/899
Peter Klausler [Tue, 31 Dec 2019 23:25:47 +0000 (15:25 -0800)]
[flang] Merge pull request flang-compiler/f18#900 from flang-compiler/pmk-fold
Partition fold.cc to reduce build-time memory requirements
Original-commit: flang-compiler/f18@
372c82219a7b6cd355bf6d785b81daaf39790ac4
Reviewed-on: https://github.com/flang-compiler/f18/pull/900
peter klausler [Tue, 31 Dec 2019 22:10:28 +0000 (14:10 -0800)]
[flang] Prep for review
Original-commit: flang-compiler/f18@
25cb92e9903dfd97a8b5b8ecd2b60ce22ecd3659
Reviewed-on: https://github.com/flang-compiler/f18/pull/900
peter klausler [Tue, 31 Dec 2019 21:58:26 +0000 (13:58 -0800)]
[flang] Put templates back into implementation header
Original-commit: flang-compiler/f18@
89499243510d44d94ac47d41db34c0e6822801b0
Reviewed-on: https://github.com/flang-compiler/f18/pull/900
Tree-same-pre-rewrite: false
peter klausler [Tue, 31 Dec 2019 21:43:15 +0000 (13:43 -0800)]
[flang] More restructuring
Original-commit: flang-compiler/f18@
6e4aca113a7d744af8b2566a52e270d59743084e
Reviewed-on: https://github.com/flang-compiler/f18/pull/900
Tree-same-pre-rewrite: false
peter klausler [Tue, 31 Dec 2019 20:20:42 +0000 (12:20 -0800)]
[flang] Break up fold.cc along per-type fault lines
Original-commit: flang-compiler/f18@
8022c143d9283d670350e9d2d68b21325becf8c6
Reviewed-on: https://github.com/flang-compiler/f18/pull/900
Tree-same-pre-rewrite: false
peter klausler [Tue, 31 Dec 2019 19:06:07 +0000 (11:06 -0800)]
[flang] Make SHAPE= argument to C_F_POINTER() sensitive to -Mlargearray
Original-commit: flang-compiler/f18@
daaa74bbc85f0d1625d1aecd89a0b428209c5c4c
Reviewed-on: https://github.com/flang-compiler/f18/pull/900
Tree-same-pre-rewrite: false
Peter Klausler [Tue, 31 Dec 2019 18:52:56 +0000 (10:52 -0800)]
[flang] Merge pull request flang-compiler/f18#898 from flang-compiler/pmk-patch
Patch build problem
Original-commit: flang-compiler/f18@
07318b5c8936060d6f0602da5e555d951b6abd29
Reviewed-on: https://github.com/flang-compiler/f18/pull/898
peter klausler [Tue, 31 Dec 2019 17:19:08 +0000 (09:19 -0800)]
[flang] Patch build problem
Original-commit: flang-compiler/f18@
a66851210028d1cf31ba4875a2eb71eebb333a91
Reviewed-on: https://github.com/flang-compiler/f18/pull/898
Peter Klausler [Tue, 31 Dec 2019 16:53:40 +0000 (08:53 -0800)]
[flang] Merge pull request flang-compiler/f18#896 from flang-compiler/pmk-c_f_pointer
C_F_POINTER
Original-commit: flang-compiler/f18@
f4d48e852543a02ba19d8b9cce9fe18ee749d2d5
Reviewed-on: https://github.com/flang-compiler/f18/pull/896
peter klausler [Wed, 25 Dec 2019 20:29:50 +0000 (12:29 -0800)]
[flang] C_F_POINTER
Emit INTRINSIC statements in module files
Argument checking utility
Complete error checking
Original-commit: flang-compiler/f18@
9c6a88f0482c1f222b37e0cc548c822f80ad00e7
Reviewed-on: https://github.com/flang-compiler/f18/pull/896
Peter Klausler [Wed, 25 Dec 2019 02:08:03 +0000 (18:08 -0800)]
[flang] Merge pull request flang-compiler/f18#893 from flang-compiler/pmk-fixes
Fix flang-compiler/f18#892 and a crash
Original-commit: flang-compiler/f18@
86ae6e6cc85c46958c2446d754650026ba26ff86
Reviewed-on: https://github.com/flang-compiler/f18/pull/893
peter klausler [Tue, 24 Dec 2019 01:12:53 +0000 (17:12 -0800)]
[flang] Fix test for assignment to host-associated object in PURE
Original-commit: flang-compiler/f18@
019e61aa85ce55298d233dbb3af6399a8ce974b6
Reviewed-on: https://github.com/flang-compiler/f18/pull/893
Steve Scalpone [Wed, 25 Dec 2019 00:58:28 +0000 (16:58 -0800)]
[flang] The #! sequence must be at the start of the script file. (flang-compiler/f18#894)
Original-commit: flang-compiler/f18@
b1ff232730778d6de62036711afb34fd3ded0bd6
Reviewed-on: https://github.com/flang-compiler/f18/pull/894
psteinfeld [Tue, 24 Dec 2019 23:19:01 +0000 (15:19 -0800)]
[flang] Merge pull request flang-compiler/f18#860 from flang-compiler/ps-do-redefine
Semantic checks to see if a DO variable is modified
Original-commit: flang-compiler/f18@
6715b162fa234b8836e34b216886d4de80ca4568
Reviewed-on: https://github.com/flang-compiler/f18/pull/860
Pete Steinfeld [Sat, 7 Dec 2019 03:59:54 +0000 (19:59 -0800)]
[flang] Semantic checks to see if a DO variable is modified
I added infrastructure to SemanticsContext to track active DO variables
and the source locations where they appear in DO statements. I also
added code to semantics.[h,cc] to check to see if a DO variable is
already defined, and, if so, to emit an error message along with a
reference to the relevant DO construct. I also added calls to several
places where variables are defined to determine if the definitions are
happening in the context of an active DO construct.
I have not yet added the checks for DO variables being redefined when passing
them as actual arguments to dummy arguments with INTENT(OUT) or INTENT(INOUT).
I wanted to get these changes merged first and catch up with the other changes
in master.
Original-commit: flang-compiler/f18@
1bbfcca61b94dccfbbe943b511f846acc1c33997
Reviewed-on: https://github.com/flang-compiler/f18/pull/860
Peter Klausler [Tue, 24 Dec 2019 00:35:54 +0000 (16:35 -0800)]
[flang] Merge pull request flang-compiler/f18#891 from flang-compiler/pmk-spec
Some fixes
Original-commit: flang-compiler/f18@
e3ee4a658ad4236a6683e8cbec8c24345dab9805
Reviewed-on: https://github.com/flang-compiler/f18/pull/891
peter klausler [Fri, 20 Dec 2019 21:03:30 +0000 (13:03 -0800)]
[flang] Fix off-by-one error in preprocessing expressions
Original-commit: flang-compiler/f18@
4c08a4a1be9fb398a8fc7561da114dc9d2a3accc
Reviewed-on: https://github.com/flang-compiler/f18/pull/891
Gary Klimowicz [Mon, 23 Dec 2019 19:47:55 +0000 (11:47 -0800)]
[flang] Merge pull request flang-compiler/f18#890 from flang-compiler/gak-format-fixes
Fix clang-format issues identified during relicensing
Original-commit: flang-compiler/f18@
a04295dc36f8685447bd83dffdd037dc2e819f2e
Reviewed-on: https://github.com/flang-compiler/f18/pull/890
Gary Klimowicz [Mon, 23 Dec 2019 19:16:00 +0000 (11:16 -0800)]
[flang] Fix clang-format issues identified during relicensing
While running clang-format during the relicensing, there were
a few files that showed minor format issues that could be cleaned
up. These changes address them.
Original-commit: flang-compiler/f18@
b308f9e35a6d386b53ded90e84bbfac600f38867
Reviewed-on: https://github.com/flang-compiler/f18/pull/890
Gary Klimowicz [Mon, 23 Dec 2019 19:07:30 +0000 (11:07 -0800)]
[flang] Merge pull request flang-compiler/f18#887 from flang-compiler/gak-relicense
Flang relicensing changes for LLVM Apache 2.0 license
Original-commit: flang-compiler/f18@
e06be2faa64a52471b3cfb2829dc05888236aa68
Reviewed-on: https://github.com/flang-compiler/f18/pull/887
Gary Klimowicz [Fri, 20 Dec 2019 20:52:07 +0000 (12:52 -0800)]
[flang] Flang relicensing changes for LLVM Apache 2.0 license
This changes the license information in many of the flang source files.
- Renamed LICENSE to LICENSE.txt.
- NVIDIA Copyright lines have been removed.
- Initial lines for files follow the LLVM coding convention (file name on the first line; Emacs mode information on the first line).
- License references have been replaced with the abridged LLVM text.
- License information was removed from the test files.
- No file header was placed on test files (these weren't in most LLVM test files).
- License information was added to documentation files where it was missing.
We did not add brief file summaries to the initial line.
See http://llvm.org/docs/DeveloperPolicy.html#new-llvm-project-license-framework
for a description of the new license.
See http://llvm.org/docs/CodingStandards.html#file-headers
for a description of the new LLVM standard file header.
Original-commit: flang-compiler/f18@
add6cde7244b926ca457a1c74c21fea071b85329
Reviewed-on: https://github.com/flang-compiler/f18/pull/887
Peter Klausler [Fri, 20 Dec 2019 20:53:06 +0000 (12:53 -0800)]
[flang] Merge pull request flang-compiler/f18#886 from kiranchandramohan/elemental
Mark ieee_get_flag and ieee_get_halting_mode as elemental
Original-commit: flang-compiler/f18@
a694b62c6d464ef2fc17046497a0aa0a0b14a756
Reviewed-on: https://github.com/flang-compiler/f18/pull/886
Kiran Chandramohan [Fri, 20 Dec 2019 20:28:18 +0000 (20:28 +0000)]
[flang] Mark ieee_get_flag and ieee_get_halting_mode as elemental
Original-commit: flang-compiler/f18@
d6237fa31112acc7bd864b9f732cb288014e6cf7
Reviewed-on: https://github.com/flang-compiler/f18/pull/886
Peter Klausler [Fri, 20 Dec 2019 20:24:30 +0000 (12:24 -0800)]
[flang] Merge pull request flang-compiler/f18#885 from flang-compiler/pmk-fixes
Two small fixes
Original-commit: flang-compiler/f18@
2d8a4815a338b3c21cc9882ebbb165fe1204ed93
Reviewed-on: https://github.com/flang-compiler/f18/pull/885
peter klausler [Fri, 20 Dec 2019 18:44:43 +0000 (10:44 -0800)]
[flang] Fix kind of REAL(complex) to be the same as the argument by default
Fixes for expression formatting
Original-commit: flang-compiler/f18@
13e8909587f2284e0093cdfaab5ac8335b060ec9
Reviewed-on: https://github.com/flang-compiler/f18/pull/885
Peter Klausler [Fri, 20 Dec 2019 18:09:49 +0000 (10:09 -0800)]
[flang] Merge pull request flang-compiler/f18#884 from flang-compiler/pmk-warn-size
Convert INTEGER scalar actual argument expressions to the kinds of dummies
Original-commit: flang-compiler/f18@
c88694b36eeb0ac0010127d8751627f000800000
Reviewed-on: https://github.com/flang-compiler/f18/pull/884
peter klausler [Fri, 20 Dec 2019 03:13:16 +0000 (19:13 -0800)]
[flang] Auto conversion of integer scalar actual argument exprs
Add documentation
Original-commit: flang-compiler/f18@
c1b200d23891cff4eca1991deec58c1adf65842e
Reviewed-on: https://github.com/flang-compiler/f18/pull/884
Peter Klausler [Fri, 20 Dec 2019 02:35:17 +0000 (18:35 -0800)]
[flang] Merge pull request flang-compiler/f18#883 from flang-compiler/pmk-spec-fixes
Misc fixes from SPEC
Original-commit: flang-compiler/f18@
9e91c635d7c706b78ed8f3776e7bfac1e20b559f
Reviewed-on: https://github.com/flang-compiler/f18/pull/883
peter klausler [Thu, 19 Dec 2019 01:06:13 +0000 (17:06 -0800)]
[flang] Roll up fixes for semantic analysis of SPEC CPU codes
- Add cases to IsDescriptor
- Fix NULLIFY in PURE checking
- Fix fotonik3d mutually-referencing derived type bug
- Fix spurious I/O error message on ALLOCATE
Original-commit: flang-compiler/f18@
34b64db7da9e90109b1dfec5347b344eae7dd8ad
Reviewed-on: https://github.com/flang-compiler/f18/pull/883
Tim Keith [Thu, 19 Dec 2019 17:52:15 +0000 (09:52 -0800)]
[flang] Save CallStmt::typedCall (flang-compiler/f18#879)
When `ExpressionAnalyzer::AnalyzeCall` processed a subroutine it was
always returning std::nullopt. Change it to return a `ProcedureRef`
wrapped in an `Expr` so that it can be saved in `CallStmt::typedCall`.
Original-commit: flang-compiler/f18@
2cc226f66ec51b38056c779494a7b6104557f9a8
Reviewed-on: https://github.com/flang-compiler/f18/pull/879
Tim Keith [Thu, 19 Dec 2019 01:26:49 +0000 (17:26 -0800)]
[flang] Merge pull request flang-compiler/f18#878 from flang-compiler/tsk-dump-parse-expr
Include analyzed exprs in parse tree dump
Original-commit: flang-compiler/f18@
0855ba8baa5c6e9afc62f96fd4cba5d9a32d56d5
Reviewed-on: https://github.com/flang-compiler/f18/pull/878
Tim Keith [Wed, 18 Dec 2019 23:49:42 +0000 (15:49 -0800)]
[flang] Remove extraneous occurences of parser::
This file is in `Fortran::parser` so we don't need to qualify names
with `parser::`.
Original-commit: flang-compiler/f18@
e8e7ffcae88c3be8fecf4188896736790217578c
Reviewed-on: https://github.com/flang-compiler/f18/pull/878
Tim Keith [Wed, 18 Dec 2019 23:36:14 +0000 (15:36 -0800)]
[flang] Include analyzed exprs in parse tree dump
When dumping the parse tree, if there are analyzed expressions,
assignments, or call statements, include the Fortran form of those
in the dump.
This uses the same `AnalyzedObjectsAsFortran` object that unparsing
does so it applies to the same nodes.
We already do something like this for `Name` nodes as well as some
predefined types, so abstract it into an `AsFortran` function which
returns the Fortran source for a node that is to be included in the
dump.
Original-commit: flang-compiler/f18@
823b044d2a009f43fe5ce15755a8ae23f70dfed8
Reviewed-on: https://github.com/flang-compiler/f18/pull/878
Tree-same-pre-rewrite: false
Peter Klausler [Thu, 19 Dec 2019 00:11:31 +0000 (16:11 -0800)]
[flang] Merge pull request flang-compiler/f18#874 from flang-compiler/pmk-fixes
Fix unparsing of assignment representation and excess parentheses
Original-commit: flang-compiler/f18@
3e7e95fff203bb33834f9b91e2a3ec5a3885b73b
Reviewed-on: https://github.com/flang-compiler/f18/pull/874
peter klausler [Tue, 17 Dec 2019 23:59:25 +0000 (15:59 -0800)]
[flang] Fix unparsing of assignment representation and excess parentheses
More fixes, and move prefix/infix/suffix strings into formatting.cc
Original-commit: flang-compiler/f18@
49d68700e0ab105459fb1e05bf60f8ec352a8aac
Reviewed-on: https://github.com/flang-compiler/f18/pull/874
Peter Klausler [Tue, 17 Dec 2019 21:44:51 +0000 (13:44 -0800)]
[flang] Merge pull request flang-compiler/f18#873 from flang-compiler/pmk-call
Save analyzed ProcedureRef in parse tree node for CALL statement
Original-commit: flang-compiler/f18@
80c27052055fccd20b18130b510169549ff38fea
Reviewed-on: https://github.com/flang-compiler/f18/pull/873
peter klausler [Tue, 17 Dec 2019 20:32:16 +0000 (12:32 -0800)]
[flang] Back some changes out
Original-commit: flang-compiler/f18@
7f6345ac627e5f5b8ed8daeb7290b2a7712b0e5d
Reviewed-on: https://github.com/flang-compiler/f18/pull/873
peter klausler [Tue, 17 Dec 2019 18:53:20 +0000 (10:53 -0800)]
[flang] Save analyzed CALL statements in the parse tree
Original-commit: flang-compiler/f18@
bd618f179c82ca613efd8db71548ceb5b1143e70
Reviewed-on: https://github.com/flang-compiler/f18/pull/873
Tree-same-pre-rewrite: false
Peter Klausler [Mon, 16 Dec 2019 23:05:42 +0000 (15:05 -0800)]
[flang] Merge pull request flang-compiler/f18#862 from flang-compiler/pmk-grammar
Outline parsers for types (reduce f18 build memory requirements)
Original-commit: flang-compiler/f18@
8d2b296fe1ecc6e4b92789b8dffaf22b3930a89e
Reviewed-on: https://github.com/flang-compiler/f18/pull/862
peter klausler [Mon, 16 Dec 2019 22:28:57 +0000 (14:28 -0800)]
[flang] Improve commentary
Original-commit: flang-compiler/f18@
364ac83bfc39e7f866536f4d1fd1c19c271469c1
Reviewed-on: https://github.com/flang-compiler/f18/pull/862
peter klausler [Mon, 9 Dec 2019 19:09:44 +0000 (11:09 -0800)]
[flang] Outline per-type parsers to reduce f18 build-time
CPU & memory requirements
Original-commit: flang-compiler/f18@
f48fe07dfac52b4c2f031e34d27404f37a0a7cd7
Reviewed-on: https://github.com/flang-compiler/f18/pull/862
Tree-same-pre-rewrite: false
Tim Keith [Mon, 16 Dec 2019 22:50:19 +0000 (14:50 -0800)]
[flang] Merge pull request flang-compiler/f18#872 from flang-compiler/tsk-defined-op2
Support for type-bound operators and assignment
Original-commit: flang-compiler/f18@
9862c9406144ccb39f97453909fc476d8c380f4b
Reviewed-on: https://github.com/flang-compiler/f18/pull/872
Tim Keith [Mon, 16 Dec 2019 22:28:23 +0000 (14:28 -0800)]
[flang] Add evaluate::GetDerivedTypeSpec(DynamicType)
It gets the semantics::DerivedTypeSpec of a DynamicType if it has one.
Make use of it where it simplifies the code.
Original-commit: flang-compiler/f18@
9ad12e7c131459a8beab2b9ffa204966a85f405a
Reviewed-on: https://github.com/flang-compiler/f18/pull/872
Tim Keith [Sat, 14 Dec 2019 00:22:48 +0000 (16:22 -0800)]
[flang] C774: Defined operator/assignment may not have NOPASS
Original-commit: flang-compiler/f18@
6bfa3d3568b6dc373d62d691db2fd5e8859fff47
Reviewed-on: https://github.com/flang-compiler/f18/pull/872
Tree-same-pre-rewrite: false
Tim Keith [Mon, 16 Dec 2019 19:33:55 +0000 (11:33 -0800)]
[flang] Support for type-bound operators and assignment
Add `ArgumentAnalyzer::FindBoundOp` to look for an operator or
assignment definition in the type of each operand. Then `TryBoundOp`
checks if it is actually applicable.
Change ResolveGeneric to handle type-bound operators: the `adjustActuals`
function passed in handles the difference between these and normal
type-bound procedures. For operators, either operand may be the passed-
object argument. For procedures we know which one it is.
Extract `GetDerivedTypeSpec`, `GetBindingResolution`, and
`OkLogicalIntegerAssignment` into separate functions to simplify the
logic of the calling functions.
Original-commit: flang-compiler/f18@
1f7ff22145ef61c4c168c466f4de4fab11e0f611
Reviewed-on: https://github.com/flang-compiler/f18/pull/872
Tree-same-pre-rewrite: false
Peter Klausler [Mon, 16 Dec 2019 20:54:55 +0000 (12:54 -0800)]
[flang] Merge pull request flang-compiler/f18#871 from flang-compiler/pmk-fixes
Fix remaining failures in expression semantics
Original-commit: flang-compiler/f18@
7473f0bcd76a055fffea9d3f47567a64fceb5ccf
Reviewed-on: https://github.com/flang-compiler/f18/pull/871
peter klausler [Wed, 11 Dec 2019 23:06:24 +0000 (15:06 -0800)]
[flang] Apply implicit typing to names in COMMON that appear in specification expressions
Extend semantic analysis of expressions to catch missing cases
Fix statement function semantics, add degree trig intrinsics
Add GetUltimate to rewrite of bare namelist
Address review comments
Original-commit: flang-compiler/f18@
52ff319de2e750733660d8e7e938e09159a3c11c
Reviewed-on: https://github.com/flang-compiler/f18/pull/871
Eric Schweitz [Mon, 16 Dec 2019 16:39:17 +0000 (08:39 -0800)]
[flang] Merge pull request flang-compiler/f18#869 from schweitzpgi/master
remove stale optimizer files
Original-commit: flang-compiler/f18@
6a8dec4991ecb219f0d42a865d799c93e675612f
Reviewed-on: https://github.com/flang-compiler/f18/pull/869
Eric Schweitz [Fri, 13 Dec 2019 22:46:20 +0000 (14:46 -0800)]
[flang] remove stale optimizer files
Original-commit: flang-compiler/f18@
c497c135f6f277f2dee0c1c3c82319577448438c
Reviewed-on: https://github.com/flang-compiler/f18/pull/869
Eric Schweitz [Thu, 12 Dec 2019 00:47:06 +0000 (16:47 -0800)]
[flang] Merge pull request flang-compiler/f18#868 from schweitzpgi/remove-flatten
remove some old files
Original-commit: flang-compiler/f18@
3d05d39e3636fecab2bc1b7540cec9d672f72944
Reviewed-on: https://github.com/flang-compiler/f18/pull/868
Eric Schweitz [Wed, 11 Dec 2019 21:33:02 +0000 (13:33 -0800)]
[flang] remove some old files
Original-commit: flang-compiler/f18@
d7554c7605079c8a2f8d3d2d6d584241d3112ecd
Reviewed-on: https://github.com/flang-compiler/f18/pull/868
Gary Klimowicz [Wed, 11 Dec 2019 19:13:48 +0000 (11:13 -0800)]
[flang] Flang relicense: LICENSE file and one change (flang-compiler/f18#867)
Add new license text to runtime/magic-numbers.h, which is unusual
in that it is the only .h file in flang that is intended to be
included in either C or Fortran files. This requires special
handling of the license text.
Original-commit: flang-compiler/f18@
61bb9db531ad4fbe8fda9978a6b7754cb86323c2
Reviewed-on: https://github.com/flang-compiler/f18/pull/867
Kiran Kumar T P [Wed, 11 Dec 2019 17:11:59 +0000 (22:41 +0530)]
[flang] Updated call10.f90 with more test for flang-compiler/f18#794-Check for PURE procedures containing image control statements (flang-compiler/f18#857)
Original-commit: flang-compiler/f18@
ae4868e572c90e0ec2c618f4235c9de1ea8cade5
Reviewed-on: https://github.com/flang-compiler/f18/pull/857
jeanPerier [Wed, 11 Dec 2019 07:52:48 +0000 (23:52 -0800)]
[flang] Merge pull request flang-compiler/f18#865 from flang-compiler/jpr-fix-cplx-power
Fix INTGER**COMPLEX regression introduced by PR 858
Original-commit: flang-compiler/f18@
53545d7436c452e2329615326ab95799083dbcd3
Reviewed-on: https://github.com/flang-compiler/f18/pull/865
Jean Perier [Tue, 10 Dec 2019 09:21:50 +0000 (01:21 -0800)]
[flang] Fix INTGER**COMPLEX regression introduced by PR 858
Fix bad copy past that had introduced an unitialized value use.
Original-commit: flang-compiler/f18@
9a84bcb9ac3a06800e9c0f0941a6a82d8416a9fe
Reviewed-on: https://github.com/flang-compiler/f18/pull/865
arjunsuresh1987 [Tue, 10 Dec 2019 22:07:56 +0000 (03:37 +0530)]
[flang] Fix file path in cmake (flang-compiler/f18#844)
Original-commit: flang-compiler/f18@
4771f8cb7895ebc1fa836e8cf3ceddfa7a705eba
Reviewed-on: https://github.com/flang-compiler/f18/pull/844
Peter Klausler [Tue, 10 Dec 2019 20:39:52 +0000 (12:39 -0800)]
[flang] Merge pull request flang-compiler/f18#864 from flang-compiler/pmk-fix
Revert recent addition of ActualArgument::PassedObject
Original-commit: flang-compiler/f18@
d1b6e3cd2c4ef79df6804edd85d7b1e1d398e255
Reviewed-on: https://github.com/flang-compiler/f18/pull/864
peter klausler [Mon, 9 Dec 2019 21:52:12 +0000 (13:52 -0800)]
[flang] Revert recent addition of ActualArgument::PassedObject
reformatting
Complete merging with current master
implement extension of inherited type-bound generics
Original-commit: flang-compiler/f18@
e58c4e53c2fcf6559e7254ce0fd1e4b96d158c73
Reviewed-on: https://github.com/flang-compiler/f18/pull/864
Tim Keith [Mon, 9 Dec 2019 22:26:59 +0000 (14:26 -0800)]
[flang] Merge pull request flang-compiler/f18#863 from flang-compiler/tsk-defined-op2
Resolve calls to type-bound generic names
Original-commit: flang-compiler/f18@
b3bb698086ab9a79c285f90b956036d8411f4520
Reviewed-on: https://github.com/flang-compiler/f18/pull/863
Tim Keith [Mon, 9 Dec 2019 21:36:19 +0000 (13:36 -0800)]
[flang] Resolve calls to type-bound generic names
Extend `ResolveGeneric` to handle calls to procedure components by
passing in the data-ref that is used as the passed-object argument.
`AddPassArg` takes care of adding a placeholder for the passed object.
This is shared by the generic and non-generic cases of calls to
procedure components.
Original-commit: flang-compiler/f18@
be83590183f7abf32c0cc111c812fd484af36f2b
Reviewed-on: https://github.com/flang-compiler/f18/pull/863
jeanPerier [Mon, 9 Dec 2019 10:53:53 +0000 (02:53 -0800)]
[flang] Merge pull request flang-compiler/f18#858 from flang-compiler/jpr-complex-power-promote-fix
Fix COMPLEX-REAL `/` and `**` operand promotion
Original-commit: flang-compiler/f18@
722caa61f217625aed4d4654e5f03627777d2323
Reviewed-on: https://github.com/flang-compiler/f18/pull/858
Jean Perier [Fri, 6 Dec 2019 09:18:20 +0000 (01:18 -0800)]
[flang] Fix COMPLEX/REAL `/` and `**` operand promotion
The real operand was always converted to the complex operand type.
The highest precison should be used instead. This fix converts the
real to a complex of the same kind before applying the promotion
rules for complex operands.
Reference to Fortran 2018 standard 10.9.1.3 that rules this added
in comments.
Original-commit: flang-compiler/f18@
0d6b9c33aae59d80ff1b77f3561a6acb1db98645
Reviewed-on: https://github.com/flang-compiler/f18/pull/858
Peter Klausler [Fri, 6 Dec 2019 21:56:08 +0000 (13:56 -0800)]
[flang] Merge pull request flang-compiler/f18#859 from flang-compiler/pmk-empty
Accept source files with no program units (flang-compiler/f18#658)
Original-commit: flang-compiler/f18@
2ebb75529c80a21658250dafffbf49ebdc27847e
Reviewed-on: https://github.com/flang-compiler/f18/pull/859
peter klausler [Fri, 6 Dec 2019 17:37:07 +0000 (09:37 -0800)]
[flang] Accept source files with no program units (flang-compiler/f18#658)
update documentation
Original-commit: flang-compiler/f18@
3dfb8314991035a428c514cf0ad46af446d64a4e
Reviewed-on: https://github.com/flang-compiler/f18/pull/859
Peter Klausler [Fri, 6 Dec 2019 17:52:37 +0000 (09:52 -0800)]
[flang] Merge pull request flang-compiler/f18#856 from flang-compiler/pmk-legacy-assignments
Allow assignment between INTEGER and LOGICAL as extension
Original-commit: flang-compiler/f18@
169f380eafa87f2164e4529a314701feaee55ad6
Reviewed-on: https://github.com/flang-compiler/f18/pull/856
peter klausler [Fri, 6 Dec 2019 00:18:39 +0000 (16:18 -0800)]
[flang] Allow assignment between INTEGER and LOGICAL as extension
Extend documentation
Original-commit: flang-compiler/f18@
7a719198fc7dc09f50cd1e4129d87f2ace711c4b
Reviewed-on: https://github.com/flang-compiler/f18/pull/856