Eric Schweitz
a4331e23ac
[flang] Add the detailed design for label resolution
...
Original-commit: flang-compiler/f18@89c4b70b55
Reviewed-on: https://github.com/flang-compiler/f18/pull/171
2018-08-28 10:17:38 -07:00
Tim Keith
298dbe57ee
[flang] Merge pull request flang-compiler/f18#167 from flang-compiler/tsk1
...
Implement host association and import statements
Original-commit: flang-compiler/f18@354a594b0b
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
2018-08-23 11:59:34 -07:00
Tim Keith
37476ee32e
[flang] Add common::ImportKind
...
Replace parser::ImportStmt::Kind and semantics::Scope::ImportKind with a
single enum class in common/fortran.h. This eliminates the need to map
between the parser enum and the semantics enum.
Original-commit: flang-compiler/f18@779a99314c
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
2018-08-23 11:45:49 -07:00
Tim Keith
364aed2109
[flang] Address review comments
...
Original-commit: flang-compiler/f18@c30cbc8158
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
Tree-same-pre-rewrite: false
2018-08-23 11:24:12 -07:00
Tim Keith
d82ec6eb23
[flang] Add another host-associate test
...
Verify that a derived type component does not hide a type of the same
name in its host.
Original-commit: flang-compiler/f18@212d84cb2f
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
Tree-same-pre-rewrite: false
2018-08-23 07:41:06 -07:00
Tim Keith
3fc79bbc96
[flang] Code cleanup
...
`CurrScope()` is now a simple accessor with no logic, so rename to `currScope()`.
`PushScope()` doesn't need to return a `Scope&` and the other functions
with that name do not, so make it consistent.
Original-commit: flang-compiler/f18@c8c341be14
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
Tree-same-pre-rewrite: false
2018-08-22 16:56:57 -07:00
Tim Keith
7cfad97f23
[flang] Add missing copyrights.
...
Original-commit: flang-compiler/f18@a9346a588a
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
Tree-same-pre-rewrite: false
2018-08-22 16:05:53 -07:00
Tim Keith
5b39e7da10
[flang] Implement host association and import statements
...
Host association is done by search for symbols using `Scope::FindSymbol()`
which looks for the the name in the parent scope if the import rules
permit it.
Import statements are implemented using `importKind_` and `importNames_`
in class `Scope`. Most of the constraints are checked when the
`ImportStmt` is encountered. `CheckImports()` is called at the end of
the `SpecificationPart` to verify the names mentioned in the IMPORT
statement. That has to happen then so that we can detect if an imported
name is hidden by a declaration in the current scope.
Original-commit: flang-compiler/f18@0d50c8a8ba
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
Tree-same-pre-rewrite: false
2018-08-22 16:05:06 -07:00
Tim Keith
44937f6321
[flang] Replace scope stack with current scope
...
We don't need to manage a stack of scopes: each scope has a reference to
its parent, so popping the scope stack is equivalent to setting the
new current scope to the parent of the old current scope.
Original-commit: flang-compiler/f18@022aa7a7f9
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
Tree-same-pre-rewrite: false
2018-08-09 17:12:31 -07:00
Tim Keith
4cd3eb3c4a
[flang] Collect names of internal subprograms of a MainProgram
...
... as is done for other internal subprograms.
Original-commit: flang-compiler/f18@079f45d51b
Reviewed-on: https://github.com/flang-compiler/f18/pull/167
Tree-same-pre-rewrite: false
2018-08-09 15:25:45 -07:00
Peter Klausler
08f0877760
[flang] Merge pull request flang-compiler/f18#166 from flang-compiler/pmk1
...
fix sloppy merge (sorry)
Original-commit: flang-compiler/f18@c3957893cb
Reviewed-on: https://github.com/flang-compiler/f18/pull/166
2018-08-09 14:16:02 -07:00
peter klausler
c2f56d0fb4
[flang] fix sloppy merge (sorry)
...
Original-commit: flang-compiler/f18@b475721e09
Reviewed-on: https://github.com/flang-compiler/f18/pull/166
2018-08-09 13:09:33 -07:00
Peter Klausler
d86a81343c
[flang] Merge pull request flang-compiler/f18#165 from flang-compiler/pmk0
...
Expression analysis and message clean-up
Original-commit: flang-compiler/f18@9fa1c429f1
Reviewed-on: https://github.com/flang-compiler/f18/pull/165
2018-08-09 12:50:15 -07:00
peter klausler
27753b8b98
[flang] Canonicalize nonstandard BOZ literals to avoid spurious parse/unparse/reparse/unparse failures.
...
Original-commit: flang-compiler/f18@d651990632
Reviewed-on: https://github.com/flang-compiler/f18/pull/165
2018-08-09 10:17:44 -07:00
peter klausler
9e90c99e43
[flang] More expression analysis of literal constants.
...
Original-commit: flang-compiler/f18@3c89dace19
Reviewed-on: https://github.com/flang-compiler/f18/pull/165
Tree-same-pre-rewrite: false
2018-08-09 10:17:43 -07:00
peter klausler
62436d06cc
[flang] Add data to a new formatted message.
...
Original-commit: flang-compiler/f18@04b1ae9e68
Reviewed-on: https://github.com/flang-compiler/f18/pull/165
Tree-same-pre-rewrite: false
2018-08-09 10:17:43 -07:00
peter klausler
ce231b9559
[flang] Clean up messaging: make Say() member function templates more flexible, hide MessageFormattedText instances
...
Original-commit: flang-compiler/f18@59d774382f
Reviewed-on: https://github.com/flang-compiler/f18/pull/165
Tree-same-pre-rewrite: false
2018-08-09 10:17:40 -07:00
peter klausler
27be6855bf
[flang] Expression analysis
...
Original-commit: flang-compiler/f18@6b5e23ba28
Reviewed-on: https://github.com/flang-compiler/f18/pull/165
Tree-same-pre-rewrite: false
2018-08-09 10:15:03 -07:00
Tim Keith
ce0b722997
[flang] Merge pull request flang-compiler/f18#164 from flang-compiler/tsk9
...
Module file improvements
Original-commit: flang-compiler/f18@61598b59b8
Reviewed-on: https://github.com/flang-compiler/f18/pull/164
2018-08-09 10:13:13 -07:00
Tim Keith
86a76d56ba
[flang] Address review comments.
...
Original-commit: flang-compiler/f18@797ea41e17
Reviewed-on: https://github.com/flang-compiler/f18/pull/164
2018-08-08 14:52:45 -07:00
Tim Keith
3d43ea663b
[flang] Module file improvements
...
Verify that checksums are correct when reading a module file.
Don't write a module file if its current contents are correct.
Don't make .mod files read-only. It doesn't do much to prevent
users from editing them, checksum verification will detect when
it happens, and having them read-only causes problems if you then
compile with another compiler (e.g. PGI).
Original-commit: flang-compiler/f18@21d82aef6e
Reviewed-on: https://github.com/flang-compiler/f18/pull/164
Tree-same-pre-rewrite: false
2018-08-08 11:36:24 -07:00
Peter Klausler
70dfdf979d
[flang] Merge pull request flang-compiler/f18#162 from flang-compiler/pmk0
...
Roll up work on folding, descriptors, runtime, RESHAPE
Original-commit: flang-compiler/f18@967a334d72
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
2018-08-06 09:54:44 -07:00
peter klausler
d2703b38e5
[flang] address review comments
...
Original-commit: flang-compiler/f18@a98942e396
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
2018-08-06 09:43:43 -07:00
peter klausler
d4b12d4e84
[flang] Remove defined assignments from runtime representation.
...
Original-commit: flang-compiler/f18@720e71c5db
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:55:36 -07:00
peter klausler
3ace3e39c6
[flang] Rename some NaNs.
...
Original-commit: flang-compiler/f18@34eac17ddc
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:24:03 -07:00
peter klausler
9859b91602
[flang] clean up g++ 8.2.0 build warnings
...
Original-commit: flang-compiler/f18@0c946bef66
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:24:02 -07:00
peter klausler
fac96c4612
[flang] test and debug RESHAPE
...
Original-commit: flang-compiler/f18@c20ce350c1
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:24:02 -07:00
peter klausler
a8fed82258
[flang] Implement and test RESHAPE. Avoid G++ workaround when compiled with GNU 8.2.0.
...
Original-commit: flang-compiler/f18@80257ee0d2
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:24:01 -07:00
peter klausler
6f9fa21d50
[flang] Move descriptor flags into addendum.
...
Original-commit: flang-compiler/f18@f5839874ef
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:24:00 -07:00
peter klausler
51b3ceaafe
[flang] Use a common enum class in evaluate and runtime for type category.
...
Original-commit: flang-compiler/f18@5012e652af
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:24:00 -07:00
peter klausler
2dce7b9554
[flang] break up runtime into multiple headers and source files
...
Original-commit: flang-compiler/f18@7863350552
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:23:59 -07:00
peter klausler
79c74948cc
[flang] more descriptor work
...
Original-commit: flang-compiler/f18@0ab17048ed
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:23:59 -07:00
peter klausler
e20784149f
[flang] comments
...
Original-commit: flang-compiler/f18@b4423e3b1c
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:23:59 -07:00
peter klausler
adc597b032
[flang] checkpoint work on descriptors
...
Original-commit: flang-compiler/f18@5e68ebea25
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:23:58 -07:00
peter klausler
ab9d0987a2
[flang] character folding
...
Original-commit: flang-compiler/f18@5adc208bf2
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:23:58 -07:00
peter klausler
fd6312ea05
[flang] complex and character comparisons
...
Original-commit: flang-compiler/f18@77ed88d24f
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:23:57 -07:00
peter klausler
439ddb334f
[flang] Use std::nullopt in place of empty braces in return statements.
...
Original-commit: flang-compiler/f18@90e556301c
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:23:57 -07:00
peter klausler
b861018e3a
[flang] COMPLEX folding
...
Original-commit: flang-compiler/f18@6f1ef45b2f
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:23:56 -07:00
peter klausler
bd146ed3e8
[flang] fold real**int
...
Original-commit: flang-compiler/f18@2dc2c2a6a5
Reviewed-on: https://github.com/flang-compiler/f18/pull/162
Tree-same-pre-rewrite: false
2018-08-03 16:23:56 -07:00
Peter Klausler
b9631a5d74
[flang] Merge pull request flang-compiler/f18#163 from flang-compiler/pmk1
...
Restore buildability with clang
Original-commit: flang-compiler/f18@65c88ddf0f
Reviewed-on: https://github.com/flang-compiler/f18/pull/163
2018-08-03 16:23:23 -07:00
peter klausler
fd3a82772f
[flang] Update README to reflect buildability with GCC 8.2.0.
...
Original-commit: flang-compiler/f18@f64a9f5b82
Reviewed-on: https://github.com/flang-compiler/f18/pull/163
2018-08-03 16:11:29 -07:00
peter klausler
ca5c265569
[flang] Add virtual IntExpr::~IntExpr to silence Clang warning about non-virtual dtor in a class with virtual functions.
...
Original-commit: flang-compiler/f18@b024ba50e1
Reviewed-on: https://github.com/flang-compiler/f18/pull/163
Tree-same-pre-rewrite: false
2018-08-03 16:07:58 -07:00
Peter Klausler
3e4cf24ed4
[flang] Merge pull request flang-compiler/f18#161 from flang-compiler/pmk1
...
issue#159 - better error messages in face of garbled source that resembles Hollerith
Original-commit: flang-compiler/f18@5aedd0d72c
Reviewed-on: https://github.com/flang-compiler/f18/pull/161
2018-08-03 15:29:13 -07:00
peter klausler
837b6960a5
[flang] Make prescanner tokenization message re: Hollerith truncation a warning, so parser get a shot at it. Merge messages from failed parsing alternatives more informatively.
...
Original-commit: flang-compiler/f18@16ed01d8f3
Reviewed-on: https://github.com/flang-compiler/f18/pull/161
2018-08-03 14:16:16 -07:00
Tim Keith
e6528c15d5
[flang] Merge pull request flang-compiler/f18#160 from flang-compiler/tsk9
...
Add support for submodules
Original-commit: flang-compiler/f18@79f3632fc2
Reviewed-on: https://github.com/flang-compiler/f18/pull/160
2018-08-03 11:33:14 -07:00
Tim Keith
ee51223da7
[flang] Changes based on review comments
...
Original-commit: flang-compiler/f18@fc4c0c39d5
Reviewed-on: https://github.com/flang-compiler/f18/pull/160
2018-08-03 11:32:21 -07:00
Tim Keith
e90d137108
[flang] Make module files read-only.
...
Original-commit: flang-compiler/f18@c7752ab5fb
Reviewed-on: https://github.com/flang-compiler/f18/pull/160
Tree-same-pre-rewrite: false
2018-08-02 16:38:36 -07:00
Tim Keith
96b187efdf
[flang] Add support for submodules
...
Symbols for submodules have `ModuleDetails` with `isSubmodule` set.
Scopes for submodules have `Module` kind and have a parent scope that
is also `Module` kind.
Scopes for modules now contain a mapping of submodule name to scope
so that we can find them without having to search the scope tree or
re-read their `.mod` file.
The module file for submodule `s` with ancestor module `m` is named `m-s.mod`.
The tree structure of scopes means module file writing is now recursive.
Similarly, reading the module file for a submodule may require reading
the module files of its parent and ancestor. `ResolveNames` now requires
the parent scope to be passed in -- it is not always the global scope.
`test_modfiles.sh` now handles an argument that is a filename glob so
that the test can involve multiple files. This allows `modfile09` to
test reading of `.mod` files for modules and submodules.
Original-commit: flang-compiler/f18@2e4424dbc8
Reviewed-on: https://github.com/flang-compiler/f18/pull/160
Tree-same-pre-rewrite: false
2018-08-02 16:21:27 -07:00
Tim Keith
4a20cc8478
[flang] Refactor to remove move semantics for Details
...
The classes in the Details union don't own resources so it makes things
simpler to copy them instead of moving. Same with ProcInterface.
Original-commit: flang-compiler/f18@d9ee19cbc4
Reviewed-on: https://github.com/flang-compiler/f18/pull/160
Tree-same-pre-rewrite: false
2018-08-02 15:51:07 -07:00
Peter Klausler
4d3195f80c
[flang] Merge pull request flang-compiler/f18#156 from flang-compiler/pmk1
...
Better program unit END statement error recovery.
Original-commit: flang-compiler/f18@902054b883
Reviewed-on: https://github.com/flang-compiler/f18/pull/156
2018-07-31 12:35:42 -07:00