platform/upstream/llvm.git
6 years ago[flang] Update formatting
Steve Scalpone [Thu, 22 Mar 2018 05:42:05 +0000 (22:42 -0700)]
[flang] Update formatting

Extract questions and rationals from the step-wise descriptions.

Original-commit: flang-compiler/f18@38f49e08948516df26a733d74df2d95872cda73f
Reviewed-on: https://github.com/flang-compiler/f18/pull/28
Tree-same-pre-rewrite: false

6 years ago[flang] Add semantics documentation
Steve Scalpone [Tue, 20 Mar 2018 22:47:52 +0000 (15:47 -0700)]
[flang] Add semantics documentation

Overview of scoping, symbols, and basic semantics.

Original-commit: flang-compiler/f18@b28880a361c1a0df84fedccb56e2d6bf4dd17f4f
Reviewed-on: https://github.com/flang-compiler/f18/pull/28
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#26 from ThePortlandGroup/pmk-f90
Peter Klausler [Tue, 20 Mar 2018 17:17:05 +0000 (10:17 -0700)]
[flang] Merge pull request flang-compiler/f18#26 from ThePortlandGroup/pmk-f90

More fixes for bugs found by running f90_correct tests.

Original-commit: flang-compiler/f18@5e27ec4ab9b8ebc34c9969d3baa5beec4e4557af
Reviewed-on: https://github.com/flang-compiler/f18/pull/26

6 years ago[flang] Make unreadable code less so, per review comments.
peter klausler [Mon, 19 Mar 2018 23:17:23 +0000 (16:17 -0700)]
[flang] Make unreadable code less so, per review comments.

Original-commit: flang-compiler/f18@78073c15a5fa74c0a45b9bbb127ff9bdc1158ecd
Reviewed-on: https://github.com/flang-compiler/f18/pull/26

6 years ago[flang] Improve preprocessor error message provenances, pass f90_correct test pre21.
peter klausler [Mon, 19 Mar 2018 18:48:49 +0000 (11:48 -0700)]
[flang] Improve preprocessor error message provenances, pass f90_correct test pre21.

Original-commit: flang-compiler/f18@af5943e3bce4961594bd06c575a24ea51f0881a7
Reviewed-on: https://github.com/flang-compiler/f18/pull/26
Tree-same-pre-rewrite: false

6 years ago[flang] Pass as much of f90_correct as I think we can.
peter klausler [Fri, 16 Mar 2018 23:58:35 +0000 (16:58 -0700)]
[flang] Pass as much of f90_correct as I think we can.

Original-commit: flang-compiler/f18@6d101d3ec8dae923c8445a36f87e81a9ee2deb68
Reviewed-on: https://github.com/flang-compiler/f18/pull/26
Tree-same-pre-rewrite: false

6 years ago[flang] More f90_correct work.
peter klausler [Fri, 16 Mar 2018 23:13:49 +0000 (16:13 -0700)]
[flang] More f90_correct work.

Original-commit: flang-compiler/f18@92b68f705f82783c543dd3c952ab09bafd4765a7
Reviewed-on: https://github.com/flang-compiler/f18/pull/26
Tree-same-pre-rewrite: false

6 years ago[flang] More f90_correct work.
peter klausler [Fri, 16 Mar 2018 00:09:27 +0000 (17:09 -0700)]
[flang] More f90_correct work.

Original-commit: flang-compiler/f18@442771db3c24ed3b5482a0bfb016ea2ac0bb9556
Reviewed-on: https://github.com/flang-compiler/f18/pull/26
Tree-same-pre-rewrite: false

6 years ago[flang] Make previous commit more precise.
peter klausler [Thu, 15 Mar 2018 23:28:37 +0000 (16:28 -0700)]
[flang] Make previous commit more precise.

Original-commit: flang-compiler/f18@543da95754caf3719250b32da1d824e325e96bb1
Reviewed-on: https://github.com/flang-compiler/f18/pull/26
Tree-same-pre-rewrite: false

6 years ago[flang] Never emit :: when /-bracketed initializers appear on a type declaration...
peter klausler [Thu, 15 Mar 2018 23:22:38 +0000 (16:22 -0700)]
[flang] Never emit :: when /-bracketed initializers appear on a type declaration stmt.

Original-commit: flang-compiler/f18@2ed327a4f8c881a78f0a75e437cc6010046a03c3
Reviewed-on: https://github.com/flang-compiler/f18/pull/26
Tree-same-pre-rewrite: false

6 years ago[flang] Unparsing fixes, PGF90 bug work-arounds.
peter klausler [Thu, 15 Mar 2018 23:03:28 +0000 (16:03 -0700)]
[flang] Unparsing fixes, PGF90 bug work-arounds.

Original-commit: flang-compiler/f18@c9c98c0e5cedc3e1c6f01b86d1d87c22c960dded
Reviewed-on: https://github.com/flang-compiler/f18/pull/26
Tree-same-pre-rewrite: false

6 years ago[flang] Remove excess newlines from cooked source, no longer needed.
peter klausler [Thu, 15 Mar 2018 20:25:37 +0000 (13:25 -0700)]
[flang] Remove excess newlines from cooked source, no longer needed.

Original-commit: flang-compiler/f18@9330b0d7fd4dbab3265a4009b2697b28302605f8
Reviewed-on: https://github.com/flang-compiler/f18/pull/26
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#27 from ThePortlandGroup/pmk-doc
Peter Klausler [Tue, 20 Mar 2018 17:07:39 +0000 (10:07 -0700)]
[flang] Merge pull request flang-compiler/f18#27 from ThePortlandGroup/pmk-doc

