Commit graph

1452 commits

Author SHA1 Message Date
Eric Schweitz
dee4d4be8d [flang] implement the DO WHILE check
Original-commit: flang-compiler/f18@c367551041
Reviewed-on: https://github.com/flang-compiler/f18/pull/351
Tree-same-pre-rewrite: false
2019-03-22 15:02:04 -07:00
Steve Scalpone
4c2fa097a9 [flang] Merge pull request flang-compiler/f18#345 from kiranchandramohan/c1167
C1167 : Check for exit statments in do-concurrent

Original-commit: flang-compiler/f18@f5f6ed8e98
Reviewed-on: https://github.com/flang-compiler/f18/pull/345
2019-03-22 10:14:42 -07:00
Kiran Chandramohan
ed92b04e49 [flang] C1167 : Check for exit statments in do-concurrent
Addresses https://github.com/flang-compiler/f18/issues/288

Original-commit: flang-compiler/f18@2a99e1ea54
Reviewed-on: https://github.com/flang-compiler/f18/pull/345
2019-03-21 17:44:47 +00:00
jeanPerier
34cf5c549f [flang] Add test framework for folding and fix minor bug found with it
Merge pull request flang-compiler/f18#347 from flang-compiler/jpr1

Original-commit: flang-compiler/f18@547c9f3561
2019-03-22 00:27:17 -07:00
Jean Perier
be8b657ae3 [flang] removed hard coded path
Original-commit: flang-compiler/f18@d2fcd31257
2019-03-21 08:49:38 -07:00
Jean Perier
55c01aa295 [flang] Fix .NOT. folding bug
Original-commit: flang-compiler/f18@dd4d9091f1
Tree-same-pre-rewrite: false
2019-03-21 08:33:14 -07:00
Jean Perier
4073e47343 [flang] Add test framework for folding
Original-commit: flang-compiler/f18@d6b658c318
Tree-same-pre-rewrite: false
2019-03-21 08:31:21 -07:00
Peter Klausler
ee3123e1ed [flang] Merge pull request flang-compiler/f18#349 from flang-compiler/pmk-bug348
Fix bug#348

Original-commit: flang-compiler/f18@2a4b380715
Reviewed-on: https://github.com/flang-compiler/f18/pull/349
2019-03-21 14:32:06 -07:00
peter klausler
8118196fda [flang] Better error locations
Original-commit: flang-compiler/f18@9d4a3e9734
Reviewed-on: https://github.com/flang-compiler/f18/pull/349
2019-03-21 13:42:35 -07:00
peter klausler
7ded6de0d5 [flang] Fix bug#348
Original-commit: flang-compiler/f18@ba3504b00e
Reviewed-on: https://github.com/flang-compiler/f18/pull/349
Tree-same-pre-rewrite: false
2019-03-21 10:36:04 -07:00
Peter Klausler
fe1c7882ae [flang] Merge pull request flang-compiler/f18#346 from flang-compiler/pmk-pointers
Simplify indirection.h, remove needless classes

Original-commit: flang-compiler/f18@72ac1b7ef6
Reviewed-on: https://github.com/flang-compiler/f18/pull/346
2019-03-20 15:07:59 -07:00
peter klausler
0c78d8bd9b [flang] Fix unparsing of defined operators.
Original-commit: flang-compiler/f18@14aa5198f3
Reviewed-on: https://github.com/flang-compiler/f18/pull/346
2019-03-20 14:17:12 -07:00
peter klausler
dfc1643f3f [flang] get clean compile
Original-commit: flang-compiler/f18@3a606d804d
Reviewed-on: https://github.com/flang-compiler/f18/pull/346
Tree-same-pre-rewrite: false
2019-03-20 13:44:00 -07:00
peter klausler
c090abef3b [flang] checkpoint
Original-commit: flang-compiler/f18@1e213f3fbe
Reviewed-on: https://github.com/flang-compiler/f18/pull/346
Tree-same-pre-rewrite: false
2019-03-20 13:11:49 -07:00
peter klausler
afd0c19fec [flang] cleanup after extraction and merging
Original-commit: flang-compiler/f18@6314daadc1
Reviewed-on: https://github.com/flang-compiler/f18/pull/346
Tree-same-pre-rewrite: false
2019-03-20 11:49:32 -07:00
peter klausler
ad057a42fa [flang] Remove OwningPointer, use unique_ptr better instead.
Original-commit: flang-compiler/f18@89aff868aa
Reviewed-on: https://github.com/flang-compiler/f18/pull/346
Tree-same-pre-rewrite: false
2019-03-20 11:38:45 -07:00
Steve Scalpone
446890e74c [flang] Merge pull request flang-compiler/f18#344 from flang-compiler/LLVM-dependency
Update the build instructions in README.md.

