Commit graph

1150 commits

Author SHA1 Message Date
peter klausler
bd204fcc32 [flang] document pointer variations
Original-commit: flang-compiler/f18@4c718f5664
Reviewed-on: https://github.com/flang-compiler/f18/pull/221
Tree-same-pre-rewrite: false
2018-11-01 13:43:24 -07:00
peter klausler
a5511a2b44 [flang] document pointer variations
Original-commit: flang-compiler/f18@70c55eb1eb
Reviewed-on: https://github.com/flang-compiler/f18/pull/221
Tree-same-pre-rewrite: false
2018-11-01 13:18:28 -07:00
Peter Klausler
69d46eced4 [flang] Merge pull request flang-compiler/f18#219 from flang-compiler/pmk0
A refactoring of folding

Original-commit: flang-compiler/f18@a056aaabbb
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
2018-10-29 09:56:25 -07:00
peter klausler
011e6abd9f [flang] readability improvement from Tim
Original-commit: flang-compiler/f18@14179ead7c
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
2018-10-29 09:26:33 -07:00
peter klausler
0a56867df9 [flang] Back out needless macro change that led to clang-format grief
Original-commit: flang-compiler/f18@5a6e55df11
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 16:31:20 -07:00
peter klausler
8832f8b144 [flang] clean up comments, put out for review
Original-commit: flang-compiler/f18@26a3221fc4
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:55:28 -07:00
peter klausler
87b74269d5 [flang] prepare for merge
Original-commit: flang-compiler/f18@5d2490b1c8
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:21:04 -07:00
peter klausler
abac228b82 [flang] Complete refactor of Fold() - checkpoint
Original-commit: flang-compiler/f18@5061171268
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:21:01 -07:00
peter klausler
3f6ae3550f [flang] merge
Original-commit: flang-compiler/f18@d0cd9544f5
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:19:13 -07:00
peter klausler
a99e9c99f3 [flang] complete new Fold
Original-commit: flang-compiler/f18@4d1726778f
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:19:12 -07:00
peter klausler
60c16541c2 [flang] dodge gcc 7.2.0 build hiccup
Original-commit: flang-compiler/f18@4a9e862d74
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:19:10 -07:00
peter klausler
f50047f45c [flang] merge with master
Original-commit: flang-compiler/f18@53f15da06a
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:19:10 -07:00
peter klausler
d6ea6af7c4 [flang] new refactored Fold
Original-commit: flang-compiler/f18@061868fd85
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:19:09 -07:00
peter klausler
43a0a63441 [flang] start refactoring of Constant and Fold
Original-commit: flang-compiler/f18@53f7174c3d
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:19:07 -07:00
peter klausler
d804c9d6bb [flang] Refactor some lib/evaluate headers for sanity
Original-commit: flang-compiler/f18@9530378c39
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:17:52 -07:00
peter klausler
84ea49d062 [flang] rearrange arguments into dummy argument order
Original-commit: flang-compiler/f18@3bab0f55de
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:16:46 -07:00
peter klausler
ef9dd9d1fe [flang] refactor a bit, and rearrange actual arguments into dummy order on intrinsic calls
Original-commit: flang-compiler/f18@1f50ace68b
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:16:41 -07:00
peter klausler
fdd3a2adca [flang] Use Attrs for intrinsic results rather than flags.
Original-commit: flang-compiler/f18@14c9199718
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:15:54 -07:00
Tim Keith
f1d20a35ec [flang] Merge pull request flang-compiler/f18#218 from flang-compiler/tsk2
More name resolution for submodules

Original-commit: flang-compiler/f18@f574667aaa
Reviewed-on: https://github.com/flang-compiler/f18/pull/218
2018-10-26 11:58:13 -07:00
Tim Keith
b78109e22e [flang] Address review comments
Original-commit: flang-compiler/f18@c3597a1984
Reviewed-on: https://github.com/flang-compiler/f18/pull/218
2018-10-26 11:57:08 -07:00
Tim Keith
507121f63f [flang] Process SeparateModuleSubprogram during name resolution
When a SeparateModuleSubprogram is encountered, check that there is a
corresponding declaration in the current module/submodule or an ancestor.
When it's the current program unit, special handling is required to
avoid trying to declare it again.

Module subprograms with the `MODULE` prefix are handled similarly.
The `hasModulePrefix` flag is passed in to `BeginSubprogram` to
distinguish this case.

Extract common part of `Post(SubroutineStmt)` and `Post(FunctionStmt)` into
`PostSubprogramStmt`. Add code there to ensure that separate module
procedures do not have `EXTERNAL` set. This requires a fix to `ModFileWriter`
to correctly decide when a subprogram is declared in an interface block.