New documentation

Original-commit: flang-compiler/f18@e3886bac53f7907e1cc1607021733e919e0025f4
Reviewed-on: https://github.com/flang-compiler/f18/pull/27

6 years ago[flang] Extend documentation.
peter klausler [Tue, 20 Mar 2018 16:58:45 +0000 (09:58 -0700)]
[flang] Extend documentation.

Original-commit: flang-compiler/f18@f0901673560d6c0484c225cfd6269f5174fab93f
Reviewed-on: https://github.com/flang-compiler/f18/pull/27

6 years ago[flang] Write documentation/preprocessing.md
peter klausler [Tue, 20 Mar 2018 00:10:53 +0000 (17:10 -0700)]
[flang] Write documentation/preprocessing.md

Original-commit: flang-compiler/f18@4c8f4a97ad4365f52e2af2bc9e11b41cdb1e5a5b
Reviewed-on: https://github.com/flang-compiler/f18/pull/27
Tree-same-pre-rewrite: false

6 years ago[flang] More typing into documentation/parsing.md
peter klausler [Mon, 19 Mar 2018 22:30:32 +0000 (15:30 -0700)]
[flang] More typing into documentation/parsing.md

Original-commit: flang-compiler/f18@73f68d0ea141041882822e0627060460b7d8aa7c
Reviewed-on: https://github.com/flang-compiler/f18/pull/27
Tree-same-pre-rewrite: false

6 years ago[flang] Initial cut at documentation/parsing.md
peter klausler [Mon, 19 Mar 2018 22:17:32 +0000 (15:17 -0700)]
[flang] Initial cut at documentation/parsing.md

Original-commit: flang-compiler/f18@5484515b09eef042f2b50ca2a054182cf2545c57
Reviewed-on: https://github.com/flang-compiler/f18/pull/27
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#25 from ThePortlandGroup/pmk-walk-unparse
Peter Klausler [Thu, 15 Mar 2018 19:25:20 +0000 (12:25 -0700)]
[flang] Merge pull request flang-compiler/f18#25 from ThePortlandGroup/pmk-walk-unparse

Take flang-compiler/f18#2 on unparsing, now using the new parse tree walker.

Original-commit: flang-compiler/f18@1f6c2c390e28beaf8f3954a92182de05b934d175
Reviewed-on: https://github.com/flang-compiler/f18/pull/25

6 years ago[flang] Do not forget to run the linker even if there was nothing to compile.
peter klausler [Thu, 15 Mar 2018 19:22:41 +0000 (12:22 -0700)]
[flang] Do not forget to run the linker even if there was nothing to compile.

Original-commit: flang-compiler/f18@4f4f853e5b6a75f0f0f0340266c9a0b8fdc1190a
Reviewed-on: https://github.com/flang-compiler/f18/pull/25

6 years ago[flang] Get clean parse-unparse-reparse-unparse on f90_correct too.
peter klausler [Thu, 15 Mar 2018 17:59:46 +0000 (10:59 -0700)]
[flang] Get clean parse-unparse-reparse-unparse on f90_correct too.

Original-commit: flang-compiler/f18@901a9e462c13e801e589cacdc049d319ceb2dcca
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false

6 years ago[flang] Fix regression from last commit on STAT=/ERRMSG=.
peter klausler [Thu, 15 Mar 2018 00:07:15 +0000 (17:07 -0700)]
[flang] Fix regression from last commit on STAT=/ERRMSG=.

Original-commit: flang-compiler/f18@f031d07c300c09d33ec383ff3fc257d08c7492d5
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false

6 years ago[flang] More f90 unparsing.
peter klausler [Thu, 15 Mar 2018 00:02:21 +0000 (17:02 -0700)]
[flang] More f90 unparsing.

Original-commit: flang-compiler/f18@b9991c1a04725466479783f8c6a1e2cf606342f6
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false

6 years ago[flang] More unparsing.
peter klausler [Wed, 14 Mar 2018 23:31:41 +0000 (16:31 -0700)]
[flang] More unparsing.

Original-commit: flang-compiler/f18@a3ef9de51854d3e0551f2fa2c18d221b7a049370
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false

6 years ago[flang] Incorporate more code review comments, fix more f90.
peter klausler [Wed, 14 Mar 2018 22:31:16 +0000 (15:31 -0700)]
[flang] Incorporate more code review comments, fix more f90.

Original-commit: flang-compiler/f18@2428121ab4d57ed12671ef78e18b5880c187dff6
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false

6 years ago[flang] Address review comments. Add note to style guide condemning if((x=y)).
peter klausler [Wed, 14 Mar 2018 00:20:40 +0000 (17:20 -0700)]
[flang] Address review comments.  Add note to style guide condemning if((x=y)).

Original-commit: flang-compiler/f18@4ca8b8e51402d94bb921c1993d15e2c1305baa46
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false

6 years ago[flang] Fix some F90 unparsings; address review comments.
peter klausler [Wed, 14 Mar 2018 00:11:26 +0000 (17:11 -0700)]
[flang] Fix some F90 unparsings; address review comments.

Original-commit: flang-compiler/f18@af33f37600e6c88f9745c9ae0400e99719819652
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false

6 years ago[flang] Start on f90_correct. Incorporate review comments.
peter klausler [Tue, 13 Mar 2018 23:59:30 +0000 (16:59 -0700)]
[flang] Start on f90_correct.  Incorporate review comments.

Original-commit: flang-compiler/f18@3f8cecef8efe49778e25a2ab04269b4c07ac6d07
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false

