Commit Graph

284 Commits

Author SHA1 Message Date
Stephane Chauveau cb463ab27b [flang] add fummy cc file for experiment
Original-commit: flang-compiler/f18@3972ad954b
Reviewed-on: https://github.com/flang-compiler/f18/pull/24
Tree-same-pre-rewrite: false
2018-03-26 16:35:34 +02:00
Stephane Chauveau fc2ec6a68b [flang] commit before rebase
Original-commit: flang-compiler/f18@8366a87e47
Reviewed-on: https://github.com/flang-compiler/f18/pull/24
Tree-same-pre-rewrite: false
2018-03-26 16:35:34 +02:00
peter klausler 0983fbc3d6 [flang] More f90_correct work.
Original-commit: flang-compiler/f18@92b68f705f
Reviewed-on: https://github.com/flang-compiler/f18/pull/26
Tree-same-pre-rewrite: false
2018-03-16 16:13:49 -07:00
peter klausler cbf39d56d4 [flang] Do not forget to run the linker even if there was nothing to compile.
Original-commit: flang-compiler/f18@4f4f853e5b
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
2018-03-15 12:22:41 -07:00
peter klausler d71f3cf532 [flang] More unparsing.
Original-commit: flang-compiler/f18@a3ef9de518
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false
2018-03-14 16:31:41 -07:00
peter klausler b7cf512e0d [flang] Incorporate more code review comments, fix more f90.
Original-commit: flang-compiler/f18@2428121ab4
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false
2018-03-14 15:31:16 -07:00
peter klausler 79d044e9b5 [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@8a1a0aa2dc
Reviewed-on: https://github.com/flang-compiler/f18/pull/25
Tree-same-pre-rewrite: false
2018-03-13 16:32:09 -07:00
Tim Keith 600788e5f7 [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@859e7e2665
Reviewed-on: https://github.com/flang-compiler/f18/pull/23
Tree-same-pre-rewrite: false
2018-03-01 15:24:35 -08:00
peter klausler 20364f0351 [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@685ddb91ce
Reviewed-on: https://github.com/flang-compiler/f18/pull/22
2018-03-01 13:35:58 -08:00
peter klausler 1b0705ca0f [flang] Fix parsing error on PROCEDURE statement in derived type definition.
Improve error recovery in that context.

Original-commit: flang-compiler/f18@b9e48504e6
Reviewed-on: https://github.com/flang-compiler/f18/pull/21
2018-03-01 11:28:13 -08:00
peter klausler 03aecfc336 [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@d6bfcfd526
Reviewed-on: https://github.com/flang-compiler/f18/pull/16
2018-02-26 15:31:46 -08:00
Tim Keith 2af29bc1e2 [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@e80c13ec88
Reviewed-on: https://github.com/flang-compiler/f18/pull/15
2018-02-26 14:52:27 -08:00
Tim Keith 2ca306abe1 [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@a6ea1296b1
Reviewed-on: https://github.com/flang-compiler/f18/pull/15
Tree-same-pre-rewrite: false
2018-02-26 14:52:27 -08:00
Tim Keith 9f07a4a3d8 [flang] First implementation of a parse tree visitor
Original-commit: flang-compiler/f18@0b441831f4
Reviewed-on: https://github.com/flang-compiler/f18/pull/15
Tree-same-pre-rewrite: false
2018-02-26 14:52:27 -08:00
Stephane Chauveau 8f6f23fc54 [flang] Add simple recursive CMake directory structure
Original-commit: flang-compiler/f18@a021b2ca76
Reviewed-on: https://github.com/flang-compiler/f18/pull/13
Tree-same-pre-rewrite: false
2018-02-19 14:28:12 +01:00
peter klausler 7af9dd8736 [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@41717531e5
Reviewed-on: https://github.com/flang-compiler/f18/pull/11
Tree-same-pre-rewrite: false
2018-02-16 10:41:16 -08:00
peter klausler fcb6b2a558 [flang] Remove a temporary #include <iostream> and auto-detect -Mfixed from a .f suffix.
Original-commit: flang-compiler/f18@962c7ed0ef
Reviewed-on: https://github.com/flang-compiler/f18/pull/10
2018-02-15 17:12:50 -08:00
peter klausler 6595462268 [flang] Complete merge of provenance feature.
Original-commit: flang-compiler/f18@646f68be61
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler edbec459fb [flang] Complete provenance tracking through macro calls.
Original-commit: flang-compiler/f18@8c05a6543b
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler 67d916f8ba [flang] More precise source locations on error messages. Anticipate module file scanning.
Original-commit: flang-compiler/f18@f4faadd389
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler 10a36336df [flang] Implement a directory search path for INCLUDE lines.
Original-commit: flang-compiler/f18@62129e5600
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler fe04c3a02f [flang] Implement Fortran INCLUDE lines.
Original-commit: flang-compiler/f18@d01af89506
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler 5b61beaa12 [flang] Preparatory work for file inclusion.
Original-commit: flang-compiler/f18@1cbbd4a357
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler 97a7c501dc [flang] Forge provenances for compiler-inserted text.
Original-commit: flang-compiler/f18@dbdd01aa25
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler 3bca5d088e [flang] Restructure inter-class references for clarity.
Original-commit: flang-compiler/f18@1836cd5d06
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler 90c3cad9a7 [flang] Debugging new provenance support.
Original-commit: flang-compiler/f18@1233f666da
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler 09865ffe7b [flang] Replace Position with Provenance everywhere.
Original-commit: flang-compiler/f18@8c2da3f8cc
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
Tim Keith 4a735b61c6 [flang] Rename methods with uppercase names.
Original-commit: flang-compiler/f18@00fec54e5a
Reviewed-on: https://github.com/flang-compiler/f18/pull/8
2018-02-15 08:27:19 -08:00
Tim Keith e8707d3706 [flang] Add test-type.cc to build types from parse tree.
Original-commit: flang-compiler/f18@47101317fb
Reviewed-on: https://github.com/flang-compiler/f18/pull/8
Tree-same-pre-rewrite: false
2018-02-14 15:29:18 -08:00
Steve Scalpone ac364b1786 [flang] Revert "Schauveau cmake"
Original-commit: flang-compiler/f18@be33dc182a
Reviewed-on: https://github.com/flang-compiler/f18/pull/7
2018-02-14 09:06:47 -08:00
Stephane Chauveau ab1dbce5a4 [flang] after clang-format
Original-commit: flang-compiler/f18@7e464a7c33
Reviewed-on: https://github.com/flang-compiler/f18/pull/6
Tree-same-pre-rewrite: false
2018-02-09 10:09:20 +01:00
Stephane Chauveau c27603ec9c [flang] Add new global CMakefile infrastructure with examples
Original-commit: flang-compiler/f18@81b91f3270
Reviewed-on: https://github.com/flang-compiler/f18/pull/6
Tree-same-pre-rewrite: false
2018-02-09 10:09:20 +01:00
peter klausler 14322536e3 [flang] Tweaked .clang-format, then ran it.
Original-commit: flang-compiler/f18@e10e43b691
Reviewed-on: https://github.com/flang-compiler/f18/pull/4
2018-02-07 12:27:36 -08:00
peter klausler 0ba1a14be2 [flang] Impose a directory structure. Move files around. Introduce
an intermediate "parser" namespace.

Original-commit: flang-compiler/f18@690b6f0d1e
Reviewed-on: https://github.com/flang-compiler/f18/pull/4
Tree-same-pre-rewrite: false
2018-02-07 12:04:42 -08:00