Original-commit: flang-compiler/f18@a3c5319e61
Reviewed-on: https://github.com/flang-compiler/f18/pull/344
2019-03-20 14:12:41 -07:00
Steve Scalpone
b6ca16ed2d [flang] Reorder the advice about putting GCC bin and lib on
the PATH and LD_LIBRARY_PATH. Add concrete example.

Original-commit: flang-compiler/f18@88c34fbe86
Reviewed-on: https://github.com/flang-compiler/f18/pull/344
2019-03-20 14:09:35 -07:00
Steve Scalpone
c90ce54ce3 [flang] Update README.md with a list of compilers that are known to
compile f18. Explain how to configure LLVM on the cmake cmd
line. Add more detail about how to compile with clang++.

Original-commit: flang-compiler/f18@e7f678147b
Reviewed-on: https://github.com/flang-compiler/f18/pull/344
Tree-same-pre-rewrite: false
2019-03-19 23:47:18 -07:00
Tim Keith
f09d979ae3 [flang] Merge pull request flang-compiler/f18#343 from flang-compiler/tsk3
Strip whitespace from parse tree source locations

Original-commit: flang-compiler/f18@eb1e8cd38b
Reviewed-on: https://github.com/flang-compiler/f18/pull/343
2019-03-19 14:46:10 -07:00
Tim Keith
1ad772336a [flang] Address review comments
Original-commit: flang-compiler/f18@511c9ec536
Reviewed-on: https://github.com/flang-compiler/f18/pull/343
2019-03-19 14:18:44 -07:00
Tim Keith
8d4c934da7 [flang] Fix warning when compiling with clang
Original-commit: flang-compiler/f18@0f18c3443a
Reviewed-on: https://github.com/flang-compiler/f18/pull/343
Tree-same-pre-rewrite: false
2019-03-19 13:44:56 -07:00
Tim Keith
299628e2cb [flang] Strip whitespace from parse tree source locations
Parse tree nodes have `source` fields that map the node back to
a range in the cooked input stream. These are used for names and
to locate error messages.

This change strips spaces from the beginning and end of those
source ranges before they are saved. This fixes two problems:
1. For a statement like this: `generic :: operator(+) => ...`,
   the name of the symbol we want to create is "operator(+)" but
   the parser was including the following space in the CharBlock
   it captured.
2. Error messages referring to parts of expressions sometimes included
   extra spaces in the source locations. For example:
   ```
   t.f90:9:29: error: subscripts may be applied only to an object or component
    integer, parameter :: b = a(1) + 1
                              ^^^^^
   t.f90:4:8: error: operands to LOGICAL operation must be LOGICAL
    i = j .or. k
         ^^^^^^^
   ```

Original-commit: flang-compiler/f18@fa14297967
Reviewed-on: https://github.com/flang-compiler/f18/pull/343
Tree-same-pre-rewrite: false
2019-03-19 13:38:54 -07:00
Peter Klausler
f697aacb3a [flang] Merge pull request flang-compiler/f18#342 from flang-compiler/pmk-stop
Simplify grammar for STOP/ERROR STOP.

Original-commit: flang-compiler/f18@6a90817f3c
Reviewed-on: https://github.com/flang-compiler/f18/pull/342
2019-03-19 12:16:33 -07:00
peter klausler
62c39b72af [flang] Still do scalar- constraint check.
Original-commit: flang-compiler/f18@e50b4c4b48
Reviewed-on: https://github.com/flang-compiler/f18/pull/342
2019-03-19 11:59:58 -07:00
peter klausler
e1a9c85e72 [flang] Simplify grammar for STOP/ERROR STOP.
Original-commit: flang-compiler/f18@eddaea25a2
Reviewed-on: https://github.com/flang-compiler/f18/pull/342
Tree-same-pre-rewrite: false
2019-03-19 11:44:35 -07:00
Peter Klausler
d4c047a59b [flang] Merge pull request flang-compiler/f18#341 from flang-compiler/klausler-patch-1
Update FortranForCProgrammers.md