6 years ago[flang] Bugfixing and review comments.
peter klausler [Tue, 13 Mar 2018 23:47:48 +0000 (16:47 -0700)]
[flang] Bugfixing and review comments.

Original-commit: flang-compiler/f18@29cabc71005bb24b8de146c97fa4fe4c4ca3e5f2
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false

6 years ago[flang] Take flang-compiler/f18#2 on unparsing, now using the new parse tree walker.
peter klausler [Thu, 1 Mar 2018 00:56:10 +0000 (16:56 -0800)]
[flang] Take flang-compiler/f18#2 on unparsing, now using the new parse tree walker.

Clean out old data structure formatter.

Create stand-alone Parsing class to compose parts of the parser together.

Hello, world!

Better error recovery on command line errors.

Fix bugs from initial run at f77_correct.

Allow parentheses on PROGRAM statement.

Fix Hollerith scanning.

Remove REDIMENSION with good error recovery.

Fix new "spaces" parser, clean up calls to it.

Fix bugs exposed by in38.f90.

Escaped \a is not special to pgf90; get slashes around STRUCTURE name right.

Better multi-byte source encoding support in Hollerith.

Reformat C++.

More work on multi-byte source encoding.

Pass 219 tests in f77_correct, with good excuses for the rest.

Original-commit: flang-compiler/f18@8a1a0aa2dc5b4ba3fba2116d278affb51857ffb7
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#23 from ThePortlandGroup/tsk4
Tim Keith [Fri, 2 Mar 2018 02:09:18 +0000 (18:09 -0800)]
[flang] Merge pull request flang-compiler/f18#23 from ThePortlandGroup/tsk4

Add MakeTypes to build types using visitor.

Original-commit: flang-compiler/f18@30a4b46d4b9eded542a8beac0e66a88539986d99
Reviewed-on: https://github.com/flang-compiler/f18/pull/23

6 years ago[flang] Replace raw pointers with std::unique_ptr.
Tim Keith [Fri, 2 Mar 2018 02:04:05 +0000 (18:04 -0800)]
[flang] Replace raw pointers with std::unique_ptr.

This simplifies the "delete and set to null" pattern to just a call to
reset(), and "assign and set to null" to a call to std::move.

The ideal would be a custom deleter that throws an error when an
implicit delete happens but not when reset() is called, but I'm not sure
that's possible.

Original-commit: flang-compiler/f18@f618fc729a5b92b036437ec9828788823ce88f13
Reviewed-on: https://github.com/flang-compiler/f18/pull/23

6 years ago[flang] Add MakeTypes to build types using visitor.
Tim Keith [Thu, 1 Mar 2018 23:24:35 +0000 (15:24 -0800)]
[flang] Add MakeTypes to build types using visitor.

This replaces the manual walking code in test-type.cc. It walks the
parse tree and constructs DeclTypeSpec and DerivedTypeDef objects for
each type encountered. It's in a new file, make-types.cc, so that
failing compilations complete faster.

Handle more parts of derived type definitions.

Also some minor cleanups in type.h and type.cc.

Original-commit: flang-compiler/f18@859e7e2665e0d66c583ffcb7c74265813c25967c
Reviewed-on: https://github.com/flang-compiler/f18/pull/23
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#22 from ThePortlandGroup/pmk-fix2
Peter Klausler [Thu, 1 Mar 2018 22:47:28 +0000 (14:47 -0800)]
[flang] Merge pull request flang-compiler/f18#22 from ThePortlandGroup/pmk-fix2

Ensure that the parse tree visitation Walk template works on FORMAT.

Original-commit: flang-compiler/f18@e693dd320d496db24e8241d6a0f6627036304769
Reviewed-on: https://github.com/flang-compiler/f18/pull/22

6 years ago[flang] Ensure that the parse tree visitation Walk template works on FORMAT.
peter klausler [Thu, 1 Mar 2018 21:23:31 +0000 (13:23 -0800)]
[flang] Ensure that the parse tree visitation Walk template works on FORMAT.
The classes that were segregated into format-specification.h have
also been grouped into a new Fortran::format namespace.
Code added to tools/f18/f18.cc to run a minimal visitor over
the parse trees resulting from successful parses so that any
future build problems with Walk() will be caught earlier.

Rearrange Walk instances, keep format:: ones together.

Original-commit: flang-compiler/f18@685ddb91ceb2217877a887eca14a63a4b725ea12
Reviewed-on: https://github.com/flang-compiler/f18/pull/22

6 years ago[flang] Merge pull request flang-compiler/f18#21 from ThePortlandGroup/pmk-fix
Peter Klausler [Thu, 1 Mar 2018 21:34:48 +0000 (13:34 -0800)]
[flang] Merge pull request flang-compiler/f18#21 from ThePortlandGroup/pmk-fix

Fix parsing error on PROCEDURE statement in derived type definition.

Original-commit: flang-compiler/f18@e9c218df4271dbc88aa44c01f90f6119abb43115
Reviewed-on: https://github.com/flang-compiler/f18/pull/21

6 years ago[flang] Fix parsing error on PROCEDURE statement in derived type definition.
peter klausler [Thu, 1 Mar 2018 19:28:13 +0000 (11:28 -0800)]
[flang] Fix parsing error on PROCEDURE statement in derived type definition.
Improve error recovery in that context.

Original-commit: flang-compiler/f18@b9e48504e61132c97dfe09fa85732ddfa97078a6
Reviewed-on: https://github.com/flang-compiler/f18/pull/21

