Commit graph

447 commits

Author SHA1 Message Date
peter klausler
a7041f3a78 [flang] Implement GetShape with expression visitor
Original-commit: flang-compiler/f18@d607d02847
Reviewed-on: https://github.com/flang-compiler/f18/pull/611
Tree-same-pre-rewrite: false
2019-08-02 09:21:59 -07:00
peter klausler
6347b7c695 [flang] Fix bug
Original-commit: flang-compiler/f18@482f882e3f
Reviewed-on: https://github.com/flang-compiler/f18/pull/603
2019-07-25 10:40:09 -07:00
peter klausler
5eebbe7c9b [flang] Fix IsVariable for Pete
Original-commit: flang-compiler/f18@4a24f74ae4
Reviewed-on: https://github.com/flang-compiler/f18/pull/603
Tree-same-pre-rewrite: false
2019-07-25 10:40:07 -07:00
peter klausler
4aa659f795 [flang] Address comments; allow "real,parameter::x=tiny(x)"
Original-commit: flang-compiler/f18@e865358871
Reviewed-on: https://github.com/flang-compiler/f18/pull/602
2019-07-25 10:16:28 -07:00
peter klausler
9b079deed5 [flang] Fold more model inquiry intrinsics
Original-commit: flang-compiler/f18@a3d82893b7
Reviewed-on: https://github.com/flang-compiler/f18/pull/602
Tree-same-pre-rewrite: false
2019-07-24 14:07:03 -07:00
peter klausler
353202bdcf [flang] Fix handling of ALLOCATABLE components in GetLastTarget
Original-commit: flang-compiler/f18@6b3b404bdc
Reviewed-on: https://github.com/flang-compiler/f18/pull/601
Tree-same-pre-rewrite: false
2019-07-23 13:42:06 -07:00
peter klausler
00861127ac [flang] Improve comments
Original-commit: flang-compiler/f18@277fb1cc91
Reviewed-on: https://github.com/flang-compiler/f18/pull/601
Tree-same-pre-rewrite: false
2019-07-23 11:45:55 -07:00
peter klausler
e4945e5d09 [flang] Improve expression traversal, use it more for tools
Original-commit: flang-compiler/f18@4980b928bc
Reviewed-on: https://github.com/flang-compiler/f18/pull/601
Tree-same-pre-rewrite: false
2019-07-23 10:55:56 -07:00
peter klausler
3028ecf0b8 [flang] Reimplement GetLastSymbol with expression visitor
Original-commit: flang-compiler/f18@a996751e97
Reviewed-on: https://github.com/flang-compiler/f18/pull/601
Tree-same-pre-rewrite: false
2019-07-22 14:05:33 -07:00
jeanPerier
953d93dbe8 [flang] Merge pull request flang-compiler/f18#544 from flang-compiler/jpr-reshape-only-folding
RESHAPE without shared runtime/front-end descriptor API

Original-commit: flang-compiler/f18@24856b8238
Reviewed-on: https://github.com/flang-compiler/f18/pull/544

Due to a conflicting rebase during the linearizing of flang-compiler/f18, this commit squashes a number of other commits:

flang-compiler/f18@2ec1d85d39 Implement RESHAPE folding on Constant<T> only
flang-compiler/f18@5394630539 Enable RESHAPE folding tests
flang-compiler/f18@83b2b86253 Answer review comment + Add a common path for intrsinic function folding before specializing the folding per type. + Make reshape folding return an "invalid" intrinsic after errors are met so that warnings do not get re-generated. + Misc style changes
flang-compiler/f18@2e5c29f280 add missing file to previous commit...
flang-compiler/f18@9bd5ad9875 Document issue #518 workaround
flang-compiler/f18@a4f8f51831 Go back to clang-format version 7.01
flang-compiler/f18@e871e58a52 answer comment regarding naming and interface
flang-compiler/f18@145c7c1ece Merge branch 'master' into jpr-reshape-only-folding Too many logical conflicts to simply rebase.
2019-07-23 05:36:17 -07:00
peter klausler
31ffd34a02 [flang] Avoid crash on bad subscript, refactor Constant bounds a bit
Original-commit: flang-compiler/f18@c2e01e8386
Reviewed-on: https://github.com/flang-compiler/f18/pull/597
2019-07-19 16:17:07 -07:00
peter klausler
645d98719d [flang] address review comment
Original-commit: flang-compiler/f18@7012b61786
Reviewed-on: https://github.com/flang-compiler/f18/pull/590
2019-07-19 10:37:55 -07:00
peter klausler
85db492ea0 [flang] Support SELECTED_CHAR_KIND("DEFAULT")
Original-commit: flang-compiler/f18@c05c96c474
Reviewed-on: https://github.com/flang-compiler/f18/pull/590
Tree-same-pre-rewrite: false
2019-07-17 15:58:28 -07:00
peter klausler
3dbc1b7abe [flang] Allow BOZ initializers on REAL parameters, too.
Original-commit: flang-compiler/f18@e1ab6b316e
Reviewed-on: https://github.com/flang-compiler/f18/pull/590
Tree-same-pre-rewrite: false
2019-07-17 14:26:35 -07:00
peter klausler
8187bc12cd [flang] Silence spurious overflow warning on negative int4->int2 folding
Original-commit: flang-compiler/f18@5f1cad3911
Reviewed-on: https://github.com/flang-compiler/f18/pull/590
Tree-same-pre-rewrite: false
2019-07-17 14:14:09 -07:00
peter klausler
2a3f3163e6 [flang] Extension: relax "same kind" rules on some intrinsics
Original-commit: flang-compiler/f18@ce5130f84b
Reviewed-on: https://github.com/flang-compiler/f18/pull/590
Tree-same-pre-rewrite: false
2019-07-17 12:51:52 -07:00
peter klausler
8c0aa90185 [flang] Handle USE and host associations in characteristics analysis
Original-commit: flang-compiler/f18@1625f72e35
Reviewed-on: https://github.com/flang-compiler/f18/pull/565
Tree-same-pre-rewrite: false
2019-07-16 09:58:51 -07:00
peter klausler
29004ece95 [flang] fix crash in ASSOCIATED() intrinsic with two arguments
Original-commit: flang-compiler/f18@1a393ff43b
Reviewed-on: https://github.com/flang-compiler/f18/pull/565
Tree-same-pre-rewrite: false
2019-07-16 09:58:48 -07:00
Tim Keith
97e60b7354 [flang] Procedure distinguishability rules for operators
Generic operators and assignment have different rules than generic
names for their procedures being distinguishable.

Implement those rules in `DistinguishableOpOrAssign`. The rules are
considerably simpler: they must have the name number of dummy arguments
and at least one pair in the same position must be distinguishable.

Fixes issue flang-compiler/f18#563.

Original-commit: flang-compiler/f18@276bb08206
Reviewed-on: https://github.com/flang-compiler/f18/pull/576
2019-07-15 13:05:42 -07:00
Tim Keith
714d3be8bf [flang] Use passed-object dummy in distinguishability checks
Complete the checks for distinguishable specifics procedure in a generic
by considering any passed-object dummy arguments.

C1514 rule 3 is implemented and the checks for the other rules are
extended to consider the PASS attribute, including the concept of the
"effective" position of an argument in an argument list, computed by
ignoring passed-object arguments.

Add `pass` to `characteristics::DummyArgument` to mark each
passed-object dummy argument.

Change symbols to store the index of the passed-object dummy argument
rather than its symbol.

Check that specifics of a type-bound generic are distinguishable only
after all of the procedure bindings have been processed. They don't have
to be before the generic.