Original-commit: flang-compiler/f18@678cff1bc7
Reviewed-on: https://github.com/flang-compiler/f18/pull/341
2019-03-19 11:14:44 -07:00
Peter Klausler
11e94aa110 [flang] Update FortranForCProgrammers.md
Original-commit: flang-compiler/f18@39d8143844
Reviewed-on: https://github.com/flang-compiler/f18/pull/341
2019-03-19 10:14:23 -07:00
Tim Keith
a0b634f12a [flang] Merge pull request flang-compiler/f18#338 from flang-compiler/tsk2
Name resolution for defined operators

Original-commit: flang-compiler/f18@6b3edf2b71
Reviewed-on: https://github.com/flang-compiler/f18/pull/338
2019-03-18 15:37:17 -07:00
Tim Keith
3ec5e102e2 [flang] Name resolution for defined operators
Instead of tracking just genericName_ while in a generic interface
block or generic statement, now we immediately create a symbol for it.
A parser::Name isn't good enough because a defined-operator or
defined-io-generic-spec doesn't have a name.

Change the parse tree to add a source field to GenericSpec. Use these
as names for symbols for defined-operator and defined-io-generic-spec
(e.g. "operator(+)" or "read(formatted)").

Change the source for defined-op-name to include the dots so that they
can be distinguished from normal symbols with the same name (e.g. you
can have both ".foo." and "foo"). These symbols have names in the symbol
table like ".foo.", not "operator(.foo.)", because references to them
have that form.

Add GenericKind enum to GenericDetails and GenericBindingDetails.
This allows us to know a symbol is "assignment(=)", for example,
without having to do a string comparison.

Add GenericSpecInfo to handle analyzing the various kinds of
generic-spec and generating symbol names and GenericKind for them.

Add reference to LanguageFeatureControl to SemanticsContext so that
they can be checked during semantics. For this change, if
LogicalAbbreviations is enabled, report an error if the user tries
to define an operator named ".T." or ".F.".

Add resolve-name-utils.cc to hold utility functions and classes that
don't have to be in the ResolveNamesVisitor class hierarchy. The goal
is to reduce the size of resolve-names.cc where possible.

Original-commit: flang-compiler/f18@3081f694e2
Reviewed-on: https://github.com/flang-compiler/f18/pull/338
2019-03-18 11:48:02 -07:00
Peter Klausler
6092f4c7b1 [flang] Merge pull request flang-compiler/f18#339 from flang-compiler/pmk-spaces
Squash free-form white space in prescanner around parentheses.

Original-commit: flang-compiler/f18@11eb9c8949
Reviewed-on: https://github.com/flang-compiler/f18/pull/339
2019-03-18 13:46:22 -07:00
peter klausler
19c91ea9e1 [flang] Improve comment
Original-commit: flang-compiler/f18@140ebe060e
Reviewed-on: https://github.com/flang-compiler/f18/pull/339
2019-03-18 13:43:03 -07:00
peter klausler
cf8f173512 [flang] Final tweak before review
Original-commit: flang-compiler/f18@5dda7b2f65
Reviewed-on: https://github.com/flang-compiler/f18/pull/339
Tree-same-pre-rewrite: false
2019-03-18 13:05:21 -07:00
peter klausler
f8c80f90ee [flang] Simplify
Original-commit: flang-compiler/f18@42bee00a45
Reviewed-on: https://github.com/flang-compiler/f18/pull/339
Tree-same-pre-rewrite: false
2019-03-18 12:24:44 -07:00
peter klausler
81a35e3b2f [flang] Squash spaces in generic specs.
Original-commit: flang-compiler/f18@bd5e29f5f8
Reviewed-on: https://github.com/flang-compiler/f18/pull/339
Tree-same-pre-rewrite: false
2019-03-18 12:19:35 -07:00
Peter Klausler
cae3ab0985 [flang] Merge pull request flang-compiler/f18#336 from flang-compiler/pmk-fixes
Fix parse of .TRUE._8