6 years ago[flang] Merge pull request flang-compiler/f18#20 from ThePortlandGroup/pmk-traits
Peter Klausler [Wed, 28 Feb 2018 22:59:03 +0000 (14:59 -0800)]
[flang] Merge pull request flang-compiler/f18#20 from ThePortlandGroup/pmk-traits

Trait-based parse tree traversal.

Original-commit: flang-compiler/f18@0f8a4aaf07ac198a3b36fc1689c4c57faa7b2f44
Reviewed-on: https://github.com/flang-compiler/f18/pull/20

6 years ago[flang] Follow own new style rule about returns and elses.
peter klausler [Wed, 28 Feb 2018 22:55:45 +0000 (14:55 -0800)]
[flang] Follow own new style rule about returns and elses.

Original-commit: flang-compiler/f18@665fdf72d13314297605285c9ba4c6089418f270
Reviewed-on: https://github.com/flang-compiler/f18/pull/20

6 years ago[flang] Run clang-format.
peter klausler [Wed, 28 Feb 2018 22:53:04 +0000 (14:53 -0800)]
[flang] Run clang-format.

Original-commit: flang-compiler/f18@cd52d99f219be0f37c36cf644f4bffae3b537f31
Reviewed-on: https://github.com/flang-compiler/f18/pull/20
Tree-same-pre-rewrite: false

6 years ago[flang] Improvements suggested by Tim.
peter klausler [Wed, 28 Feb 2018 22:51:45 +0000 (14:51 -0800)]
[flang] Improvements suggested by Tim.

Original-commit: flang-compiler/f18@c3d2e3e745187425655ce1122a0d959ca3f99988
Reviewed-on: https://github.com/flang-compiler/f18/pull/20
Tree-same-pre-rewrite: false

6 years ago[flang] Trait-based parse tree traversal.
peter klausler [Wed, 28 Feb 2018 21:24:01 +0000 (13:24 -0800)]
[flang] Trait-based parse tree traversal.
Add a CLASS_TRAIT macro to idioms.h to define template metaprogramming
based on definable traits of user-defined classes.  Tweak the boilerplate
macros in parse-tree.h to add traits to the empty, wrapper, union, and
tuple classes in the parse tree.  Replace the macros in parse-tree-visitor.h
with trait-driven templates.

Original-commit: flang-compiler/f18@02400146fbebc8ef6d608699153146721a40dc37
Reviewed-on: https://github.com/flang-compiler/f18/pull/20
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#18 from ThePortlandGroup/tsk1
Tim Keith [Wed, 28 Feb 2018 00:52:29 +0000 (16:52 -0800)]
[flang] Merge pull request flang-compiler/f18#18 from ThePortlandGroup/tsk1

Use macros to reduce boilerplate.

Original-commit: flang-compiler/f18@b9f25364a8b201ab71f6208f1923d8ca8670595a
Reviewed-on: https://github.com/flang-compiler/f18/pull/18

6 years ago[flang] Use macros to reduce boilerplate.
Tim Keith [Tue, 27 Feb 2018 00:58:44 +0000 (16:58 -0800)]
[flang] Use macros to reduce boilerplate.

The common cases of wrapper, tuple, and union classes can be further
reduced by using macros to define the Walk functions.

Original-commit: flang-compiler/f18@29e02c48869e48256e277635ccb1618804e47396
Reviewed-on: https://github.com/flang-compiler/f18/pull/18

6 years ago[flang] Merge pull request flang-compiler/f18#19 from ThePortlandGroup/pmk-fix-master
Peter Klausler [Wed, 28 Feb 2018 00:35:08 +0000 (16:35 -0800)]
[flang] Merge pull request flang-compiler/f18#19 from ThePortlandGroup/pmk-fix-master

Fix some bugs that I noticed while running regression tests.

Original-commit: flang-compiler/f18@0d6c927f8fa0fbf94a11484d4f58100331b46fe5
Reviewed-on: https://github.com/flang-compiler/f18/pull/19

6 years ago[flang] Fix test: do not allow & as continuation marker in fixed form if in a charact...
peter klausler [Wed, 28 Feb 2018 00:33:10 +0000 (16:33 -0800)]
[flang] Fix test: do not allow & as continuation marker in fixed form if in a character literal.

Original-commit: flang-compiler/f18@26c07eb2e5d2b9af67f41aba82955acadfbb019a
Reviewed-on: https://github.com/flang-compiler/f18/pull/19

6 years ago[flang] Fix some bugs that I noticed while running regression tests.
peter klausler [Tue, 27 Feb 2018 22:02:10 +0000 (14:02 -0800)]
[flang] Fix some bugs that I noticed while running regression tests.
Add characters.h to consolidate all per-character functions
and reduce dependence on <cctype>.
Add omitted DIRECT= and UNFORMATTED= specifiers to INQUIRE statement.
Add Interval<>, rebase ProvenanceRange upon it, rebase CharPointerWithLength
and rename it ContiguousChars.
Reformat C++.

Original-commit: flang-compiler/f18@78c73c62badb3f2c32a931bbcdf0dec6b26b0312
Reviewed-on: https://github.com/flang-compiler/f18/pull/19
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#16 from ThePortlandGroup/pmk-minor
Peter Klausler [Tue, 27 Feb 2018 00:00:43 +0000 (16:00 -0800)]
[flang] Merge pull request flang-compiler/f18#16 from ThePortlandGroup/pmk-minor

Preserve some minor changes...

Original-commit: flang-compiler/f18@7b3e4908bdc588e4531af5061f628c7c088bcb96
Reviewed-on: https://github.com/flang-compiler/f18/pull/16

