Commit graph

1881 commits

Author SHA1 Message Date
Jinxin (Brian) Yang
3a49c959e8 [flang] Merge pull request flang-compiler/f18#453 from flang-compiler/by-mp-parser-fix
OpenMP 4.5 grammar related minor fixes

Original-commit: flang-compiler/f18@2a1c37d251
Reviewed-on: https://github.com/flang-compiler/f18/pull/453
2019-05-08 16:00:00 -07:00
Jinxin Yang
d25c942594 [flang] OpenMP 4.5 grammar related minor fixes
1. typo and trailing spaces within OpenMP-4.5-grammar.txt

2. parse (openmp-grammar.h) and unparse(unparse.cc) for:

   SCHEDULE ([modifier [, modifier]:]kind[, chunk_size])
   Modifier ->  MONITONIC | NONMONOTONIC | SIMD

where ":" is optional except at least one modifier is present.

Original-commit: flang-compiler/f18@5cebae5039
Reviewed-on: https://github.com/flang-compiler/f18/pull/453
2019-05-08 14:12:28 -07:00
Peter Klausler
65c5f5fd3a [flang] Merge pull request flang-compiler/f18#451 from flang-compiler/pmk-fix-val-bug
Allow use of (x?"a":"b") as a message argument

Original-commit: flang-compiler/f18@bbf5b816ec
Reviewed-on: https://github.com/flang-compiler/f18/pull/451
2019-05-08 12:19:56 -07:00
peter klausler
802895b7c6 [flang] Allow use of (x?"a":"b") as a message argument
Original-commit: flang-compiler/f18@c0d4e55455
Reviewed-on: https://github.com/flang-compiler/f18/pull/451
2019-05-08 11:11:11 -07:00
Peter Klausler
c17e5bad63 [flang] Merge pull request flang-compiler/f18#449 from flang-compiler/pmk-ps-bug
Handle remaining cases in expression tree traversal

Original-commit: flang-compiler/f18@40cb0ada0f
Reviewed-on: https://github.com/flang-compiler/f18/pull/449
2019-05-08 11:07:44 -07:00
peter klausler
40282fabd2 [flang] Add & use mutators for Substring, Triplet, CoarrayRef
Original-commit: flang-compiler/f18@cc2de361fa
Reviewed-on: https://github.com/flang-compiler/f18/pull/449
2019-05-08 10:29:04 -07:00
peter klausler
b00798b64f [flang] Fix warning
Original-commit: flang-compiler/f18@4fcf88901c
Reviewed-on: https://github.com/flang-compiler/f18/pull/449
Tree-same-pre-rewrite: false
2019-05-08 10:29:02 -07:00
peter klausler
d92abfa65e [flang] Address review comment
Original-commit: flang-compiler/f18@5d20cd48b6
Reviewed-on: https://github.com/flang-compiler/f18/pull/449
Tree-same-pre-rewrite: false
2019-05-08 10:29:02 -07:00
peter klausler
91de1f62fb [flang] dodge clang build problem with constexpr
Original-commit: flang-compiler/f18@83995a5a98
Reviewed-on: https://github.com/flang-compiler/f18/pull/449
Tree-same-pre-rewrite: false
2019-05-08 10:29:01 -07:00
peter klausler
04d85f1754 [flang] Remove debugging
Original-commit: flang-compiler/f18@1db626f838
Reviewed-on: https://github.com/flang-compiler/f18/pull/449
Tree-same-pre-rewrite: false
2019-05-08 10:28:58 -07:00
peter klausler
bb83471e96 [flang] Fix folding of substring
Original-commit: flang-compiler/f18@62dc5e0c93
Reviewed-on: https://github.com/flang-compiler/f18/pull/449
Tree-same-pre-rewrite: false
2019-05-08 10:28:57 -07:00
peter klausler
52d46695fc [flang] Handle remaining cases in expression traversal
Original-commit: flang-compiler/f18@5cb0de58d4
Reviewed-on: https://github.com/flang-compiler/f18/pull/449
Tree-same-pre-rewrite: false
2019-05-08 10:28:56 -07:00
Brian
2105abf176 [flang] Merge pull request flang-compiler/f18#450 from flang-compiler/by-pgf90-mp
Add -mp option for pgf90 in the presence of -fopenmp