Original-commit: flang-compiler/f18@5e44e67f78
Reviewed-on: https://github.com/flang-compiler/f18/pull/336
2019-03-17 16:16:19 -07:00
peter klausler
7c71e2f288 [flang] Fix parse of .TRUE._8
Original-commit: flang-compiler/f18@b03e7a691d
Reviewed-on: https://github.com/flang-compiler/f18/pull/336
2019-03-17 15:51:02 -07:00
Eric Schweitz
14b4489390 [flang] Merge pull request flang-compiler/f18#334 from flang-compiler/eas0
FIR sync: replace the stubs for translating terminal symbols to expressions; st…

Original-commit: flang-compiler/f18@0a93e2c393
Reviewed-on: https://github.com/flang-compiler/f18/pull/334
2019-03-16 09:56:33 -07:00
Eric
6b09d21b13 [flang] more compiler warnings
Original-commit: flang-compiler/f18@df8c83c106
Reviewed-on: https://github.com/flang-compiler/f18/pull/334
2019-03-15 18:57:52 -07:00
Eric Schweitz
862ff5bf80 [flang] review comments
Original-commit: flang-compiler/f18@1ba1c0268f
Reviewed-on: https://github.com/flang-compiler/f18/pull/334
Tree-same-pre-rewrite: false
2019-03-15 16:23:10 -07:00
Eric Schweitz
0e96269737 [flang] muzzle clang++ warnings
Original-commit: flang-compiler/f18@02decb4040
Reviewed-on: https://github.com/flang-compiler/f18/pull/334
Tree-same-pre-rewrite: false
2019-03-15 11:35:18 -07:00
Eric Schweitz
327fa06a6b [flang] replace the stubs for translating terminal symbols to expressions; start pushing Value type into FIR; cleanup terminator succ_blocks; remove parser element from disassociate; run clang-format; etc.
Original-commit: flang-compiler/f18@c5561646ea
Reviewed-on: https://github.com/flang-compiler/f18/pull/334
Tree-same-pre-rewrite: false
2019-03-15 10:03:06 -07:00
Peter Klausler
87e96e93b8 [flang] Merge pull request flang-compiler/f18#335 from flang-compiler/pmk-spec
Some tweaks to preprocess & parse all Fortran in SPEC CPUv6

Original-commit: flang-compiler/f18@b2828f1318
Reviewed-on: https://github.com/flang-compiler/f18/pull/335
2019-03-15 15:59:25 -07:00
peter klausler
a4d44a8528 [flang] Document extension
Original-commit: flang-compiler/f18@ca2a7dc5a8
Reviewed-on: https://github.com/flang-compiler/f18/pull/335
2019-03-15 15:19:27 -07:00
peter klausler
713cd91a34 [flang] Final tweaks, can now parse all SPEC CPUv6
Original-commit: flang-compiler/f18@015152f1ba
Reviewed-on: https://github.com/flang-compiler/f18/pull/335
Tree-same-pre-rewrite: false
2019-03-15 15:01:54 -07:00
peter klausler
827407a86a [flang] more spec work, handle classic C comments
Original-commit: flang-compiler/f18@d901ee7f50
Reviewed-on: https://github.com/flang-compiler/f18/pull/335
Tree-same-pre-rewrite: false
2019-03-15 13:57:41 -07:00
peter klausler
4b26466375 [flang] Accomodate missing clock_gettime(); remove f18-parse-demo dependence on lib/evaluate; allow #ifdef with no name
Original-commit: flang-compiler/f18@330fd8116f
Reviewed-on: https://github.com/flang-compiler/f18/pull/335
Tree-same-pre-rewrite: false
2019-03-15 10:50:15 -07:00
Peter Klausler
7b77100155 [flang] Merge pull request flang-compiler/f18#330 from flang-compiler/pmk-parse-demo
f18-parse-demo

Original-commit: flang-compiler/f18@ec7b68f596
Reviewed-on: https://github.com/flang-compiler/f18/pull/330
2019-03-14 17:28:35 -07:00
peter klausler
d08de1a094 [flang] Add reference to libFortranEvaluate for destructor
Original-commit: flang-compiler/f18@db6fb0f8cd
Reviewed-on: https://github.com/flang-compiler/f18/pull/330
2019-03-14 16:40:55 -07:00
peter klausler
615ba7754b [flang] Move dump-parse-tree.h from semantics into parser.
Original-commit: flang-compiler/f18@9075adfcdf
Reviewed-on: https://github.com/flang-compiler/f18/pull/330
Tree-same-pre-rewrite: false
2019-03-14 16:28:06 -07:00