6 years ago[flang] Preserve some minor changes that accumulated as I was implementing
peter klausler [Fri, 16 Feb 2018 19:14:11 +0000 (11:14 -0800)]
[flang] Preserve some minor changes that accumulated as I was implementing
an unparsing feature.

Enum classes in parse tree node class types are now defined with
a macro so that the names of the enumerations can be captured for
formatting purposes.

Add a TODO comment.

Rebase to new master with parse tree traversal code.

Original-commit: flang-compiler/f18@d6bfcfd526cc8464046e855181b7771631793313
Reviewed-on: https://github.com/flang-compiler/f18/pull/16

6 years ago[flang] Merge pull request flang-compiler/f18#17 from ThePortlandGroup/tsk1
Tim Keith [Mon, 26 Feb 2018 23:12:10 +0000 (15:12 -0800)]
[flang] Merge pull request flang-compiler/f18#17 from ThePortlandGroup/tsk1

Fix classes with variant and other fields

Original-commit: flang-compiler/f18@1c2f9e8e8a68397c038c1924444352468a808046
Reviewed-on: https://github.com/flang-compiler/f18/pull/17

6 years ago[flang] Fix classes with variant and other fields
Tim Keith [Mon, 26 Feb 2018 23:07:24 +0000 (15:07 -0800)]
[flang] Fix classes with variant and other fields

Fortran::FormatItem and UseStmt have both normal fields and a variant
named 'u'. The Walk calls for the normal fields were missing.
These were the only two classes I found where this occurs.

Original-commit: flang-compiler/f18@23b8695a74631e0207f7c87be5c602896a9f0880
Reviewed-on: https://github.com/flang-compiler/f18/pull/17

6 years ago[flang] Merge pull request flang-compiler/f18#15 from ThePortlandGroup/tsk1
Tim Keith [Mon, 26 Feb 2018 22:52:27 +0000 (14:52 -0800)]
[flang] Merge pull request flang-compiler/f18#15 from ThePortlandGroup/tsk1

First implementation of a parse tree visitor

Original-commit: flang-compiler/f18@b9a9d249f3178a5ca6883aaef5fdceda3e988c4b
Reviewed-on: https://github.com/flang-compiler/f18/pull/15

6 years ago[flang] Add Unparse function.
Tim Keith [Mon, 26 Feb 2018 22:28:32 +0000 (14:28 -0800)]
[flang] Add Unparse function.

Unparse takes a parse tree and converts it back to Fortran.
class UnparseVisitor implements a parse tree visitor that emits
the appropriate Fortran source for each node that it visits.
It is only partially implemented so far.

Change f18 to dump the parse tree using Unparse.

Original-commit: flang-compiler/f18@e80c13ec88811fbf5101cede385aca219f15ead7
Reviewed-on: https://github.com/flang-compiler/f18/pull/15

6 years ago[flang] Reorder the Walk functions.
Tim Keith [Mon, 26 Feb 2018 22:22:58 +0000 (14:22 -0800)]
[flang] Reorder the Walk functions.

Group the Walk functions that call WalkTupleClass, WalkUnionClass,
WalkWrapperClass all together, after the ones that don't follow a
simple pattern like that.

Fix the name of the include guard macro.

Original-commit: flang-compiler/f18@711613a4adaaf6083966b3993472dc74e97ba026
Reviewed-on: https://github.com/flang-compiler/f18/pull/15
Tree-same-pre-rewrite: false

6 years ago[flang] Add some missing Walk functions.
Tim Keith [Sun, 25 Feb 2018 15:35:56 +0000 (07:35 -0800)]
[flang] Add some missing Walk functions.

The classes in parse-tree.h that used WRAPPER_CLASS_BOILERPLATE were
accidentally omitted.

Also remove the anonymous namespace around utilities like
WalkWrapperClass as they can be useful outside this file too.

Original-commit: flang-compiler/f18@d47c505441f6a4baec1345839a53abaf1b9fe668
Reviewed-on: https://github.com/flang-compiler/f18/pull/15
Tree-same-pre-rewrite: false

6 years ago[flang] Rename "visit" to "Walk" to avoid conflict with std::visit.
Tim Keith [Sat, 24 Feb 2018 00:03:16 +0000 (16:03 -0800)]
[flang] Rename "visit" to "Walk" to avoid conflict with std::visit.

The thing called on each parse tree node during the walk is still
referred to as a visitor.

Change "pre" to "Pre" and "post" to "Post" to follow the naming
conventions.

Original-commit: flang-compiler/f18@a6ea1296b150db45495b2bbd06b45432fa009c53
Reviewed-on: https://github.com/flang-compiler/f18/pull/15
Tree-same-pre-rewrite: false

6 years ago[flang] Add helpers for wrapper/tuple/variant classes.
Tim Keith [Fri, 23 Feb 2018 22:52:13 +0000 (14:52 -0800)]
[flang] Add helpers for wrapper/tuple/variant classes.

Add VisitWrapperClass, VisitTupleClass, and VisitVariantClass to
simplify the common cases in the parse tree. ForEachInTuple is used to
implement VisitTupleClass.

Original-commit: flang-compiler/f18@c6ae2b833b5a12c9429f7af39806a8483b5c0394
Reviewed-on: https://github.com/flang-compiler/f18/pull/15
Tree-same-pre-rewrite: false

6 years ago[flang] First implementation of a parse tree visitor
Tim Keith [Fri, 23 Feb 2018 01:00:56 +0000 (17:00 -0800)]
[flang] First implementation of a parse tree visitor