Original-commit: flang-compiler/f18@e07b20a799
Reviewed-on: https://github.com/flang-compiler/f18/pull/450
2019-05-08 10:24:57 -07:00
Jinxin Yang
80ccd20f3b [flang] Add -mp option for pgf90 in the presence of -fopenmp
Original-commit: flang-compiler/f18@a9d7287420
Reviewed-on: https://github.com/flang-compiler/f18/pull/450
2019-05-08 08:43:20 -07:00
Peter Klausler
f11652a1e6 [flang] Merge pull request flang-compiler/f18#444 from flang-compiler/pmk-msg-format
Replace formatting of CharBlock & string

Original-commit: flang-compiler/f18@359bedbefd
Reviewed-on: https://github.com/flang-compiler/f18/pull/444
2019-05-07 12:15:49 -07:00
peter klausler
4ffb37e593 [flang] Remove support for Names in messages for now.
Original-commit: flang-compiler/f18@15d38c7059
Reviewed-on: https://github.com/flang-compiler/f18/pull/444
2019-05-07 10:04:21 -07:00
peter klausler
f704d38129 [flang] Merge with recent changes
Original-commit: flang-compiler/f18@56a72cbbd6
Reviewed-on: https://github.com/flang-compiler/f18/pull/444
Tree-same-pre-rewrite: false
2019-05-07 09:24:35 -07:00
peter klausler
ec6cf76536 [flang] Replace formatting of CharBlock & string
Preserve generated strings until consumed by formatting.

bugfix from premature push

Address review comments

Last fix(?)

Use %s formatting for CharBlocks and strings

Use new formatting and fix usage of std::forward<>()

Use forward_list rather than vector to save strings

Original-commit: flang-compiler/f18@8ea478420f
Reviewed-on: https://github.com/flang-compiler/f18/pull/444
Tree-same-pre-rewrite: false
2019-05-07 09:24:32 -07:00
jeanPerier
7334b71023 [flang] Change a user error to an internal error in ALLOCATE semantic check
Merge pull request flang-compiler/f18#448 from flang-compiler/jpr-check-allocate

Original-commit: flang-compiler/f18@66e766ac9a
2019-05-07 08:44:23 -07:00
Jean Perier
a11ab23ccb [flang] Change a user error to an internal error in ALLOCATE semantic check
Original-commit: flang-compiler/f18@d9a9b59634
2019-05-07 08:28:24 -07:00
Tim Keith
8e212800c6 [flang] Merge pull request flang-compiler/f18#443 from flang-compiler/tsk4b
Process specification parts before execution parts

Original-commit: flang-compiler/f18@c8d3a77c02
Reviewed-on: https://github.com/flang-compiler/f18/pull/443
2019-05-07 07:35:58 -07:00
Tim Keith
de36472ef7 [flang] Re-enable test resolve51.f90
Original-commit: flang-compiler/f18@595e45fd34
Reviewed-on: https://github.com/flang-compiler/f18/pull/443
2019-05-07 07:35:10 -07:00
Tim Keith
409212cf43 [flang] Move ProgramTree to its own file
Original-commit: flang-compiler/f18@06913c38ca
Reviewed-on: https://github.com/flang-compiler/f18/pull/443
Tree-same-pre-rewrite: false
2019-05-06 10:12:27 -07:00
Tim Keith
14094c71c8 [flang] Process specification parts before execution parts
Change the order in which names are resolved. Before resolving names
in the execution part of a subprogram we need to know the interface
of contained subprograms. This is because the type of some construct
entities can depend on the return type of contained functions, e.g.
```
  associate(x => f())
  end associate
contains
  function f()...
```

To do this, we now build a tree rooted at each program unit with
child nodes corresponding to subprograms contained in the parent.
This provides flexibility in choosing an order to resolve names.
The current implementation processes all specification parts before
any execution parts. This ensures contained subprogram interfaces
are know before analyzing constructs like ASSOCIATE.

Resolving a specification part involves first adding
`SubprogramNameDetails` symbols for each contained subprogram, then
processing the statement that introduces the program unit (`ModuleStmt`,
`SubroutineStmt`, etc.), then visiting all of the statements in the
specification part.

If it proves necessary, we can add a phase to do implicit declarations
in the execution part before processing the specification part of
contained subprograms.

Original-commit: flang-compiler/f18@20e803fd92
Reviewed-on: https://github.com/flang-compiler/f18/pull/443
Tree-same-pre-rewrite: false
2019-05-06 07:26:43 -07:00
Tim Keith
12f1660117 [flang] Add DIE macro
`DIE()` is like `common::die()` but with the source location appended,
as in `CHECK()`.

