Commit graph

200 commits

Author SHA1 Message Date
peter klausler eab946db74 [flang] Add documentation.
Original-commit: flang-compiler/f18@4114c9e695
Reviewed-on: https://github.com/flang-compiler/f18/pull/38
Tree-same-pre-rewrite: false
2018-04-02 17:00:28 -07:00
peter klausler b493458e00 [flang] More clean-up in token-parsers.h.
Original-commit: flang-compiler/f18@3202134542
Reviewed-on: https://github.com/flang-compiler/f18/pull/38
Tree-same-pre-rewrite: false
2018-04-02 16:44:34 -07:00
peter klausler 10907c73db [flang] Debugging and a TODO.
Original-commit: flang-compiler/f18@4fab40bc37
Reviewed-on: https://github.com/flang-compiler/f18/pull/38
Tree-same-pre-rewrite: false
2018-04-02 16:33:10 -07:00
peter klausler 1e1ea723c5 [flang] Better error recovery, some debugging.
Original-commit: flang-compiler/f18@b7509f0e5b
Reviewed-on: https://github.com/flang-compiler/f18/pull/38
Tree-same-pre-rewrite: false
2018-04-02 16:06:18 -07:00
peter klausler af22e07f71 [flang] Revamp messaging. Add ""_err_en_US to denote fatal error messages.
Original-commit: flang-compiler/f18@7ddc807a1b
Reviewed-on: https://github.com/flang-compiler/f18/pull/38
Tree-same-pre-rewrite: false
2018-04-02 15:51:04 -07:00
peter klausler bb273e9ecb [flang] Fix debug-parser.h after recent merge.
Original-commit: flang-compiler/f18@97b6df606c
Reviewed-on: https://github.com/flang-compiler/f18/pull/38
Tree-same-pre-rewrite: false
2018-04-02 11:52:53 -07:00
peter klausler 0fb7dca452 [flang] Fix indentation bug in unparsed output that I introduced in last merge.
Original-commit: flang-compiler/f18@aa0ba5acac
Reviewed-on: https://github.com/flang-compiler/f18/pull/38
Tree-same-pre-rewrite: false
2018-04-02 11:05:07 -07:00
peter klausler 6ec5f8fa2c [flang] Work around clang-format issue by using "auto" where type is obvious.
Original-commit: flang-compiler/f18@7499bccaa9
Reviewed-on: https://github.com/flang-compiler/f18/pull/38
Tree-same-pre-rewrite: false
2018-04-02 11:01:31 -07:00
Tim Keith dcc4dd8627 [flang] Fix bug parsing "implicit none(type)"
"implicit none(type)" was being recognized as "implicit none(external)".

Original-commit: flang-compiler/f18@0cc8867836
Reviewed-on: https://github.com/flang-compiler/f18/pull/36
2018-04-02 10:49:22 -07:00
Tim Keith fc89541e96 [flang] Respond to review comments.
Original-commit: flang-compiler/f18@d2497a6485
Reviewed-on: https://github.com/flang-compiler/f18/pull/36
Tree-same-pre-rewrite: false
2018-04-02 10:49:22 -07:00
Tim Keith 86726d8ee4 [flang] Continue work on name resolution
Enhance DeclTypeSpecVisitor to find derived-type-specs, including with
type parameter values.

Change DerivedTypeSpec so it only needs the name of the derived type,
not the definition, as that isn't necessarily known when we encounter
it.

Fix how memory is managed in DeclTypeSpec: Intrinsic type specs aren't a
problem -- they are one of a few types that live throughout the program.
Derived type specs are dynamically allocated and the memory is owned by
the DeclTypeSpec -- it allocates it when a DeclTypeSpec for a derived
type is created and deletes it when it is destroyed. Pass around
references to TypeSpecs rather than pointers as they can never be null.

In AttrsVisitor, DeclTypeSpecVisitor, ResolveNamesVisitor: make most
functions out-of-line to clean up the class declaration.

In AttrsVisitor, use preprocessor to simplify the simple case of
encountering a parse-tree class causing an attribute to be set.
Handle all such attributes.

Remove old testing code from type.cc.

Remove some of the declarations for IntExpr and IntConst -- they are
only placeholder classes anyway. Don't distinguish kind and length
parameter values.