Original-commit: flang-compiler/f18@0b441831f455b9458a943090d7e9ed334aaf159c
Reviewed-on: https://github.com/flang-compiler/f18/pull/15
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#13 from ThePortlandGroup/sch1
Stephane Chauveau [Thu, 22 Feb 2018 10:24:53 +0000 (11:24 +0100)]
[flang] Merge pull request flang-compiler/f18#13 from ThePortlandGroup/sch1

Add simple recursive CMake directory structure

Original-commit: flang-compiler/f18@c20c4a34ffcdae6aa6575a64c9f1a83b906e35e0
Reviewed-on: https://github.com/flang-compiler/f18/pull/13

6 years ago[flang] Add missing include config file skeleton
Stephane Chauveau [Mon, 19 Feb 2018 13:44:54 +0000 (14:44 +0100)]
[flang] Add missing include config file skeleton

Original-commit: flang-compiler/f18@beb71e4e4bb75e04a60813cc2318b842c05e5613
Reviewed-on: https://github.com/flang-compiler/f18/pull/13

6 years ago[flang] Add simple recursive CMake directory structure
Stephane Chauveau [Mon, 19 Feb 2018 13:28:12 +0000 (14:28 +0100)]
[flang] Add simple recursive CMake directory structure

Original-commit: flang-compiler/f18@a021b2ca768c2b8c03d626739d0754ba99e463d2
Reviewed-on: https://github.com/flang-compiler/f18/pull/13
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#14 from ThePortlandGroup/pmk-msg
klausler [Wed, 21 Feb 2018 21:45:47 +0000 (13:45 -0800)]
[flang] Merge pull request flang-compiler/f18#14 from ThePortlandGroup/pmk-msg

Put localization markers on the string literals used for messages.

Original-commit: flang-compiler/f18@93089c2bc6063674add0ec1567acd7676a5a1f95
Reviewed-on: https://github.com/flang-compiler/f18/pull/14

6 years ago[flang] Support localizable formatted messages.
peter klausler [Wed, 21 Feb 2018 20:12:52 +0000 (12:12 -0800)]
[flang] Support localizable formatted messages.

Original-commit: flang-compiler/f18@e974321494b4fcecdb9bd0a5f82f0624c1a33696
Reviewed-on: https://github.com/flang-compiler/f18/pull/14

6 years ago[flang] Fix bug with "expected ..." messages in token strings.
peter klausler [Tue, 20 Feb 2018 18:35:04 +0000 (10:35 -0800)]
[flang] Fix bug with "expected ..." messages in token strings.

Original-commit: flang-compiler/f18@9cc84ba6fbbaed94481ec7781e124a7f4881a7b2
Reviewed-on: https://github.com/flang-compiler/f18/pull/14
Tree-same-pre-rewrite: false

6 years ago[flang] Use "..."_en_US for messages.
peter klausler [Tue, 20 Feb 2018 17:57:30 +0000 (09:57 -0800)]
[flang] Use "..."_en_US for messages.

Original-commit: flang-compiler/f18@fffa8815762a7fa449863a6fa0f7c4b72bd0d4e4
Reviewed-on: https://github.com/flang-compiler/f18/pull/14
Tree-same-pre-rewrite: false

6 years ago[flang] Convert all messages to MessageTexts ("..."_msg).
peter klausler [Sat, 17 Feb 2018 00:57:40 +0000 (16:57 -0800)]
[flang] Convert all messages to MessageTexts ("..."_msg).

Original-commit: flang-compiler/f18@33357f3657a6fea91af8cf8b5fd30b4be9efcdd0
Reviewed-on: https://github.com/flang-compiler/f18/pull/14
Tree-same-pre-rewrite: false

6 years ago[flang] Define MessageText and "..."_msg.
peter klausler [Fri, 16 Feb 2018 23:47:30 +0000 (15:47 -0800)]
[flang] Define MessageText and "..."_msg.

Original-commit: flang-compiler/f18@6e9e16431c3de9b48bfa50dc489f7ddf73d783e4
Reviewed-on: https://github.com/flang-compiler/f18/pull/14
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#12 from ThePortlandGroup/pmk1
klausler [Fri, 16 Feb 2018 19:49:47 +0000 (11:49 -0800)]
[flang] Merge pull request flang-compiler/f18#12 from ThePortlandGroup/pmk1

Update the header file guards in lib/parser to reflect the introducti…

Original-commit: flang-compiler/f18@5ad8f67f4ac7eccd424138e3a1591217b07f7930
Reviewed-on: https://github.com/flang-compiler/f18/pull/12

6 years ago[flang] Update the header file guards in lib/parser to reflect the introduction of...
peter klausler [Fri, 16 Feb 2018 19:42:17 +0000 (11:42 -0800)]
[flang] Update the header file guards in lib/parser to reflect the introduction of the parser namespace.

Original-commit: flang-compiler/f18@a11bb88396d6d074e0b55cf5ec19b0ddfb52a8fc
Reviewed-on: https://github.com/flang-compiler/f18/pull/12

6 years ago[flang] Merge pull request flang-compiler/f18#11 from ThePortlandGroup/pmk1
klausler [Fri, 16 Feb 2018 19:03:54 +0000 (11:03 -0800)]
[flang] Merge pull request flang-compiler/f18#11 from ThePortlandGroup/pmk1

Remove old character "cooking" parser combinators

Original-commit: flang-compiler/f18@def973c39c613ad1f26a1ef2de49fdbd7c3d4934
Reviewed-on: https://github.com/flang-compiler/f18/pull/11