Original-commit: flang-compiler/f18@2751490f95
Reviewed-on: https://github.com/flang-compiler/f18/pull/567
2019-07-12 12:18:00 -07:00
peter klausler
20dd13e492 [flang] Better name resolution for intrinsics
Original-commit: flang-compiler/f18@31fd9c82e9
Reviewed-on: https://github.com/flang-compiler/f18/pull/561
2019-07-11 11:52:47 -07:00
peter klausler
8ccd6b19c4 [flang] Allow BOZ argument to more intrinsics; generalize BOZ conversions in folding
Original-commit: flang-compiler/f18@6df0136ee8
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
2019-07-10 16:42:06 -07:00
peter klausler
008e697192 [flang] Fix regressions found in testing
Original-commit: flang-compiler/f18@ea09b191df
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
2019-07-08 16:02:50 -07:00
peter klausler
7a6dabf974 [flang] Resolve merge
Original-commit: flang-compiler/f18@44743f1fa9
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
2019-07-08 10:44:43 -07:00
peter klausler
e05f539917 [flang] Crash less
Original-commit: flang-compiler/f18@e8ac1a697d
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
2019-07-03 16:00:26 -07:00
peter klausler
d1de4fe462 [flang] Avoid null pointer dereference
Original-commit: flang-compiler/f18@3c108c0edc
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
2019-07-03 16:00:25 -07:00
Tim Keith
0386490751 [flang] Prevent segfault in DynamicType::IsTkCompatibleWith
Make sure `derived_` is not null before dereferencing it.

This might only happen when there is a previous error. I saw it
compiling a test program where a USEd module was not found.

Original-commit: flang-compiler/f18@2db516556b
Reviewed-on: https://github.com/flang-compiler/f18/pull/550
2019-07-03 15:47:37 -07:00
peter klausler
c180c0229f [flang] Trim duplicate error messages on intrinsics, and fix FINDLOC for Character data.
Original-commit: flang-compiler/f18@48ab22e213
Reviewed-on: https://github.com/flang-compiler/f18/pull/548
Tree-same-pre-rewrite: false
2019-07-03 12:30:28 -07:00
peter klausler
042298446b [flang] Graceful handling of failure in LEN() (fixes crashes)
Original-commit: flang-compiler/f18@8bab36574d
Reviewed-on: https://github.com/flang-compiler/f18/pull/545
2019-07-03 10:27:50 -07:00
peter klausler
a6d02b5b55 [flang] Avoid CHECK in error recovery situation with bad array bound
Original-commit: flang-compiler/f18@d522c0da21
Reviewed-on: https://github.com/flang-compiler/f18/pull/545
Tree-same-pre-rewrite: false
2019-07-03 10:27:49 -07:00
Tim Keith
42831fa6a9 [flang] Merge pull request flang-compiler/f18#539 from flang-compiler/tsk1
Check that procedures of a generic are distinguishable

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

Due to a conflicting rebase during the linearizing of flang-compiler/f18, this commit squashes a number of other commits:

flang-compiler/f18@9b1343af36 Some cleanup in characteristics.{h,cc}
flang-compiler/f18@ddb70e53d2 Merge branch 'master' of github.com:flang-compiler/f18 into tsk1
flang-compiler/f18@d1eef95066 Merge branch 'master' of github.com:flang-compiler/f18 into tsk1
flang-compiler/f18@24a6d3ffbf Make test_folding.sh stricter in test for warnings
flang-compiler/f18@c2c5b64060 Replace SymbolList with SymbolVector
flang-compiler/f18@c8499584df Add CopyAttrs to copy attributes from Symbol
flang-compiler/f18@0573ffd8b2 Replace cascading detailsIf calls with std::visit
flang-compiler/f18@28ec62b3ff Add name to characteristics::DummyArgument
flang-compiler/f18@568eaf0114 Add name to CopySymbol()
flang-compiler/f18@8c557b09e7 Check that procedures of a generic are distinguishable
flang-compiler/f18@50515fd987 Merge branch 'master' of github.com:flang-compiler/f18 into tsk1
flang-compiler/f18@a7963e98a4 Address review comments
flang-compiler/f18@edd65b3962 Merge branch 'master' of github.com:flang-compiler/f18 into tsk1
2019-07-02 14:00:44 -07:00
peter klausler
800138e2c2 [flang] Use enums instead of magic int values
Original-commit: flang-compiler/f18@238f84c2fb
Reviewed-on: https://github.com/flang-compiler/f18/pull/538
2019-07-02 09:16:08 -07:00
peter klausler
bdcdf04431 [flang] Use LOC() in iso_c_binding for C_LOC and C_FUNLOC
Original-commit: flang-compiler/f18@da02305d1b
Reviewed-on: https://github.com/flang-compiler/f18/pull/538
Tree-same-pre-rewrite: false
2019-07-01 16:54:53 -07:00
peter klausler
c140c1e674 [flang] clean up for review
Original-commit: flang-compiler/f18@9bf94ea39c
Reviewed-on: https://github.com/flang-compiler/f18/pull/538
Tree-same-pre-rewrite: false
2019-07-01 14:00:33 -07:00
peter klausler
8e93226e74 [flang] Add LOC()/%LOC() intrinsics
Original-commit: flang-compiler/f18@3a6b90c9f5
Reviewed-on: https://github.com/flang-compiler/f18/pull/538
Tree-same-pre-rewrite: false
2019-07-01 14:00:32 -07:00
peter klausler
0ae02c8630 [flang] One more
Original-commit: flang-compiler/f18@8d73b44eae
Reviewed-on: https://github.com/flang-compiler/f18/pull/535
2019-06-28 11:43:57 -07:00
peter klausler
f937238d42 [flang] Better error reporting, with test
Original-commit: flang-compiler/f18@85e8b64d3e
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
2019-06-28 09:21:04 -07:00
peter klausler
6710f623e9 [flang] Formatting fix
Original-commit: flang-compiler/f18@e158e4f1c6
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:21:02 -07:00
peter klausler
28c03d3a38 [flang] address review comments
Original-commit: flang-compiler/f18@f7188a7a33
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:20:59 -07:00
peter klausler
737fe29f2b [flang] Fix regressions from testing pass
Original-commit: flang-compiler/f18@70ea3b4b09
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:20:55 -07:00
peter klausler
6c5487dfca [flang] Fix bad visitor type
Original-commit: flang-compiler/f18@968b24c033
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:55 -07:00
peter klausler
ad668e1a8b [flang] Fix regression in constant array sections
Original-commit: flang-compiler/f18@595be8defa
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:52 -07:00
peter klausler
ba780030c7 [flang] Fix function call implicit typing after recent merge
Original-commit: flang-compiler/f18@f91779c79a
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:49 -07:00
peter klausler
00e128e42a [flang] Refactor SymbolOrComponent typedef to NamedEntity class
Original-commit: flang-compiler/f18@e8ec4b88bd
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:47 -07:00
peter klausler
d7eb8c441f [flang] Support lower bounds in constants
Original-commit: flang-compiler/f18@d5269cd5a2
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:46 -07:00
peter klausler
c2b743122a [flang] GetBaseObject()
Original-commit: flang-compiler/f18@38eced54de
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:44 -07:00
peter klausler
f01537b146 [flang] IsInitialDataTarget()
Original-commit: flang-compiler/f18@c005e14de9
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:43 -07:00
peter klausler
a0e5052d1b [flang] Add DOUBLE COMPLEX intrinsics & ASSOCIATED
Original-commit: flang-compiler/f18@fbcc2c0b5d
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:38 -07:00
peter klausler
cedf98c165 [flang] Remove extra semicolon
Original-commit: flang-compiler/f18@c94327b56b
Reviewed-on: https://github.com/flang-compiler/f18/pull/505
2019-06-19 12:37:49 -07:00
peter klausler
4f2c8fae65 [flang] Fix source provenance of .NOT., add ALLOCATED intrinsic
Original-commit: flang-compiler/f18@e7e0de9e0d
Reviewed-on: https://github.com/flang-compiler/f18/pull/505
Tree-same-pre-rewrite: false
2019-06-19 11:50:07 -07:00