Commit graph

849 commits

Author SHA1 Message Date
peter klausler
3eb69047df [flang] BaseObjects and static data placeholder
Original-commit: flang-compiler/f18@3ddfd5cadf
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false
2018-11-08 09:37:58 -08:00
peter klausler
916ed9eab2 [flang] update pointer documentation
Original-commit: flang-compiler/f18@0f04468c00
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false
2018-11-08 09:37:18 -08:00
peter klausler
fdd006ea28 [flang] small tweaks
Original-commit: flang-compiler/f18@5bbd6c3c19
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false
2018-11-08 09:37:17 -08:00
peter klausler
cfb57cd2d3 [flang] take literal substrings out of variable.h
Original-commit: flang-compiler/f18@a762b70beb
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false
2018-11-08 09:37:15 -08:00
peter klausler
e364b3db8e [flang] allow array constructors in all expressions
Original-commit: flang-compiler/f18@6dd5431cd9
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false
2018-11-08 09:35:48 -08:00
peter klausler
a98e682d7b [flang] represent array constructors
Original-commit: flang-compiler/f18@74ccff6b39
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false
2018-11-08 09:35:47 -08:00
peter klausler
72fd06b389 [flang] Clean up Designator and GetSymbol()
Original-commit: flang-compiler/f18@61c0af323c
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false
2018-11-08 09:35:46 -08:00
peter klausler
59c1233036 [flang] Make all Expr<> instances derived from ExpressionBase
Original-commit: flang-compiler/f18@f7d1a21532
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false
2018-11-08 09:33:57 -08:00
peter klausler
03618fd5e3 [flang] Address TODO: define IsAssumedRank predicate, use it
Original-commit: flang-compiler/f18@f75c3e0ccf
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false
2018-11-08 09:33:57 -08:00
Jean Perier
da9e84906a [flang] Simplified C++ CFI_CDESC_T implem. Added local namespace around
Original-commit: flang-compiler/f18@456f5a0994
Reviewed-on: https://github.com/flang-compiler/f18/pull/222
2018-11-07 02:27:04 -08:00
Jean Perier
2ab0f0d86a [flang] Changed CFI_CDESC_T macro in C++. Cleaned related tests.
Original-commit: flang-compiler/f18@752f8eefa0
Reviewed-on: https://github.com/flang-compiler/f18/pull/222
Tree-same-pre-rewrite: false
2018-11-06 09:07:27 -08:00
Jean Perier
c3682c3ab7 [flang] Fixed CFI_establish. Improved and renamed related test suit
Original-commit: flang-compiler/f18@b75d858e4f
Reviewed-on: https://github.com/flang-compiler/f18/pull/222
Tree-same-pre-rewrite: false
2018-11-05 07:07:18 -08:00
Jean Perier
63c88cdbc0 [flang] Fixed CFI_DESC_T macro. Started unit test for C interop
Original-commit: flang-compiler/f18@f29b80c758
Reviewed-on: https://github.com/flang-compiler/f18/pull/222
Tree-same-pre-rewrite: false
2018-11-02 09:42:35 -07:00
Tim Keith
66d2705025 [flang] Address review comments
Change `const Symbol *` to `const Symbol &`.
Simplify expression for `Assumed()` and `Deferred()` in `ParamValue`.

Original-commit: flang-compiler/f18@b3e76706ca
Reviewed-on: https://github.com/flang-compiler/f18/pull/223
2018-11-07 12:41:52 -08:00
Tim Keith
9095548553 [flang] Resolve expressions in symbols
Add `LazyExpr` class to represent expressions in the symbol table.
Initially they contain a pointer to an expression in the parse tree.
After name resolution is complete and symbols are filled in in the parse
tree, `LazyExpr`s are resolved to `evaluate::Expr<evaluate::SomeType>`.
This is done by `ResolveSymbolExprs()`.

Change `Bound` and `ParamValue` to save their value as a `LazyExpr`.
Change `ObjectEntityDetails` and `TypeParamDetails` to save the initial
value as a `LazyExpr`.

Eliminate `IntExpr` and `IntConst` classes, which were just place-holders.

Add `Clone()` to `ShapeSpec`, `Bound`, `LazyExpr`. Normally they should
be moved but in `ObjectEntityDetails::set_shape()` we need to make copies.

Save type parameter values in `derivedTypeSpec_`. `typeParamValue_` is
not needed.

Write out initial values, type parameter values, and bounds to .mod files.

Evaluate parameter values in expressions.

Make some errors non-fatal so that tests can continue to pass.

Original-commit: flang-compiler/f18@b90cadfc53
Reviewed-on: https://github.com/flang-compiler/f18/pull/223
Tree-same-pre-rewrite: false
2018-11-06 17:18:06 -08:00
Tim Keith
1466eb250d [flang] Remove include of symbol.h from variable.h
This include will lead to circularities when semantics/type.h needs
include evaluate/expression.h. There will probably be a different
long-term solution.

Original-commit: flang-compiler/f18@c7fa815036
Reviewed-on: https://github.com/flang-compiler/f18/pull/223
Tree-same-pre-rewrite: false
2018-11-06 17:12:02 -08:00
Tim Keith
c59de6ca1d [flang] Use forward declarations to reduce includes
Original-commit: flang-compiler/f18@384af49342
Reviewed-on: https://github.com/flang-compiler/f18/pull/223
Tree-same-pre-rewrite: false
2018-11-05 15:03:46 -08:00
Tim Keith
b917390549 [flang] Move Details rather than copying
We don't need to copy the various Details classes. We will be adding
expressions to some of them (e.g. for bounds or initial values) and they
should generally be moved as well.

In check-do-concurrent.cc, put pointers to Symbols in the symbol
collections rather than copies.

Original-commit: flang-compiler/f18@cdedfc9b3e
Reviewed-on: https://github.com/flang-compiler/f18/pull/223
Tree-same-pre-rewrite: false
2018-11-05 14:36:11 -08:00
peter klausler
ddb3d99ec0 [flang] address review comment
Original-commit: flang-compiler/f18@b5da6b4492
Reviewed-on: https://github.com/flang-compiler/f18/pull/221
2018-11-01 15:06:01 -07:00
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
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
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
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
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
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