6 years ago[flang] Reformatting and some comment clean-up.
peter klausler [Fri, 16 Feb 2018 18:58:17 +0000 (10:58 -0800)]
[flang] Reformatting and some comment clean-up.

Original-commit: flang-compiler/f18@cedd3d82cf5aef7ba2bddfa4e13f13efac5600a7
Reviewed-on: https://github.com/flang-compiler/f18/pull/11

6 years ago[flang] Remove old character "cooking" parser combinators that handled Fortran
peter klausler [Fri, 16 Feb 2018 18:41:16 +0000 (10:41 -0800)]
[flang] Remove old character "cooking" parser combinators that handled Fortran
comments, continuations, &c. that have become obsolete with the use
of the new C++-coded prescanner module.  Clean out members from
ParseState that were used only by cookedNextChar and its sub-parsers.

Original-commit: flang-compiler/f18@41717531e5eb17dc4f090babbeb63745397d80cc
Reviewed-on: https://github.com/flang-compiler/f18/pull/11
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#10 from ThePortlandGroup/pmk2
klausler [Fri, 16 Feb 2018 17:25:44 +0000 (09:25 -0800)]
[flang] Merge pull request flang-compiler/f18#10 from ThePortlandGroup/pmk2

Remove a temporary #include <iostream> and auto-detect -Mfixed

Original-commit: flang-compiler/f18@93ecf8d908eafc65da3f0e3d1da00f119d12a86b
Reviewed-on: https://github.com/flang-compiler/f18/pull/10

6 years ago[flang] Remove a temporary #include <iostream> and auto-detect -Mfixed from a .f...
peter klausler [Fri, 16 Feb 2018 01:12:50 +0000 (17:12 -0800)]
[flang] Remove a temporary #include <iostream> and auto-detect -Mfixed from a .f suffix.

Original-commit: flang-compiler/f18@962c7ed0ef01a9904e7ccf0d2850b38d0c6bb46e
Reviewed-on: https://github.com/flang-compiler/f18/pull/10

6 years ago[flang] Merge pull request flang-compiler/f18#9 from ThePortlandGroup/pmk1
klausler [Thu, 15 Feb 2018 23:58:44 +0000 (15:58 -0800)]
[flang] Merge pull request flang-compiler/f18#9 from ThePortlandGroup/pmk1

Implement source provenance tracking and file inclusion.

Original-commit: flang-compiler/f18@1eb7d6028c7bd1dea1b51e0ab097544627d722e7
Reviewed-on: https://github.com/flang-compiler/f18/pull/9

6 years ago[flang] Fix a couple bugs noticed while resolving merge.
peter klausler [Thu, 15 Feb 2018 23:56:50 +0000 (15:56 -0800)]
[flang] Fix a couple bugs noticed while resolving merge.

Original-commit: flang-compiler/f18@dbb32c60a6f9789d2a341959672fd4244a413d1d
Reviewed-on: https://github.com/flang-compiler/f18/pull/9

6 years ago[flang] Complete merge of provenance feature.
peter klausler [Thu, 15 Feb 2018 23:26:10 +0000 (15:26 -0800)]
[flang] Complete merge of provenance feature.

Original-commit: flang-compiler/f18@646f68be61b1bf0f653cc332a51374df71f0ed0b
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Markdown tweaks in documentation.
peter klausler [Wed, 7 Feb 2018 21:33:48 +0000 (13:33 -0800)]
[flang] Markdown tweaks in documentation.

Original-commit: flang-compiler/f18@044148ead21f18e16716d5bc30819525c79065d0
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Spruce up formatting of error message output.
peter klausler [Thu, 15 Feb 2018 21:36:50 +0000 (13:36 -0800)]
[flang] Spruce up formatting of error message output.

Original-commit: flang-compiler/f18@0750985bdf99e22bdbfbf3da793bd62f7c996425
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Complete provenance tracking through macro calls.
peter klausler [Thu, 15 Feb 2018 21:13:28 +0000 (13:13 -0800)]
[flang] Complete provenance tracking through macro calls.

Original-commit: flang-compiler/f18@8c05a6543b647299104ae07a6a248b67f13ee24e
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] More precise source locations on error messages. Anticipate module file...
peter klausler [Thu, 15 Feb 2018 18:42:36 +0000 (10:42 -0800)]
[flang] More precise source locations on error messages.  Anticipate module file scanning.

Original-commit: flang-compiler/f18@f4faadd3897fa90f705c50e432e1e7c7343f90cd
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Remove #includes that were used for debugging.
peter klausler [Wed, 14 Feb 2018 01:04:13 +0000 (17:04 -0800)]
[flang] Remove #includes that were used for debugging.

Original-commit: flang-compiler/f18@828ee8c2f0133515d260700e36590b83eaae57fc
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Support #include directive.
peter klausler [Wed, 14 Feb 2018 00:33:23 +0000 (16:33 -0800)]
[flang] Support #include directive.

Original-commit: flang-compiler/f18@909622d9b77f8b70188d977f768b784433f8a820
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Implement a directory search path for INCLUDE lines.
peter klausler [Tue, 13 Feb 2018 23:24:43 +0000 (15:24 -0800)]
[flang] Implement a directory search path for INCLUDE lines.

Original-commit: flang-compiler/f18@62129e56008acc02c894c3cf2b936f76dbfa0060
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Implement Fortran INCLUDE lines.
peter klausler [Tue, 13 Feb 2018 22:22:08 +0000 (14:22 -0800)]
[flang] Implement Fortran INCLUDE lines.