Original-commit: flang-compiler/f18@e172b51212
Reviewed-on: https://github.com/flang-compiler/f18/pull/36
Tree-same-pre-rewrite: false
2018-04-02 10:49:22 -07:00
peter klausler 2b79b0bc67 [flang] Elide a useless local variable that used to be a formal argument.
Original-commit: flang-compiler/f18@419b5d07ee
Reviewed-on: https://github.com/flang-compiler/f18/pull/37
2018-03-30 17:03:02 -07:00
peter klausler d5a084c43a [flang] Debugging after testing. Take care of a TODO in the prescanner.
Original-commit: flang-compiler/f18@4c8181e106
Reviewed-on: https://github.com/flang-compiler/f18/pull/37
Tree-same-pre-rewrite: false
2018-03-30 16:21:12 -07:00
peter klausler 4e354d85ae [flang] Debugging, and resolve another TODO in unparse.cc.
Original-commit: flang-compiler/f18@edeb283cd5
Reviewed-on: https://github.com/flang-compiler/f18/pull/37
Tree-same-pre-rewrite: false
2018-03-30 15:23:37 -07:00
peter klausler f8c7fde5c2 [flang] Look for declared STRUCTURE component names after a . rather than defined operator names.
Original-commit: flang-compiler/f18@cf64809551
Reviewed-on: https://github.com/flang-compiler/f18/pull/37
Tree-same-pre-rewrite: false
2018-03-30 14:10:00 -07:00
peter klausler fdae1bfc4a [flang] Remove some needless checks for mandatory spaces before keywords and names that could not be present anyway, they were slowing things down.
Original-commit: flang-compiler/f18@a07b78d2d7
Reviewed-on: https://github.com/flang-compiler/f18/pull/35
2018-03-30 11:32:37 -07:00
peter klausler 59e3955ea9 [flang] Use "..."_sptok rather than ~ in tokens to denote mandatory spaces.
Original-commit: flang-compiler/f18@1b22874a9d
Reviewed-on: https://github.com/flang-compiler/f18/pull/35
Tree-same-pre-rewrite: false
2018-03-30 11:11:48 -07:00
peter klausler fc1b7685ad [flang] "free from" -> "free form" in comment.
Original-commit: flang-compiler/f18@3923166673
Reviewed-on: https://github.com/flang-compiler/f18/pull/35
Tree-same-pre-rewrite: false
2018-03-29 17:07:19 -07:00
peter klausler 522d345f12 [flang] Update documentation.
Original-commit: flang-compiler/f18@7045fbcd0c
Reviewed-on: https://github.com/flang-compiler/f18/pull/35
Tree-same-pre-rewrite: false
2018-03-29 16:53:10 -07:00
peter klausler d2d155f9a2 [flang] Make functions inline to recoup performance.
Original-commit: flang-compiler/f18@7f8705304d
Reviewed-on: https://github.com/flang-compiler/f18/pull/35
Tree-same-pre-rewrite: false
2018-03-29 16:49:25 -07:00
peter klausler d836e7156b [flang] Debugging.
Original-commit: flang-compiler/f18@84e0cc7549
Reviewed-on: https://github.com/flang-compiler/f18/pull/35
Tree-same-pre-rewrite: false
2018-03-29 16:34:03 -07:00
peter klausler 1f3c41b521 [flang] Emit warnings in free form when a required space is missing.
Original-commit: flang-compiler/f18@e41917d144
Reviewed-on: https://github.com/flang-compiler/f18/pull/35
Tree-same-pre-rewrite: false
2018-03-29 16:06:31 -07:00
peter klausler e286e6c302 [flang] Begin work on missing space warnings in free form. Reformat C++.
Original-commit: flang-compiler/f18@1bcbf0eb7b
Reviewed-on: https://github.com/flang-compiler/f18/pull/34
2018-03-29 12:16:10 -07:00
peter klausler 43d8f80d27 [flang] Add MinSizeRel to .gitignore.
Original-commit: flang-compiler/f18@068e2e4465
Reviewed-on: https://github.com/flang-compiler/f18/pull/34
Tree-same-pre-rewrite: false
2018-03-29 11:19:37 -07:00
peter klausler e0482bb778 [flang] Simplify test-type and test-sema to use parser::Parsing wrapper class.
Original-commit: flang-compiler/f18@3741a652ed
Reviewed-on: https://github.com/flang-compiler/f18/pull/34
Tree-same-pre-rewrite: false
2018-03-28 17:15:00 -07:00
peter klausler 448e3e4cca [flang] Resolve merge with code pushed to master.
Original-commit: flang-compiler/f18@d75d86f28e
Reviewed-on: https://github.com/flang-compiler/f18/pull/34
Tree-same-pre-rewrite: false
2018-03-28 15:11:12 -07:00
peter klausler 75b29335ab [flang] Clean out obsolete parsing code. Handle !cdir$ fixed and free in parser.
Work on scanning compiler directive lines.

Fix glitch in earlier change to parse-state.h.

Add ClassifyLine(), simplify some token sequence data lifetimes and interfaces.

Handle continued directives.  Obey !DIR$ FIXED and FREE in prescanner.

Some refactoring of TokenSequence API, then support initial directives (FIXED, FREE, IGNORE_TKR).

Fix !DIR$ IGNORE_TKR syntax, manual was wrong.

Debugging directive scanning & parsing.

Profiling-directed speed-up - do not map cooked source locations to Provenance until a Message is emitted.  Turn some non-nullable pointers into references.

Debugging.

Handle !DIR$ IVDEP too, it is in a test.

Accept directives in the execution part.