Original-commit: flang-compiler/f18@ed586c3f38
Reviewed-on: https://github.com/flang-compiler/f18/pull/443
Tree-same-pre-rewrite: false
2019-05-03 08:02:31 -07:00
Tim Keith
28f80675e9 [flang] Change how Scopes are mapped to ImplicitRules
Previously we maintained a stack of ImplicitRules in parallel with
the Scope stack. Change to maintaining a mapping from Scope to
ImplicitRules.

This makes things simpler in some cases: Block scopes don't have their
own implicit rules. And submodule scopes aren't just pushed and popped.
This will also help with future changes to the order in which scopes
are processed.

Original-commit: flang-compiler/f18@443da50352
Reviewed-on: https://github.com/flang-compiler/f18/pull/443
Tree-same-pre-rewrite: false
2019-05-02 11:19:01 -07:00
Peter Klausler
9ba14957e8 [flang] Merge pull request flang-compiler/f18#445 from flang-compiler/pmk-fixes
Fix or disable broken tests.

Original-commit: flang-compiler/f18@1d384b549a
Reviewed-on: https://github.com/flang-compiler/f18/pull/445
2019-05-06 11:44:36 -07:00
peter klausler
eebc7ba001 [flang] Fix or disable broken tests.
Original-commit: flang-compiler/f18@a54396e92e
Reviewed-on: https://github.com/flang-compiler/f18/pull/445
2019-05-06 11:33:33 -07:00
Peter Klausler
fbfb00dac8 [flang] Merge pull request flang-compiler/f18#442 from flang-compiler/pmk-struct-const
Semantics of structure constructors, part 2 of 2

Original-commit: flang-compiler/f18@2672b41af6
Reviewed-on: https://github.com/flang-compiler/f18/pull/442
2019-05-06 08:22:49 -07:00
peter klausler
1733317ad9 [flang] Tweak error message grammar
Original-commit: flang-compiler/f18@4190b97ecc
Reviewed-on: https://github.com/flang-compiler/f18/pull/442
2019-05-06 08:22:22 -07:00
peter klausler
5a18e79d5a [flang] Remove OwningPointer and ForwardReference
Use std::unique_ptr<> with custom deleter for forward-referenced owned pointer.

Move CopyableIndirection into common, add documentation, clean up.

Remove OwningPointer and ForwardReference

Use std::unique_ptr<> with custom deleter for forward-referenced owned pointer.

Use CopyableIndirection

clean up from merge after split

Complete characterization

fold conversions of arrays

Clean up subscripts to constant arrays

Elemental unary operations complete

Support assumed type TYPE(*) in actual arguments

clean up some TODOs

recognize TYPE(*) arguments to intrinsics

Complete folding of array operations

Finish elementwise array folding, add test, debug

characterize intrinsics, fix some bugs

Clean up build

Type compatibility and shape conformance checks on pointer assignments

Original-commit: flang-compiler/f18@99d734c621
Reviewed-on: https://github.com/flang-compiler/f18/pull/442
Tree-same-pre-rewrite: false
2019-05-06 07:51:07 -07:00
jeanPerier
d427b58843 [flang] Allocate semantic checks (second and last part)
Merge pull request flang-compiler/f18#436 from flang-compiler/jpr-check-allocate

Original-commit: flang-compiler/f18@f4d89974d2
2019-05-06 08:02:23 -07:00
Jean Perier
6370087abc [flang] Address comments
Original-commit: flang-compiler/f18@2a6473ce6a
2019-05-03 01:31:48 -07:00
Jean Perier
c67710e5ae [flang] Allocate semantic checks (second part)
Implement semantic checks and realted tests for constraints:
C937, C938, C939, C940, C941, C942, C945 (second part),
C946, C947, C948, C949 and C950.

Original-commit: flang-compiler/f18@b4965d272b
Tree-same-pre-rewrite: false
2019-05-03 00:45:22 -07:00
Peter Klausler
672aadbfda [flang] Merge pull request flang-compiler/f18#441 from flang-compiler/pmk-message-cleanup
Support std::string and CharBlock in formatted messages