Original-commit: flang-compiler/f18@d01af8950628b51baee28b5c9b8052b09f2b0dbf
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Minor refactoring: extract TokenSequence into its own module.
peter klausler [Tue, 13 Feb 2018 20:50:47 +0000 (12:50 -0800)]
[flang] Minor refactoring: extract TokenSequence into its own module.

Original-commit: flang-compiler/f18@1b17b4a069d837f649192f0a6500e1c7ad76fad1
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Preparatory work for file inclusion.
peter klausler [Tue, 13 Feb 2018 20:24:54 +0000 (12:24 -0800)]
[flang] Preparatory work for file inclusion.

Original-commit: flang-compiler/f18@1cbbd4a3574c97de0157007234108012c87fbd3f
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Adjust CHECK() so that first token of program can begin with first character.
peter klausler [Tue, 13 Feb 2018 18:35:16 +0000 (10:35 -0800)]
[flang] Adjust CHECK() so that first token of program can begin with first character.

Original-commit: flang-compiler/f18@2b77e466ffaf3620638e166116a39d0f5bf09224
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Fix fixed form scanning, get tests passing again.
peter klausler [Tue, 13 Feb 2018 01:03:26 +0000 (17:03 -0800)]
[flang] Fix fixed form scanning, get tests passing again.

Original-commit: flang-compiler/f18@2c8ff18e988143f81b0e3216386caabc1a6feeb4
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Forge provenances for compiler-inserted text.
peter klausler [Mon, 12 Feb 2018 22:43:16 +0000 (14:43 -0800)]
[flang] Forge provenances for compiler-inserted text.

Original-commit: flang-compiler/f18@dbdd01aa258557d45816d1a1e0588553c16bef6a
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Fix macro definitions (broken by provenances earlier).
peter klausler [Mon, 12 Feb 2018 21:26:32 +0000 (13:26 -0800)]
[flang] Fix macro definitions (broken by provenances earlier).

Original-commit: flang-compiler/f18@3ed548b477e50f3a803b5e6fad05069351c37612
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Restructure inter-class references for clarity.
peter klausler [Mon, 12 Feb 2018 20:48:13 +0000 (12:48 -0800)]
[flang] Restructure inter-class references for clarity.

Original-commit: flang-compiler/f18@1836cd5d06e8cc0cc46fb9c954e9237337c0f5d3
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Fix column tracking in fixed form.
peter klausler [Mon, 12 Feb 2018 19:56:42 +0000 (11:56 -0800)]
[flang] Fix column tracking in fixed form.

Original-commit: flang-compiler/f18@8c9a1013fa0861496e22cafde5d3c5326fae9a3a
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Debugging new provenance support.
peter klausler [Fri, 9 Feb 2018 23:56:02 +0000 (15:56 -0800)]
[flang] Debugging new provenance support.

Original-commit: flang-compiler/f18@1233f666da21d88fb84968c1e46cddf45557d0a1
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Replace Position with Provenance everywhere.
peter klausler [Fri, 9 Feb 2018 22:04:11 +0000 (14:04 -0800)]
[flang] Replace Position with Provenance everywhere.

Original-commit: flang-compiler/f18@8c2da3f8cc687012756a85567553500fac64c824
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Development of character provenance.
peter klausler [Thu, 8 Feb 2018 00:24:02 +0000 (16:24 -0800)]
[flang] Development of character provenance.

Original-commit: flang-compiler/f18@88c532958006ad064cab88d2405055a456b07dcf
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Begin work on character provenances.
peter klausler [Wed, 7 Feb 2018 21:18:36 +0000 (13:18 -0800)]
[flang] Begin work on character provenances.

Original-commit: flang-compiler/f18@ea3c05af5a43396aad8e68fef1f068026a2d40e7
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#8 from ThePortlandGroup/tsk1
Tim Keith [Thu, 15 Feb 2018 17:08:15 +0000 (09:08 -0800)]
[flang] Merge pull request flang-compiler/f18#8 from ThePortlandGroup/tsk1

More work on types

Original-commit: flang-compiler/f18@f330b03fc206a1bc39cd46bf102db14a9f4d8b2a
Reviewed-on: https://github.com/flang-compiler/f18/pull/8

6 years ago[flang] Rename methods with uppercase names.
Tim Keith [Thu, 15 Feb 2018 16:27:19 +0000 (08:27 -0800)]
[flang] Rename methods with uppercase names.

Original-commit: flang-compiler/f18@00fec54e5af1b88c4844cbc1b7cc3243a3d34dbf
Reviewed-on: https://github.com/flang-compiler/f18/pull/8

6 years ago[flang] Add test-type.cc to build types from parse tree.
Tim Keith [Wed, 14 Feb 2018 23:29:18 +0000 (15:29 -0800)]
[flang] Add test-type.cc to build types from parse tree.

Original-commit: flang-compiler/f18@47101317fbe56c6ea9b947c6d0eef913abd310e1
Reviewed-on: https://github.com/flang-compiler/f18/pull/8
Tree-same-pre-rewrite: false

6 years ago[flang] Continue adding to type.h
Tim Keith [Wed, 14 Feb 2018 23:24:02 +0000 (15:24 -0800)]
[flang] Continue adding to type.h

New classes: Bound, DeclTypeSpec, ShapeSpec, ComponentArraySpec,
DataComponentDef, ProcDecl, ProcComponentDef, DerivedTypedef

Original-commit: flang-compiler/f18@a09d1e8c81145a0dc92a8e26c0ca5a6a622309fd
Reviewed-on: https://github.com/flang-compiler/f18/pull/8
Tree-same-pre-rewrite: false