Original-commit: flang-compiler/f18@fb2ff367ec
Reviewed-on: https://github.com/flang-compiler/f18/pull/34
Tree-same-pre-rewrite: false
2018-03-28 15:04:36 -07:00
Stephane Chauveau 8391357e5e [flang] Merge branch 'sch_sema' of https://github.com/ThePortlandGroup/f18 into sch_sema
Conflicts:
	lib/parser/parse-tree.h
	lib/semantics/CMakeLists.txt
	tools/f18/CMakeLists.txt
	tools/f18/test-sema.cc

Original-commit: flang-compiler/f18@2282b5759b
Reviewed-on: https://github.com/flang-compiler/f18/pull/24
2018-03-26 16:35:34 +02:00
Stephane Chauveau f5b3f10622 [flang] Remove files in include/flang/Sema/
Original-commit: flang-compiler/f18@7791319414
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 f49e2dfa2a [flang] Merge with current master and move code to lib/semantics/
Original-commit: flang-compiler/f18@8b31a01102
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 934b518443 [flang] commit before rebase master
Original-commit: flang-compiler/f18@77f6a25f8a
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 eb766702f1 [flang] Commit changes made while at Portland. Some of them will disapear
Original-commit: flang-compiler/f18@0972ffe185
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 a7cf13c738 [flang] Provide an emacs style for editing Flang C++ sources
Original-commit: flang-compiler/f18@e9922dda1d
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 6ef4d355c8 [flang] remove long comment
Original-commit: flang-compiler/f18@c20912629b
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 99dd6d03de [flang] several changes following pull comments
Original-commit: flang-compiler/f18@ba1275a7cb
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 b65824fb32 [flang] Implement dump of parse-tree
Original-commit: flang-compiler/f18@ca6dbfc477
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 43591d3010 [flang] remove unused member
Original-commit: flang-compiler/f18@1d39fd8c5f
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 4c025af548 [flang] Mostly code cleanup
Original-commit: flang-compiler/f18@f78fef7a17
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 b6ae080cd6 [flang] Fix misc issues with closing of LabelDo
Original-commit: flang-compiler/f18@8134331da8
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 10e3b1cfb2 [flang] add resolution of CYCLE target construct
Original-commit: flang-compiler/f18@669ab24267
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 325d2d677c [flang] Target construct of EXIT statements are now identified
Original-commit: flang-compiler/f18@2000ae4904
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 68ef98cb5c [flang] fix incorrect handling of select rank and select type
Original-commit: flang-compiler/f18@9970fb02b4
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 9b520937e0 [flang] LabelDo are now properly handled (for cases supported by parser)
Also, construct names are now matched

Original-commit: flang-compiler/f18@0e09016059
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 20ac31fa9f [flang] Very early semantic analysis.
Original-commit: flang-compiler/f18@862eca9c5b
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 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
Tim Keith 9f755666fb [flang] Add ENUM_CLASS to define enum class with ToString function.
This replaces DEFINE_NESTED_ENUM_CLASS in parse-tree.h but works
similarly. "ENUM_CLASS(Foo, A, B, C)" defined enum class Foo with
enumerators A, B, C. It also defines an overloading of EnumToString
that converts enumerators to their string representation.

Change unparse.cc to adapt to this change.

Make use of ENUM_CLASS in attr.h and attr.cc.

Original-commit: flang-compiler/f18@c45b8f172a
Reviewed-on: https://github.com/flang-compiler/f18/pull/31
2018-03-23 14:41:48 -07:00
peter klausler 938d1eba15 [flang] Disable code in development before merging into master.
Original-commit: flang-compiler/f18@f9484682d1
Reviewed-on: https://github.com/flang-compiler/f18/pull/29
2018-03-23 14:18:59 -07:00
peter klausler 24ca79adb8 [flang] Rebase and merge with current master branch.
Original-commit: flang-compiler/f18@71544b8462
Reviewed-on: https://github.com/flang-compiler/f18/pull/29
Tree-same-pre-rewrite: false
2018-03-23 14:02:11 -07:00
peter klausler 424ec7b35b [flang] Handle empty files gracefully.
Create interval.h.  Use std::size_t instead of bare size_t.  Redefine parser::Name to not be just a bare string.

Break out and rename CharBlock from token-sequence.h for use in the parse tree.

Incremental replacement of name strings with pointers to cooked characters.

Fix case sensitivity problem.

Use new CharBlock encoding to replace strings for real literal constants.

Normalized cooked character stream to lower case.

Simplify parsing now that cooked stream is lower case.  Replace Keyword in parse tree.

Add static_asserts to || and recovery parsers to enforce same result types.

Remove needless TODO comment inserted earlier.

Fix case conversion on prefixed character literals (f90_correct/dc04.f90).

Use CharBlock in user-state.h.

Complete transition from nextChar to nextCh (i.e., always use pointers).

Document extensions.  Begin work on compiler directive lines.

More documentation work.

Reformat prescan.cc.

More work on compiler directive scanning.

Original-commit: flang-compiler/f18@38d0404e16
Reviewed-on: https://github.com/flang-compiler/f18/pull/29
Tree-same-pre-rewrite: false
2018-03-23 13:32:55 -07:00