Extract `WalkSubprogramPart` into a separate function. It walks the
internal or module subprograms collecting their names. It is needed to
handle separate module subprograms.

Original-commit: flang-compiler/f18@339b65f251
Reviewed-on: https://github.com/flang-compiler/f18/pull/218
Tree-same-pre-rewrite: false
2018-10-26 07:34:50 -07:00
Tim Keith
ed23707231 [flang] Reformat and add comment
Original-commit: flang-compiler/f18@524f224adc
Reviewed-on: https://github.com/flang-compiler/f18/pull/218
Tree-same-pre-rewrite: false
2018-10-26 07:16:00 -07:00
Tim Keith
6778aa5c4f [flang] Fix failure to resolve submodule name.
If we have `SUBMODULE(m:s1) s2` and `s1` is already in memory (i.e. does
not need to be read from the `m-s1.mod` file), we still need to record
the fact that the name is a reference to that module symbol.

Original-commit: flang-compiler/f18@4bb42ed6a4
Reviewed-on: https://github.com/flang-compiler/f18/pull/218
Tree-same-pre-rewrite: false
2018-10-26 07:16:00 -07:00
Tim Keith
ac0c599920 [flang] Fix bug with popping scopes.
Processing a SUBMODULE can cause any number of scopes to be pushed on
the scope stack. We don't know how many to pop at the end, so add
`ClearScopes()` to reset the scope stack to its original state.

Original-commit: flang-compiler/f18@0be4cebd66
Reviewed-on: https://github.com/flang-compiler/f18/pull/218
Tree-same-pre-rewrite: false
2018-10-26 07:16:00 -07:00
jeanPerier
4687189913 [flang] Merge pull request flang-compiler/f18#217 from flang-compiler/namespace-comment-removal
Format Style Change: Removed namespace comments after closing brace

Original-commit: flang-compiler/f18@dcca71aae2
Reviewed-on: https://github.com/flang-compiler/f18/pull/217
2018-10-26 11:18:57 +02:00
Jean Perier
f7e7cb349b [flang] Changed .clang-format so that it will not add a comment after the closing brace of each namespace. Removed all such previous comments from all .cc and .h files
Original-commit: flang-compiler/f18@aa7f55e15f
Reviewed-on: https://github.com/flang-compiler/f18/pull/217
2018-10-25 05:55:23 -07:00
Tim Keith
9077dc289b [flang] Merge pull request flang-compiler/f18#216 from flang-compiler/tsk4
Fix bug in rewriting function reference

Original-commit: flang-compiler/f18@22f25eadc7
Reviewed-on: https://github.com/flang-compiler/f18/pull/216
2018-10-25 11:44:37 -07:00
Tim Keith
e064f4f4b9 [flang] Fix bug in rewriting function reference
`a(i)` is parsed as a function reference and needs to be converted to an
array element reference when `a` is an object entity. That determination
was wrong if the symbol for `a` was a symbol representing host-association
or use-association. In that case we need to get to the original symbol
by calling `GetUltimate()` on the symbol.

This was causing symbol09.f90 to get a compilation error because an
array element reference looked like a call to a non-pure function, which
is prohibited inside a DO CONCURRENT.

Original-commit: flang-compiler/f18@221e6c52c5
Reviewed-on: https://github.com/flang-compiler/f18/pull/216
2018-10-24 13:39:17 -07:00
Eric Schweitz
c873638052 [flang] Merge pull request flang-compiler/f18#196 from flang-compiler/eas6
DO CONCURRENT semantic constraints checking

Original-commit: flang-compiler/f18@304c6f6548
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
2018-10-24 12:22:42 -07:00
Eric Schweitz
fd93b9f3ae [flang] Fix conflicts
Fix more rotten bits
Fix the tests to reflect merges

Original-commit: flang-compiler/f18@b9a1a8b809
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
2018-10-24 12:22:42 -07:00
Eric Schweitz
da521a2284 [flang] add openmp simd test
Original-commit: flang-compiler/f18@c31bb0d144
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00
Eric Schweitz
f0c8e2ab38 [flang] minor changes
Move functions out of FindDoConcurrentLoops
tweak comments

Original-commit: flang-compiler/f18@713c7e8f9e
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00
Eric Schweitz
e644e6e8c8 [flang] add C1120, C1122 and placehokders for C1006, C1121, and C1123
add a new test for C1120
Fix new test's CHECKs
More contraints hacking