Original-commit: flang-compiler/f18@4b9431bae9
Reviewed-on: https://github.com/flang-compiler/f18/pull/441
2019-05-06 07:48:44 -07:00
peter klausler
9c369277a5 [flang] Prevent unhandled special formatting
Original-commit: flang-compiler/f18@378e0e2325
Reviewed-on: https://github.com/flang-compiler/f18/pull/441
2019-05-03 16:53:45 -07:00
peter klausler
1eece3d125 [flang] Support %zu and %ju before special codes; add comments
Original-commit: flang-compiler/f18@d237d4122b
Reviewed-on: https://github.com/flang-compiler/f18/pull/441
Tree-same-pre-rewrite: false
2019-05-03 16:07:37 -07:00
peter klausler
789b7d67b2 [flang] Add comments
Original-commit: flang-compiler/f18@3bd10af06b
Reviewed-on: https://github.com/flang-compiler/f18/pull/441
Tree-same-pre-rewrite: false
2019-05-03 15:17:59 -07:00
peter klausler
68209d4f87 [flang] Support std::string and CharBlock in formatted messages
fix off-by-one

Original-commit: flang-compiler/f18@58eb11c5c7
Reviewed-on: https://github.com/flang-compiler/f18/pull/441
Tree-same-pre-rewrite: false
2019-05-03 15:10:03 -07:00
Peter Klausler
bc0732002e [flang] Merge pull request flang-compiler/f18#440 from flang-compiler/pmk1
Changes from code review

Original-commit: flang-compiler/f18@c945b52b05
Reviewed-on: https://github.com/flang-compiler/f18/pull/440
2019-05-03 14:47:32 -07:00
peter klausler
80602cdb74 [flang] Changes from review
Original-commit: flang-compiler/f18@feafc0c216
Reviewed-on: https://github.com/flang-compiler/f18/pull/440
2019-05-03 14:42:33 -07:00
Peter Klausler
4831c41440 [flang] Merge pull request flang-compiler/f18#439 from flang-compiler/pmk1
Structure constructor semantics, part 1 of 2

Original-commit: flang-compiler/f18@56f3f7bd90
Reviewed-on: https://github.com/flang-compiler/f18/pull/439
2019-05-03 14:40:31 -07:00
peter klausler
25e6f03443 [flang] lib/evaluate work for structure constructors
Original-commit: flang-compiler/f18@76a192f9c9
Reviewed-on: https://github.com/flang-compiler/f18/pull/439
2019-05-03 11:29:15 -07:00
Peter Klausler
c1fa835a71 [flang] Merge pull request flang-compiler/f18#438 from flang-compiler/pmk-fix-pp-noargs
Fix bug flang-compiler/f18#437

Original-commit: flang-compiler/f18@3dbcc78d77
Reviewed-on: https://github.com/flang-compiler/f18/pull/438
2019-05-02 19:07:01 -07:00
peter klausler
14b5cdd4d0 [flang] Fix f90_correct test failure
Original-commit: flang-compiler/f18@ff7a5af50b
Reviewed-on: https://github.com/flang-compiler/f18/pull/438
2019-05-02 15:19:37 -07:00
peter klausler
b3682933f3 [flang] Fix bug flang-compiler/f18#437, func-like macro call with no arguments
Original-commit: flang-compiler/f18@d106290f19
Reviewed-on: https://github.com/flang-compiler/f18/pull/438
Tree-same-pre-rewrite: false
2019-05-02 14:29:52 -07:00
psteinfeld
4245cae846 [flang] Merge pull request flang-compiler/f18#434 from flang-compiler/ps
Tests for C1131, DO loop names

Original-commit: flang-compiler/f18@d1c94d97ff
Reviewed-on: https://github.com/flang-compiler/f18/pull/434
2019-05-01 13:12:49 -07:00
Peter Steinfeld
b77f059862 [flang] Changed the test for unmatched DO loop names to use test_errors.sh
rather than test_any.sh.

Original-commit: flang-compiler/f18@c02aff4570
Reviewed-on: https://github.com/flang-compiler/f18/pull/434
2019-05-01 12:53:16 -07:00
Peter Steinfeld
bbc092553c [flang] Tests for C1131, making sure that names of DO loops match between the loop header and the END DO statement.
Original-commit: flang-compiler/f18@f42ad1c2fd
Reviewed-on: https://github.com/flang-compiler/f18/pull/434
Tree-same-pre-rewrite: false
2019-05-01 12:53:15 -07:00
vdonaldson
408cfc1c4d [flang] reformat Fortran.h (flang-compiler/f18#435)
Original-commit: flang-compiler/f18@cdbb214339
Reviewed-on: https://github.com/flang-compiler/f18/pull/435
2019-04-30 20:22:02 -07:00