peter klausler
e1b584468c
[flang] Even better program unit END statement error recovery.
...
Original-commit: flang-compiler/f18@31f456ebc5
Reviewed-on: https://github.com/flang-compiler/f18/pull/156
Tree-same-pre-rewrite: false
2018-07-30 16:33:55 -07:00
peter klausler
6135c20380
[flang] better program unit END statement error recovery
...
Original-commit: flang-compiler/f18@62799c88ff
Reviewed-on: https://github.com/flang-compiler/f18/pull/156
Tree-same-pre-rewrite: false
2018-07-30 15:31:06 -07:00
Peter Klausler
e9a123623a
[flang] Merge pull request flang-compiler/f18#155 from flang-compiler/pmk1
...
issue#153
Original-commit: flang-compiler/f18@bcac43a2c1
Reviewed-on: https://github.com/flang-compiler/f18/pull/155
2018-07-30 15:12:22 -07:00
peter klausler
7473cd711a
[flang] issue#153
...
Original-commit: flang-compiler/f18@64272abddd
Reviewed-on: https://github.com/flang-compiler/f18/pull/155
2018-07-30 13:56:44 -07:00
Peter Klausler
7e05019220
[flang] Merge pull request flang-compiler/f18#154 from flang-compiler/pmk2
...
issue#152 and a little clean-up
Original-commit: flang-compiler/f18@220c6eb2c8
Reviewed-on: https://github.com/flang-compiler/f18/pull/154
2018-07-30 13:55:19 -07:00
peter klausler
5369b346c3
[flang] issue#152 and a little clean-up
...
Original-commit: flang-compiler/f18@54d74dc1e8
Reviewed-on: https://github.com/flang-compiler/f18/pull/154
2018-07-30 12:56:58 -07:00
Peter Klausler
8cbd3ef76a
[flang] Merge pull request flang-compiler/f18#151 from flang-compiler/pmk1
...
Tweaks to source provenance and messaging in support of module files
Original-commit: flang-compiler/f18@21bb12c9d6
Reviewed-on: https://github.com/flang-compiler/f18/pull/151
2018-07-30 11:38:54 -07:00
peter klausler
56cc22fdfe
[flang] Use std::nullopt rather than {}.
...
Original-commit: flang-compiler/f18@9a740acf83
Reviewed-on: https://github.com/flang-compiler/f18/pull/151
2018-07-30 11:08:22 -07:00
peter klausler
d90437bd91
[flang] address review comments
...
Original-commit: flang-compiler/f18@a18aba21fd
Reviewed-on: https://github.com/flang-compiler/f18/pull/151
Tree-same-pre-rewrite: false
2018-07-27 17:06:55 -07:00
peter klausler
851a5a00f9
[flang] add isModuleFile flag to parser::Options, use it
...
Original-commit: flang-compiler/f18@0727140f53
Reviewed-on: https://github.com/flang-compiler/f18/pull/151
Tree-same-pre-rewrite: false
2018-07-27 15:18:36 -07:00
peter klausler
4c5dfecb3e
[flang] Let multiple CookedSource instances share a ref-counted AllSources.
...
Original-commit: flang-compiler/f18@98a170e3e5
Reviewed-on: https://github.com/flang-compiler/f18/pull/151
Tree-same-pre-rewrite: false
2018-07-27 14:58:14 -07:00
peter klausler
108e9b4678
[flang] Support resolution of provenances in messages from CharBlocks to ProvenanceRanges
...
Original-commit: flang-compiler/f18@aa57287959
Reviewed-on: https://github.com/flang-compiler/f18/pull/151
Tree-same-pre-rewrite: false
2018-07-27 14:01:19 -07:00
peter klausler
28ed1390cd
[flang] complete merge to current master
...
Original-commit: flang-compiler/f18@ca43f45616
Reviewed-on: https://github.com/flang-compiler/f18/pull/151
Tree-same-pre-rewrite: false
2018-07-27 13:38:24 -07:00
peter klausler
fa30061f09
[flang] fix double deallocation bug from previous commit
...
Original-commit: flang-compiler/f18@f216b6bb82
Reviewed-on: https://github.com/flang-compiler/f18/pull/151
Tree-same-pre-rewrite: false
2018-07-27 13:27:33 -07:00
peter klausler
544f9d5e74
[flang] Tweaks to provenance data structures, in preparation for better module file support.
...
Original-commit: flang-compiler/f18@a7b7b2b680
Reviewed-on: https://github.com/flang-compiler/f18/pull/151
Tree-same-pre-rewrite: false
2018-07-27 13:27:30 -07:00
Tim Keith
4790f692f5
[flang] Merge pull request flang-compiler/f18#149 from flang-compiler/tsk5
...
Refactor ModFileReader to use parser::Parsing
Original-commit: flang-compiler/f18@451e9e4ee4
Reviewed-on: https://github.com/flang-compiler/f18/pull/149
2018-07-27 10:57:29 -07:00
Tim Keith
11225c978b
[flang] Remove unnecessary unique_ptr.
...
The unique_ptr around the vector of char was unnecessary. We can just
move the vector itself and it still keeps the same stream of chars.
Original-commit: flang-compiler/f18@24672adba9
Reviewed-on: https://github.com/flang-compiler/f18/pull/149
2018-07-27 08:12:37 -07:00
Tim Keith
6f4f772685
[flang] Change how cooked source is saved
...
Rather than save the entire CookedSource object in the module scope,
all we need is the vector of characters that CharBlock has references
into. This avoids the problem that CookedSource object has a dangling
reference to an AllSources object (which shouldn't be needed by the
CharBlocks in the symbol table, but is there).
This also decouples Scope from parser classes other than CharBlock.
Original-commit: flang-compiler/f18@fdbf5c841e
Reviewed-on: https://github.com/flang-compiler/f18/pull/149
Tree-same-pre-rewrite: false
2018-07-26 16:03:31 -07:00
Tim Keith
9e48304374
[flang] Refactor ModFileReader to use parser::Parsing
...
parser::Parsing does most of the work needed to prescan and parse a file.
The only problem is that for module files we need to take ownership of
the cooked character stream so that it lives as long as the module scope
does.
To achieve this, change Parsing::cooked_ to be a unique_ptr and add a
member function to allow the caller to take ownership of it.
Original-commit: flang-compiler/f18@9088891ab2
Reviewed-on: https://github.com/flang-compiler/f18/pull/149
Tree-same-pre-rewrite: false
2018-07-26 10:57:51 -07:00
Austin Wells
fb8950ee93
[flang] Update README.md ( flang-compiler/f18#150 )
...
Corrected the URL in README.md to point to the correct public URL for this repository.
Original-commit: flang-compiler/f18@7005e9ad7b
Reviewed-on: https://github.com/flang-compiler/f18/pull/150
2018-07-27 08:46:33 -07:00
Tim Keith
88f57c6c28
[flang] Merge pull request flang-compiler/f18#147 from flang-compiler/tsk5
...
Add support for -module option
Original-commit: flang-compiler/f18@e3d4d7e6fd
Reviewed-on: https://github.com/flang-compiler/f18/pull/147
2018-07-26 10:40:27 -07:00
Tim Keith
070073426a
[flang] Add support for -module option
...
The `-module` option specifies where to write module files. It is also
the first place search for modules files. The current options name and
behavior match PGI compilers.
To support this, reorganize `ModFileWriter` to be more like `ModFileReader`.
The gives the client a way to set the output directory and fetch the
error messages. A bunch of static member functions in `ModFileWriter`
were changed to non-member functions so they didn't need to be exposed
in `mod-files.h`.
Original-commit: flang-compiler/f18@2717846e81
Reviewed-on: https://github.com/flang-compiler/f18/pull/147
2018-07-25 17:07:38 -07:00
Peter Klausler
ba0e3ba0ef
[flang] Merge pull request flang-compiler/f18#146 from flang-compiler/pmk1
...
OpenMP conditional compilation lines
Original-commit: flang-compiler/f18@e02c561e00
Reviewed-on: https://github.com/flang-compiler/f18/pull/146
2018-07-25 13:14:34 -07:00
peter klausler
594c554fa3
[flang] OpenMP conditional compilation lines
...
Original-commit: flang-compiler/f18@5602f7e041
Reviewed-on: https://github.com/flang-compiler/f18/pull/146
2018-07-25 11:44:20 -07:00
Tim Keith
f485a43ed9
[flang] Merge pull request flang-compiler/f18#145 from flang-compiler/tsk5
...
Implement reading of module files
Original-commit: flang-compiler/f18@2b36d4c650
Reviewed-on: https://github.com/flang-compiler/f18/pull/145
2018-07-25 10:11:38 -07:00
Tim Keith
f62f8b655d
[flang] Implement reading of module files
...
When a use-stmt is encountered for a module that isn't in the global
scope, search for and read the appropriate `.mod` file. To perform the
search, pass the search directories in to ResolveNames.
For modules that were read from `.mod` files, we have to keep the cooked
source from being deleted so that the names so that references to names
stay valid. So we store the cooked source in the Scope of the module as
a `unique_ptr`.
Add `Symbol::Flag::ModFile` to distinguish module symbols that were read
from a `.mod` file rather than from the current compilation. Use it to
prevent writing those back out.
Fix test_errors.sh to run the compiler in the temp subdirectory --
otherwise tests could be affected by `.mod` files left from previous
tests.
Original-commit: flang-compiler/f18@207065999c
Reviewed-on: https://github.com/flang-compiler/f18/pull/145
2018-07-25 10:11:38 -07:00
Peter Klausler
9381c34f61
[flang] Merge pull request flang-compiler/f18#144 from flang-compiler/pmk0
...
Checkpoint development of expression analysis
Original-commit: flang-compiler/f18@a32c16f895
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
2018-07-25 09:33:37 -07:00
peter klausler
dda1d4c959
[flang] Fix typo
...
Original-commit: flang-compiler/f18@b9837c01da
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
2018-07-24 15:50:38 -07:00
peter klausler
7f484d7011
[flang] real expression folding
...
Original-commit: flang-compiler/f18@8757dc2c90
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:57 -07:00
peter klausler
35ad0036aa
[flang] checkpoint
...
Original-commit: flang-compiler/f18@fc470dc851
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:57 -07:00
peter klausler
943b50289b
[flang] Real->Integer conversion folding
...
Original-commit: flang-compiler/f18@5ad6505e78
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:55 -07:00
peter klausler
61c45394c0
[flang] Parameterize Expr on a type, not category+kind
...
Original-commit: flang-compiler/f18@f29b065d00
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:55 -07:00
peter klausler
2eac1d0475
[flang] Better folding infrastructure checkpoint
...
Original-commit: flang-compiler/f18@85d16ace6c
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:55 -07:00
peter klausler
e4f12b087c
[flang] Be more clear that constants in expressions are scalars now.
...
Original-commit: flang-compiler/f18@3181b8d961
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:54 -07:00
peter klausler
9a503392b4
[flang] reformat
...
Original-commit: flang-compiler/f18@3c93a9edbc
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:53 -07:00
peter klausler
0aae9893a5
[flang] checkpoint
...
Original-commit: flang-compiler/f18@7fae33797a
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:53 -07:00
peter klausler
aa6c6f97a9
[flang] Begin semantic analysis of expressions.
...
Original-commit: flang-compiler/f18@34615fdc37
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:52 -07:00
peter klausler
557ba58708
[flang] Use const_cast instead of static_cast for clarity.
...
Original-commit: flang-compiler/f18@b76ba42af0
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:51 -07:00
peter klausler
efb0fd8753
[flang] More comments about 0**0.
...
Original-commit: flang-compiler/f18@3e9c0e8894
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:50 -07:00
peter klausler
ac01d216fb
[flang] 0**0 case
...
Original-commit: flang-compiler/f18@fcba49ce6f
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:49 -07:00
peter klausler
ceaff4f498
[flang] Fold integer powers
...
Original-commit: flang-compiler/f18@6a9ec4d76b
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:48 -07:00
peter klausler
50480bc987
[flang] Better folding.
...
Original-commit: flang-compiler/f18@4a3117968a
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:47 -07:00
peter klausler
05f0e2f7ec
[flang] Finish data hiding in variable.h.
...
Original-commit: flang-compiler/f18@5979330322
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:46 -07:00
peter klausler
006642f98a
[flang] more data hiding
...
Original-commit: flang-compiler/f18@2dc0d046e3
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:45 -07:00
peter klausler
7dbc09357e
[flang] Pull indirection into some constructors.
...
Original-commit: flang-compiler/f18@074e249499
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:44 -07:00
peter klausler
2f8baf1835
[flang] Data hiding
...
Original-commit: flang-compiler/f18@d33426637a
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:44 -07:00
peter klausler
f24cd7dd2d
[flang] checkpoint once everything builds again
...
Original-commit: flang-compiler/f18@2075b88772
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:43 -07:00
peter klausler
6c4773012c
[flang] issue#134
...
Original-commit: flang-compiler/f18@a40c38bdb5
Reviewed-on: https://github.com/flang-compiler/f18/pull/144
Tree-same-pre-rewrite: false
2018-07-24 14:33:42 -07:00
Peter Klausler
cd8ca3f625
[flang] Merge pull request flang-compiler/f18#143 from flang-compiler/pmk1
...
issue#142 fix
Original-commit: flang-compiler/f18@69c72ac955
Reviewed-on: https://github.com/flang-compiler/f18/pull/143
2018-07-24 14:30:29 -07:00
peter klausler
997e09bebd
[flang] issue#142, some refactoring of common patterns in basic-parsers.h, and reformatting
...
Original-commit: flang-compiler/f18@1faad40678
Reviewed-on: https://github.com/flang-compiler/f18/pull/143
2018-07-24 13:51:27 -07:00