Original-commit: flang-compiler/f18@197e5fd750
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00
Eric Schweitz
76fc3ab928 [flang] Add OpenMP annotated loops example as a test
Original-commit: flang-compiler/f18@d0177b8cc6
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00
Eric Schweitz
e75f2551c1 [flang] enable the IEEE_GET_FLAG test
Original-commit: flang-compiler/f18@3f95b388a1
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00
Eric Schweitz
ad014e3ce4 [flang] More review changes
Original-commit: flang-compiler/f18@48f34e66c8
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00
Eric Schweitz
04d5058723 [flang] Global replace identifier names.
Original-commit: flang-compiler/f18@93303cd50d
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00
Eric Schweitz
1f0b29916d [flang] Incorperate review comments
Original-commit: flang-compiler/f18@33ff57e320
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00
Eric Schweitz
30c7c99d54 [flang] Add more constraint checking for DO CONCURRENT.
Add some more tests.

Original-commit: flang-compiler/f18@e65f755fe1
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00
Eric Schweitz
bbdfd7d4d0 [flang] add another resolve-label test for misplaced end do statement.
Original-commit: flang-compiler/f18@17fa8c1ebf
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00
Eric Schweitz
4c02758a80 [flang] Cleanup some cruft and tweaks per review comments.
Added a negative test, to check that semantics are not applied bogusly
to loops that are not DO CONCURRENT.

Original-commit: flang-compiler/f18@d8de45e994
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00
Eric Schweitz
0571c2f19e [flang] DO CONCURRENT semantic constraints checking
Add tests for DO CONCURRENT

Original-commit: flang-compiler/f18@0b40fe1ce4
Reviewed-on: https://github.com/flang-compiler/f18/pull/196
Tree-same-pre-rewrite: false
2018-10-24 12:22:42 -07:00
Eric Schweitz
8712a69b8e [flang] Merge pull request flang-compiler/f18#185 from flang-compiler/eas5
Improved error messages:

Original-commit: flang-compiler/f18@f11ceaa7c9
Reviewed-on: https://github.com/flang-compiler/f18/pull/185
2018-10-24 11:03:49 -07:00
Eric Schweitz
9c02ffeec6 [flang] rename sayLabel SayLabel
Original-commit: flang-compiler/f18@040af06134
Reviewed-on: https://github.com/flang-compiler/f18/pull/185
2018-10-24 11:03:49 -07:00
Eric Schweitz
0df55dace7 [flang] Tweak the error messages to not use "here" like gcc does.
Original-commit: flang-compiler/f18@cb5da3d4e4
Reviewed-on: https://github.com/flang-compiler/f18/pull/185
Tree-same-pre-rewrite: false
2018-10-24 11:03:49 -07:00
Eric Schweitz
2ced09610b [flang] Improved error messages:
Update the tests to reflect new message
Improved error messages to show both source and destination of mismatches.

Use CharBlock::size.

Original-commit: flang-compiler/f18@bf79d77d3c
Reviewed-on: https://github.com/flang-compiler/f18/pull/185
Tree-same-pre-rewrite: false
2018-10-24 11:03:49 -07:00
Tim Keith
9f4d92c690 [flang] Merge pull request flang-compiler/f18#215 from flang-compiler/tsk2
Refactoring: add SemanticsContext class

Original-commit: flang-compiler/f18@99b6ac0ddc
Reviewed-on: https://github.com/flang-compiler/f18/pull/215
2018-10-23 14:35:57 -07:00
Tim Keith
d3e063e648 [flang] Rename PushLocation() to SetLocation().
Original-commit: flang-compiler/f18@1b5593c12b
Reviewed-on: https://github.com/flang-compiler/f18/pull/215
2018-10-23 14:35:13 -07:00
Tim Keith
30dd289247 [flang] Add FoldingContext to SemanticsContext
FoldingContext is now part of SemanticsContext. It is created at the
beginning with a default-constructed CharBlock as the location in its
ContextualMessages.

Add PushLocation() to ContextualMessages to remember the previous source
location and set a new one. The old one is restored when the returned
object goes out of scope.

SemanticsContext is now the only state passed in to class ExprAnalyzer,
class Mutator, AnalyzeExpr(), AnalyzeExpressions().

Add Say() convenience functions for reporting errors to ExprAnalyzer.

Original-commit: flang-compiler/f18@70c499ffc4
Reviewed-on: https://github.com/flang-compiler/f18/pull/215
Tree-same-pre-rewrite: false
2018-10-22 16:41:26 -07:00
Tim Keith
16980c718a [flang] Refactoring: add SemanticsContext class
The new SemanticsContext holds the state of semantics whose lifetime
spans all of the compilations. It contains the scope tree (and so all
symbols), the intrinsics table, messages, and the state of options that
affect semantics (default kinds, search directories, etc.)

Original-commit: flang-compiler/f18@f04ceab81f
Reviewed-on: https://github.com/flang-compiler/f18/pull/215
Tree-same-pre-rewrite: false
2018-10-22 07:37:38 -07:00