peter klausler [Thu, 3 May 2018 23:47:00 +0000 (16:47 -0700)]
[flang] reformat for merge
Original-commit: flang-compiler/f18@
ccf265dad58fd4f69f555cdd12f562dc2d085fd5
Reviewed-on: https://github.com/flang-compiler/f18/pull/81
Tree-same-pre-rewrite: false
peter klausler [Thu, 3 May 2018 18:09:04 +0000 (11:09 -0700)]
[flang] Improve error message location.
Original-commit: flang-compiler/f18@
5efd011d184a1dc88262ce68a7cbee6094c1ca2f
Reviewed-on: https://github.com/flang-compiler/f18/pull/81
Tree-same-pre-rewrite: false
peter klausler [Wed, 2 May 2018 23:55:14 +0000 (16:55 -0700)]
[flang] Add TODO comment.
Original-commit: flang-compiler/f18@
1a82940ca80a63f1cc5eb0d295ee1426b0589506
Reviewed-on: https://github.com/flang-compiler/f18/pull/81
Tree-same-pre-rewrite: false
peter klausler [Wed, 2 May 2018 23:38:31 +0000 (16:38 -0700)]
[flang] Fix preprocessor tokenization of .NE. style operators.
Original-commit: flang-compiler/f18@
ab547b89e89a788a12ae67a46339b9e6cf1a83dd
Reviewed-on: https://github.com/flang-compiler/f18/pull/81
Tree-same-pre-rewrite: false
peter klausler [Wed, 2 May 2018 23:09:12 +0000 (16:09 -0700)]
[flang] Allow conditional compilation directives to affect continuation lines (again).
Original-commit: flang-compiler/f18@
9b9fd356ddfdd4934ddd7de9e3ce8cd0ebe606c7
Reviewed-on: https://github.com/flang-compiler/f18/pull/81
Tree-same-pre-rewrite: false
peter klausler [Wed, 2 May 2018 22:16:53 +0000 (15:16 -0700)]
[flang] Ignore spaces in FORMAT specifications, even in free form.
Original-commit: flang-compiler/f18@
3f65d35b1c624212c3ad22351e61b9cf3f0ba03e
Reviewed-on: https://github.com/flang-compiler/f18/pull/81
Tree-same-pre-rewrite: false
peter klausler [Wed, 2 May 2018 21:05:13 +0000 (14:05 -0700)]
[flang] Fix two cosubscript parsing problems with lookahead.
Original-commit: flang-compiler/f18@
b490c60fb0f68b638f13085ebbd92ec15340713e
Reviewed-on: https://github.com/flang-compiler/f18/pull/81
Tree-same-pre-rewrite: false
peter klausler [Wed, 2 May 2018 20:25:03 +0000 (13:25 -0700)]
[flang] Fix comment recognition in print *, "..."!comment
Original-commit: flang-compiler/f18@
d647b8ed2faa53f77a17de22336f5950eeef9096
Reviewed-on: https://github.com/flang-compiler/f18/pull/81
Tree-same-pre-rewrite: false
peter klausler [Wed, 2 May 2018 19:07:49 +0000 (12:07 -0700)]
[flang] Make messages more like clang's.
Original-commit: flang-compiler/f18@
176cdf8e6ce79bb6a8fb2d947b218d17f315b071
Reviewed-on: https://github.com/flang-compiler/f18/pull/81
Tree-same-pre-rewrite: false
peter klausler [Wed, 2 May 2018 17:02:00 +0000 (10:02 -0700)]
[flang] Clean up message output a little; remove unused APIs.
Original-commit: flang-compiler/f18@
64298b8d74478684c77d3d18282e8a47a0186a97
Reviewed-on: https://github.com/flang-compiler/f18/pull/81
Tree-same-pre-rewrite: false
peter klausler [Tue, 1 May 2018 22:54:04 +0000 (15:54 -0700)]
[flang] Don't process preprocessor directives amid continuation lines any more.
Original-commit: flang-compiler/f18@
4a3dbb5d3e24559f20a90f4ebc021c294817cd24
Reviewed-on: https://github.com/flang-compiler/f18/pull/81
Tree-same-pre-rewrite: false
peter klausler [Tue, 1 May 2018 21:59:10 +0000 (14:59 -0700)]
[flang] Allow $ and @ in defined operator names.
Original-commit: flang-compiler/f18@
3cf7533a3bfe35b5dcb4396f35339ee34d34c272
Reviewed-on: https://github.com/flang-compiler/f18/pull/81
Tree-same-pre-rewrite: false
Tim Keith [Fri, 4 May 2018 14:24:35 +0000 (07:24 -0700)]
[flang] Merge pull request flang-compiler/f18#79 from ThePortlandGroup/tsk3
Implement USE statements.
Original-commit: flang-compiler/f18@
053461f6de9f4d0c86cc96543915adabf1d16df3
Reviewed-on: https://github.com/flang-compiler/f18/pull/79
Tim Keith [Thu, 3 May 2018 22:57:56 +0000 (15:57 -0700)]
[flang] Support for USE statements.
When a USE statement is encountered, find the scope corresponding to the
module. This is now stored in the ModuleDetails of the module symbol.
useModuleScope_ tracks this while processing the USE. Currently only
modules defined in the same file work because we don't have module files.
At the end of a USE that isn't a use-only, add all public names that
were not renamed.
AddUse() handles recording of a USE by creating a local symbol with
UseDetails that tracks the use-symbol in the module and the location of
the USE (for error messages). If an ambiguous USE is detected, the
UseDetails are replaced by UseErrorDetails. This tracks the locations of
all the uses so that they can be referenced in a diagnostic.
Detect attempts to re-declare use-associated symbols as well as changing
their attributes (except for ASYNCHRONOUS and VOLATILE).
Add missing checks for access-stmt in scoping units other than modules.
Add tests for the new errors.
Reorganize the MessageHandler::Say() overloadings to prevent them from
becoming too numerous.
Original-commit: flang-compiler/f18@
cc0523134c85ee2fe156b4f5c8d042e73ac92549
Reviewed-on: https://github.com/flang-compiler/f18/pull/79
Tim Keith [Thu, 26 Apr 2018 02:58:42 +0000 (19:58 -0700)]
[flang] resolve-names.cc reorganization and cleanup.
Add ScopeHandle class to manage the stack of scopes and MakeSymbol(), which
makes a symbol in the current scope. Move the call to ApplyImplicitScopes()
into PopScope() as it must be done for each scope.
Add ModuleVisitor class to manage module-related resolution. Currently that
consists of beginning and ending modules and access statements. This is
preparation for further module work.
Replace references to parser::CharBlock with SourceName.
Original-commit: flang-compiler/f18@
913df85e48f1e06d0c75bb517f5edd898e8efd69
Reviewed-on: https://github.com/flang-compiler/f18/pull/79
Tree-same-pre-rewrite: false
Stephane Chauveau [Fri, 4 May 2018 09:20:37 +0000 (11:20 +0200)]
[flang] Merge pull request flang-compiler/f18#78 from ThePortlandGroup/sch_llvm2
Add dependency to LLVM & Clang libraries (backport)
Original-commit: flang-compiler/f18@
c0d84e4ae39efd6a2fd971f81008c7d4d74c6b80
Reviewed-on: https://github.com/flang-compiler/f18/pull/78
Stephane Chauveau [Fri, 4 May 2018 09:18:34 +0000 (11:18 +0200)]
[flang] misc changes in response to pul-request comments
Original-commit: flang-compiler/f18@
1b3332d2adc094a318415609e9ba7e881bf5074a
Reviewed-on: https://github.com/flang-compiler/f18/pull/78
Stephane Chauveau [Thu, 3 May 2018 15:30:02 +0000 (17:30 +0200)]
[flang] fix typo in comment
Original-commit: flang-compiler/f18@
477e852903089cecb7f6049539bdb5f5a8d633b1
Reviewed-on: https://github.com/flang-compiler/f18/pull/78
Tree-same-pre-rewrite: false
Stephane Chauveau [Thu, 3 May 2018 14:32:43 +0000 (16:32 +0200)]
[flang] Add missing underscore to private members
Original-commit: flang-compiler/f18@
7247cf4c3a3a7a83be923956cbb10c123a9430e0
Reviewed-on: https://github.com/flang-compiler/f18/pull/78
Tree-same-pre-rewrite: false
Stephane Chauveau [Thu, 3 May 2018 14:26:17 +0000 (16:26 +0200)]
[flang] Fix duplicate copyright message
Original-commit: flang-compiler/f18@
65e3e864402f3771f618868a2d18ee1d182847f0
Reviewed-on: https://github.com/flang-compiler/f18/pull/78
Tree-same-pre-rewrite: false
Stephane Chauveau [Thu, 3 May 2018 12:54:53 +0000 (14:54 +0200)]
[flang] Manual backport of sch_llvm branch
Original-commit: flang-compiler/f18@
17ee2d8e3ac5bfb633cc2792ee7873c543696e72
Reviewed-on: https://github.com/flang-compiler/f18/pull/78
Tree-same-pre-rewrite: false
Tim Keith [Wed, 2 May 2018 22:32:16 +0000 (15:32 -0700)]
[flang] Merge pull request flang-compiler/f18#77 from ThePortlandGroup/tsk4
Source code cleanup
Original-commit: flang-compiler/f18@
63b5a0e133ce259d7a1690237ae2534f5c803505
Reviewed-on: https://github.com/flang-compiler/f18/pull/77
Tim Keith [Wed, 2 May 2018 21:06:02 +0000 (14:06 -0700)]
[flang] Run clang-format on all .h and .cc files.
Original-commit: flang-compiler/f18@
b7f02808a244fbb2597dc2bdc4430b292b433c03
Reviewed-on: https://github.com/flang-compiler/f18/pull/77
Tim Keith [Wed, 2 May 2018 20:48:12 +0000 (13:48 -0700)]
[flang] Normalize namespace definitions.
Replace `namespace Fortran { namespace parser { ... } }` with
`namespace Fortran::parser { ... }` and similarly for semantics.
Original-commit: flang-compiler/f18@
838c9539b2497f8dd1e33bd23623a5373a694e7b
Reviewed-on: https://github.com/flang-compiler/f18/pull/77
Tree-same-pre-rewrite: false
Steve Scalpone [Wed, 2 May 2018 18:05:34 +0000 (11:05 -0700)]
[flang] Merge pull request flang-compiler/f18#76 from ThePortlandGroup/sjs-os1
Remove unused code; rename dump-parse-tree
Original-commit: flang-compiler/f18@
e46b5087b7b18e5d65165ff134de50683451aed6
Reviewed-on: https://github.com/flang-compiler/f18/pull/76
Steve Scalpone [Wed, 2 May 2018 16:21:03 +0000 (09:21 -0700)]
[flang] Update CMakefiles and #include paths.
Original-commit: flang-compiler/f18@
1b7b8259b39760446f9aaee8b104cc1a8543f5dd
Reviewed-on: https://github.com/flang-compiler/f18/pull/76
Steve Scalpone [Wed, 2 May 2018 16:15:33 +0000 (09:15 -0700)]
[flang] Removed unused files and declarations.
Renamed ParseTreeDump to dump-parse-tree.
Original-commit: flang-compiler/f18@
9de97328f1f477441863246c7c1bd8ff4f32498b
Reviewed-on: https://github.com/flang-compiler/f18/pull/76
Tree-same-pre-rewrite: false
Tim Keith [Tue, 1 May 2018 21:44:40 +0000 (14:44 -0700)]
[flang] Merge pull request flang-compiler/f18#75 from ThePortlandGroup/tsk4
Cleanup
Original-commit: flang-compiler/f18@
d1545693d1ed4716603a6526f2f60f604a48be74
Reviewed-on: https://github.com/flang-compiler/f18/pull/75
Tim Keith [Tue, 1 May 2018 21:07:52 +0000 (14:07 -0700)]
[flang] Make include guards consistent.
The include guard symbol is `FORTRAN_$dir_$file_H_` where $dir is the
subdirectory of `lib` and $file is the basename of the header file.
Those names are mapped to uppercase and hyphens are replaced by
underscores.
Original-commit: flang-compiler/f18@
ac9c0e7106c898479cf35086861a711ab7c0210a
Reviewed-on: https://github.com/flang-compiler/f18/pull/75
Tim Keith [Tue, 1 May 2018 20:29:10 +0000 (13:29 -0700)]
[flang] Remove unused files.
Original-commit: flang-compiler/f18@
856315fd43308d49c61bb2a0f10c77e01b32fdbc
Reviewed-on: https://github.com/flang-compiler/f18/pull/75
Tree-same-pre-rewrite: false
Tim Keith [Tue, 1 May 2018 20:24:54 +0000 (13:24 -0700)]
[flang] Merge pull request flang-compiler/f18#74 from ThePortlandGroup/tsk4
Add copyright notices.
Original-commit: flang-compiler/f18@
20f64da9d97cec06f422ff9ed7420fcebd78472f
Reviewed-on: https://github.com/flang-compiler/f18/pull/74
Tim Keith [Tue, 1 May 2018 19:50:34 +0000 (12:50 -0700)]
[flang] Add copyright notices.
For source files (C++, Fortran, CMake) add copyright and license.
For documentation files add just copyright.
Original-commit: flang-compiler/f18@
38381aed839ef091a44ea8f2ef7bc5346d776c67
Reviewed-on: https://github.com/flang-compiler/f18/pull/74
Peter Klausler [Fri, 27 Apr 2018 22:32:12 +0000 (15:32 -0700)]
[flang] Merge pull request flang-compiler/f18#73 from ThePortlandGroup/pmk-scrub3
More clean-up & build with Clang
Original-commit: flang-compiler/f18@
c809062f1176338223e897f32139ffe3d86d5eae
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
peter klausler [Fri, 27 Apr 2018 22:03:28 +0000 (15:03 -0700)]
[flang] Clean out the PGI stuff from CMakeLists.txt.
Original-commit: flang-compiler/f18@
806db179ce8f9437f301772712baf69b8f0e4135
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
peter klausler [Fri, 27 Apr 2018 20:37:51 +0000 (13:37 -0700)]
[flang] Fix a static_assert and a message location bug in first().
Original-commit: flang-compiler/f18@
cd85bff31b1a93bfd7f9ad8344982f88670e3365
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Fri, 27 Apr 2018 19:43:16 +0000 (12:43 -0700)]
[flang] silence a warning
Original-commit: flang-compiler/f18@
dc91727ac4d81a6257c0011b75d4311e2751f941
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Fri, 27 Apr 2018 19:37:47 +0000 (12:37 -0700)]
[flang] More Clang work.
Original-commit: flang-compiler/f18@
7ff98ad77848c314a5d7ed5559087610bae4b805
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Fri, 27 Apr 2018 00:03:54 +0000 (17:03 -0700)]
[flang] Use libc++ with clang.
Original-commit: flang-compiler/f18@
d81b8d87f8712bc478931637f124c5a6a22d928b
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Thu, 26 Apr 2018 23:52:11 +0000 (16:52 -0700)]
[flang] Use first() to define operator|| when compiling with clang.
Original-commit: flang-compiler/f18@
7bf98d683c46b29f6bed4a00dfd0eceebc9dcea7
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Thu, 26 Apr 2018 23:27:07 +0000 (16:27 -0700)]
[flang] Remove excess space at end of line.
Original-commit: flang-compiler/f18@
900dc4e254ea680f33382e35eab1fd5b1321ea09
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Thu, 26 Apr 2018 23:16:01 +0000 (16:16 -0700)]
[flang] Refine CMakeLists.txt tweaks.
Original-commit: flang-compiler/f18@
b40c68f9ab8fda8b8110159b6f6e9faf530aeedc
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Thu, 26 Apr 2018 23:03:01 +0000 (16:03 -0700)]
[flang] Package clang build settings.
Original-commit: flang-compiler/f18@
775b42598d278e58277e7f730b8f51d9657db2e4
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Thu, 26 Apr 2018 22:44:29 +0000 (15:44 -0700)]
[flang] Patches to permit building with Clang without notes or warnings.
Original-commit: flang-compiler/f18@
0e74b10603ecceaca1781ecd0ee630de89e8e7f1
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Wed, 25 Apr 2018 21:14:02 +0000 (14:14 -0700)]
[flang] Use first() more.
Original-commit: flang-compiler/f18@
a2f2fdf869bd9a73a3b900d599f7adca2b02a8cd
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Wed, 25 Apr 2018 20:34:40 +0000 (13:34 -0700)]
[flang] Implement first(...) as attempt at a faster set of alternatives.
Original-commit: flang-compiler/f18@
9f6a26cee636c3cc91d91583fd2b785f26a618c2
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Wed, 25 Apr 2018 20:33:48 +0000 (13:33 -0700)]
[flang] Attempt to build f18 with clang.
Original-commit: flang-compiler/f18@
0480837234cfe407aac0795cc5c35dfa6ee1139d
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Wed, 25 Apr 2018 20:33:14 +0000 (13:33 -0700)]
[flang] Attempt to build f18 with clang.
Original-commit: flang-compiler/f18@
86fec97e418d5e4156dac8a8ea84764c81e6a12a
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Tue, 24 Apr 2018 22:46:16 +0000 (15:46 -0700)]
[flang] Resolve an old TODO by flattening a std::optional<std::optional<>>.
Original-commit: flang-compiler/f18@
05f47831fc2d6ce7a59993ac8670db8e85b89706
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
peter klausler [Tue, 24 Apr 2018 22:25:11 +0000 (15:25 -0700)]
[flang] Resolve old TODO about needless Indirection<>.
Original-commit: flang-compiler/f18@
5f289209c4ec76be905dd76d649a725af3998e8d
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
Tim Keith [Wed, 25 Apr 2018 19:52:06 +0000 (12:52 -0700)]
[flang] Merge pull request flang-compiler/f18#70 from ThePortlandGroup/tsk2
Initial support for name resolution in modules.
Original-commit: flang-compiler/f18@
1c318fe9f759eb1cdbe29d6a8869f675c4f9fb7c
Reviewed-on: https://github.com/flang-compiler/f18/pull/70
Tim Keith [Wed, 25 Apr 2018 18:49:29 +0000 (11:49 -0700)]
[flang] Improve comment.
Original-commit: flang-compiler/f18@
270514a30b593db23d6526ac940cd31471f4992b
Reviewed-on: https://github.com/flang-compiler/f18/pull/70
Tim Keith [Wed, 25 Apr 2018 18:44:12 +0000 (11:44 -0700)]
[flang] Remove unnecessary defaults in switches.
Original-commit: flang-compiler/f18@
f4835e3831f875fb3ae56f390201ab34422c64e3
Reviewed-on: https://github.com/flang-compiler/f18/pull/70
Tree-same-pre-rewrite: false
Tim Keith [Wed, 25 Apr 2018 17:46:39 +0000 (10:46 -0700)]
[flang] Non-fatal error for repeated access spec
When an access statement repeats the same attribute, make it a non-fatal
diagnostic. Also, include the previous specification in the message.
resolve11.f90 now illustrates both cases, fatal and non-fatal.
Original-commit: flang-compiler/f18@
1f567c740a8ec300d247f63a69b15ca820e757a3
Reviewed-on: https://github.com/flang-compiler/f18/pull/70
Tree-same-pre-rewrite: false
Tim Keith [Wed, 25 Apr 2018 00:05:58 +0000 (17:05 -0700)]
[flang] Initial support for name resolution in modules.
Recognize modules and open and close the corresponding scope.
Handle PUBLIC and PRIVATE statements and set the corresponding
attributes on entity declarations in the module.
Refactoring (no functional changes): Make CheckImplicitSymbol() and
GetVariableName() overloadings private and out-of-line.
Add missing option to f18 help.
Original-commit: flang-compiler/f18@
d01cacca6335629b8c82205a45d4347754dada5f
Reviewed-on: https://github.com/flang-compiler/f18/pull/70
Tree-same-pre-rewrite: false
Peter Klausler [Tue, 24 Apr 2018 23:34:01 +0000 (16:34 -0700)]
[flang] Merge pull request flang-compiler/f18#69 from ThePortlandGroup/pmk3
Make `construct<T>(...)` calls span more accurate source ranges.
Original-commit: flang-compiler/f18@
e332daec7af2752624f89eeef6f20b60930cb66f
Reviewed-on: https://github.com/flang-compiler/f18/pull/69
peter klausler [Tue, 24 Apr 2018 23:27:01 +0000 (16:27 -0700)]
[flang] Remove dead code, reformat.
Original-commit: flang-compiler/f18@
c87fdd8cd94667c8dd56ef0b9d588013c9a0994a
Reviewed-on: https://github.com/flang-compiler/f18/pull/69
peter klausler [Tue, 24 Apr 2018 22:26:50 +0000 (15:26 -0700)]
[flang] Reformat.
Original-commit: flang-compiler/f18@
047de95439fd5f2988c3afd743472704dc9745af
Reviewed-on: https://github.com/flang-compiler/f18/pull/69
Tree-same-pre-rewrite: false
peter klausler [Tue, 24 Apr 2018 22:02:41 +0000 (15:02 -0700)]
[flang] Allow construct<T>("TOKEN"_tok)" with unvalued parser argument.
Original-commit: flang-compiler/f18@
19d2a4a849fcc14aa02083a2ade0211a15784526
Reviewed-on: https://github.com/flang-compiler/f18/pull/69
Tree-same-pre-rewrite: false
peter klausler [Tue, 24 Apr 2018 19:15:51 +0000 (12:15 -0700)]
[flang] Add constructIf<>(); complete pass over grammar.
Original-commit: flang-compiler/f18@
4d5b4055bd083b1df7ae2e5456cf52be1109d0a4
Reviewed-on: https://github.com/flang-compiler/f18/pull/69
Tree-same-pre-rewrite: false
peter klausler [Tue, 10 Apr 2018 00:03:49 +0000 (17:03 -0700)]
[flang] Adjust productions in grammar.h so that construct<> invocations span what they cover (more to come)
Original-commit: flang-compiler/f18@
ba5c2368d1c8b40d36746d16a2ee848ecfc5152c
Reviewed-on: https://github.com/flang-compiler/f18/pull/69
Tree-same-pre-rewrite: false
Tim Keith [Tue, 24 Apr 2018 19:30:09 +0000 (12:30 -0700)]
[flang] Merge pull request flang-compiler/f18#67 from ThePortlandGroup/tsk3
Create Message instances with provenance range.
Original-commit: flang-compiler/f18@
6e473cd0293596a50279b84891a8fc63d4509ff1
Reviewed-on: https://github.com/flang-compiler/f18/pull/67
Tim Keith [Mon, 23 Apr 2018 23:18:48 +0000 (16:18 -0700)]
[flang] Create Message instances with provenance range.
This allows the message to point to the full name or statement
rather than just the first character.
Original-commit: flang-compiler/f18@
9cf41b13358f45e03338789b968113c347acd895
Reviewed-on: https://github.com/flang-compiler/f18/pull/67
Peter Klausler [Tue, 24 Apr 2018 17:45:23 +0000 (10:45 -0700)]
[flang] Merge pull request flang-compiler/f18#68 from ThePortlandGroup/pmk-scrub2
Remove needless empty braces from construct<>() calls.
Original-commit: flang-compiler/f18@
d7609befe6ab89f57b1c9e9a7602275d26dcab0c
Reviewed-on: https://github.com/flang-compiler/f18/pull/68
peter klausler [Mon, 23 Apr 2018 23:53:16 +0000 (16:53 -0700)]
[flang] Remove needless empty braces from construct<>() calls.
Original-commit: flang-compiler/f18@
f9c4a27034f52468eaee2397580685effa26e759
Reviewed-on: https://github.com/flang-compiler/f18/pull/68
Peter Klausler [Mon, 23 Apr 2018 22:54:38 +0000 (15:54 -0700)]
[flang] Merge pull request flang-compiler/f18#66 from ThePortlandGroup/pmk-scrub
Code clean-up & provenance ranges on messages
Original-commit: flang-compiler/f18@
fd50389e44713f3b9bd3d530c7a2154ce2712f2e
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
peter klausler [Mon, 23 Apr 2018 19:38:49 +0000 (12:38 -0700)]
[flang] Delete more dead code.
Original-commit: flang-compiler/f18@
e38e411ccfeff06b8e27c219ad0e520ea07335a5
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
peter klausler [Mon, 23 Apr 2018 19:25:43 +0000 (12:25 -0700)]
[flang] Remove dead code.
Original-commit: flang-compiler/f18@
a85e16c704422f42c0811c51bd4e668b407d11c6
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
Tree-same-pre-rewrite: false
peter klausler [Mon, 23 Apr 2018 19:17:11 +0000 (12:17 -0700)]
[flang] Use ranges of provenances in messages.
Original-commit: flang-compiler/f18@
67d4f878a4392689ba1f768a69198de93af871c2
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
Tree-same-pre-rewrite: false
peter klausler [Fri, 20 Apr 2018 23:56:58 +0000 (16:56 -0700)]
[flang] Extend Message representation to cover ranges.
Original-commit: flang-compiler/f18@
314819c87f3f21fff715fd9c78b36f8a8bc77d6b
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
Tree-same-pre-rewrite: false
peter klausler [Fri, 20 Apr 2018 23:14:57 +0000 (16:14 -0700)]
[flang] Finish cleaning up debug-parser.
Original-commit: flang-compiler/f18@
0ef551025ac7cf192e47fad1139ae3381a874b91
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
Tree-same-pre-rewrite: false
peter klausler [Fri, 20 Apr 2018 22:56:19 +0000 (15:56 -0700)]
[flang] Split debug-parser.h, put code into debug-parser.cc.
Original-commit: flang-compiler/f18@
b34d15ef6d67e71a0ba6f64e419d2519681e7cbc
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
Tree-same-pre-rewrite: false
peter klausler [Fri, 20 Apr 2018 22:47:40 +0000 (15:47 -0700)]
[flang] Finish moving user state action parsers into user-state.{h,cc}.
Original-commit: flang-compiler/f18@
79c8a4cefe566bd64692acc8bc13e0a25c4f6be4
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
Tree-same-pre-rewrite: false
peter klausler [Fri, 20 Apr 2018 22:19:20 +0000 (15:19 -0700)]
[flang] More clean-up.
Original-commit: flang-compiler/f18@
96dda922867e50f6f33a4ebe4d0fbc8e25141c5b
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
Tree-same-pre-rewrite: false
peter klausler [Fri, 20 Apr 2018 21:27:49 +0000 (14:27 -0700)]
[flang] Begin moving UserState action parsers into user-state.{h,cc}.
Original-commit: flang-compiler/f18@
5c31402146bf24873b37fdb4fa83dbe6256f30c3
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
Tree-same-pre-rewrite: false
peter klausler [Fri, 20 Apr 2018 21:09:29 +0000 (14:09 -0700)]
[flang] Fix header file name.
Original-commit: flang-compiler/f18@
8abfeaed450fd6dafc34eb3db137246c0e339bed
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
Tree-same-pre-rewrite: false
peter klausler [Fri, 20 Apr 2018 20:49:03 +0000 (13:49 -0700)]
[flang] Move Parser<> to its own header.
Original-commit: flang-compiler/f18@
c43e8ba138546c5739cc8eaa681a9eb6e51ed657
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
Tree-same-pre-rewrite: false
peter klausler [Fri, 20 Apr 2018 18:23:51 +0000 (11:23 -0700)]
[flang] Use references for ParseState arguments to parsers. Other minor clean-up.
Original-commit: flang-compiler/f18@
5b18b799e795199eece6c95485f59d552b438596
Reviewed-on: https://github.com/flang-compiler/f18/pull/66
Tree-same-pre-rewrite: false
Tim Keith [Mon, 23 Apr 2018 22:38:21 +0000 (15:38 -0700)]
[flang] Merge pull request flang-compiler/f18#65 from ThePortlandGroup/tsk2
Rewrite function calls to array element references
Original-commit: flang-compiler/f18@
1dc8d272506f08e9a8845643a0bf9c923cc4eb99
Reviewed-on: https://github.com/flang-compiler/f18/pull/65
Tim Keith [Mon, 23 Apr 2018 22:33:59 +0000 (15:33 -0700)]
[flang] Undo previous commit.
`name` depends on the template type, so we have to explicitly say
that `has` is a template with the `template` keyword.
Rather than do that I'm putting back the explicit type for name.
Original-commit: flang-compiler/f18@
0cde87f2fe64801dbbd2172970e3d0113d421006
Reviewed-on: https://github.com/flang-compiler/f18/pull/65
Tim Keith [Mon, 23 Apr 2018 20:10:33 +0000 (13:10 -0700)]
[flang] Address review comment.
Original-commit: flang-compiler/f18@
cb3904761b33644b68d679429462e4283c671b36
Reviewed-on: https://github.com/flang-compiler/f18/pull/65
Tree-same-pre-rewrite: false
Tim Keith [Mon, 23 Apr 2018 19:33:10 +0000 (12:33 -0700)]
[flang] Rewrite function calls to array element references
parse-tree.h, parse-tree.cc:
Add FunctionReference::ConvertToArrayElementRef() to convert a function
reference to an array element reference.
Factor out MakeArrayElementRef() to use in ConvertToArrayElementRef()
and also in converting statement functions to array element assignments.
resolve-names.cc:
Recognize references to functions and subroutines and add symbols for them.
Detect declaration conflicts from these and check `IMPLICIT NONE(EXTERNAL)`.
rewrite-parse-tree.cc:
Find function references that need to be converted and rewrite them.
Original-commit: flang-compiler/f18@
e5a1e0aaeffe8de92b1ecb67890ffa463cd6a43a
Reviewed-on: https://github.com/flang-compiler/f18/pull/65
Peter Klausler [Fri, 20 Apr 2018 17:42:03 +0000 (10:42 -0700)]
[flang] Merge pull request flang-compiler/f18#62 from ThePortlandGroup/pmk-instr
Parser instrumentation and caching of failed parse attempts
Original-commit: flang-compiler/f18@
30040ed22e9e8063e11e325e1afd9963773b53a3
Reviewed-on: https://github.com/flang-compiler/f18/pull/62
peter klausler [Fri, 20 Apr 2018 00:02:12 +0000 (17:02 -0700)]
[flang] Complete parser instrumentation and caching of failures.
Original-commit: flang-compiler/f18@
9843dbf211bf2a2859aaa5451223e7d090a229ea
Reviewed-on: https://github.com/flang-compiler/f18/pull/62
peter klausler [Thu, 19 Apr 2018 22:46:02 +0000 (15:46 -0700)]
[flang] Parser instrumentation and fail-fast experiment begun.
Original-commit: flang-compiler/f18@
ab46163d6e84aa4fdde0e3149d12fe1049f64f9f
Reviewed-on: https://github.com/flang-compiler/f18/pull/62
Tree-same-pre-rewrite: false
peter klausler [Thu, 19 Apr 2018 20:03:23 +0000 (13:03 -0700)]
[flang] First cut at parser instrumentation with pass/fail counters.
Original-commit: flang-compiler/f18@
21ed700afa6b7d7ec9ee5477d7d16a01ead42557
Reviewed-on: https://github.com/flang-compiler/f18/pull/62
Tree-same-pre-rewrite: false
Peter Klausler [Thu, 19 Apr 2018 20:51:46 +0000 (13:51 -0700)]
[flang] Merge pull request flang-compiler/f18#61 from ThePortlandGroup/pmk-cset
Define SetOfChars type, use it
Original-commit: flang-compiler/f18@
1d563ba59fa5d3eff4bc5b4796ca7e8525f064fb
Reviewed-on: https://github.com/flang-compiler/f18/pull/61
peter klausler [Thu, 19 Apr 2018 20:51:25 +0000 (13:51 -0700)]
[flang] Address review comments.
Original-commit: flang-compiler/f18@
dbeba373223f97e627063fed17b3f72e2b5c508e
Reviewed-on: https://github.com/flang-compiler/f18/pull/61
peter klausler [Thu, 19 Apr 2018 00:05:07 +0000 (17:05 -0700)]
[flang] Finish repackaging SetOfChars
Original-commit: flang-compiler/f18@
37085c0cddaf693ae21b79ac6bedd7e059c241d6
Reviewed-on: https://github.com/flang-compiler/f18/pull/61
Tree-same-pre-rewrite: false
peter klausler [Wed, 18 Apr 2018 23:39:28 +0000 (16:39 -0700)]
[flang] More repackaging
Original-commit: flang-compiler/f18@
55f4f0505e57b750c3da0dc3fc9e2bbd0c99d831
Reviewed-on: https://github.com/flang-compiler/f18/pull/61
Tree-same-pre-rewrite: false
peter klausler [Wed, 18 Apr 2018 23:28:29 +0000 (16:28 -0700)]
[flang] repackage SetOfChars as a class type
Original-commit: flang-compiler/f18@
bae9199f62bd37617db1823b93e6f4da4acfd563
Reviewed-on: https://github.com/flang-compiler/f18/pull/61
Tree-same-pre-rewrite: false
peter klausler [Wed, 18 Apr 2018 20:24:41 +0000 (13:24 -0700)]
[flang] Combine expected character sets of messages ending at same point from two alternatives.
Original-commit: flang-compiler/f18@
a006ceef1d2176112353605b3a9bf4391cbced9a
Reviewed-on: https://github.com/flang-compiler/f18/pull/61
Tree-same-pre-rewrite: false
peter klausler [Wed, 18 Apr 2018 19:55:27 +0000 (12:55 -0700)]
[flang] debugging
Original-commit: flang-compiler/f18@
02718dd6ef6dca6ba388917bb6a65a75e1ebeaeb
Reviewed-on: https://github.com/flang-compiler/f18/pull/61
Tree-same-pre-rewrite: false
peter klausler [Wed, 18 Apr 2018 18:26:17 +0000 (11:26 -0700)]
[flang] Define sets of characters; use them in parsing and messages.
Original-commit: flang-compiler/f18@
d3ca565b59e2cc4920629af2571a4a6b66cf3b9b
Reviewed-on: https://github.com/flang-compiler/f18/pull/61
Tree-same-pre-rewrite: false
Tim Keith [Thu, 19 Apr 2018 17:47:48 +0000 (10:47 -0700)]
[flang] Merge pull request flang-compiler/f18#60 from ThePortlandGroup/tsk2
Implement parse tree rewriting.
Original-commit: flang-compiler/f18@
ac0c8ca08ec9cbf35ac2f51b9ee04bb2dce1f9b0
Reviewed-on: https://github.com/flang-compiler/f18/pull/60
Tim Keith [Thu, 19 Apr 2018 14:07:47 +0000 (07:07 -0700)]
[flang] Move ConvertToAssignment into class StmtFunctionStmt.
Original-commit: flang-compiler/f18@
e3eaca38fd0c30765474c2a46ae4d6c36796af07
Reviewed-on: https://github.com/flang-compiler/f18/pull/60
Tim Keith [Wed, 18 Apr 2018 23:49:42 +0000 (16:49 -0700)]
[flang] Merge parse-tree-mutator.h into parse-tree-visitor.h
Use the latter for visiting and mutating and delete the former.
Original-commit: flang-compiler/f18@
ac5a098ca7187eeb5d5bd2104c8d29363075b368
Reviewed-on: https://github.com/flang-compiler/f18/pull/60
Tree-same-pre-rewrite: false
Tim Keith [Wed, 18 Apr 2018 22:50:36 +0000 (15:50 -0700)]
[flang] Address review comments.
Original-commit: flang-compiler/f18@
d3a363d6cbcb154201f45670c0a60edbff260719
Reviewed-on: https://github.com/flang-compiler/f18/pull/60
Tree-same-pre-rewrite: false
Tim Keith [Wed, 18 Apr 2018 22:06:35 +0000 (15:06 -0700)]
[flang] Implement parse tree rewriting.
Add parse-tree-mutator.h like parse-tree-visitor.h except that the Walk
functions take non-const references to parse tree nodes so the Pre and
Post methods of the mutator that are passed around can make changes to
the parse tree.
Change ExecutionPart to be a class that wraps a list so that it can be
identified during parse tree walking.
Add Symbol* field to parser::Name for the result of symbol resolution.
In parse tree dumper, dump symbol when it is there instead of just name.
Add RewriteParseTree to walk the parse tree, fill in resolved symbols in
Name nodes, and make necessary changes to the structure. Currently that
consists of rewriting statement functions as array assignments when
appropriate.
In ResolveNames, call RewriteParseTree if the resolution was successful.
Recognize a statement function that comes after a mis-identified
statement function and report an error. resolve08.f90 tests this case.
Add -fdebug-dump-symbols to dump the scope tree and symbols in each scope.
This is implemented by DumpSymbols in resolve-names.cc. Add an optional
symbol to scopes that correspond to symbols (e.g. subprograms). Remove
debug output from ResolveNamesVisitor as this option can be used instead.
Original-commit: flang-compiler/f18@
9cd337226521c7f3d2b149983ed677def55baa29
Reviewed-on: https://github.com/flang-compiler/f18/pull/60
Tree-same-pre-rewrite: false
Peter Klausler [Wed, 18 Apr 2018 00:09:43 +0000 (17:09 -0700)]
[flang] Merge pull request flang-compiler/f18#59 from ThePortlandGroup/pmk-messages
Messaging work
Original-commit: flang-compiler/f18@
f6b879ab1070b940df3c97b0a1251ed0f73f8475
Reviewed-on: https://github.com/flang-compiler/f18/pull/59
peter klausler [Tue, 17 Apr 2018 22:47:51 +0000 (15:47 -0700)]
[flang] Defer message accumulation until it is known that messages will be produced.
Original-commit: flang-compiler/f18@
8485d44efd6a0b78b091b613d7c4d8eb95231533
Reviewed-on: https://github.com/flang-compiler/f18/pull/59