Commit graph

1672 commits

Author SHA1 Message Date
Steve Scalpone
a0e06bb5d4 [flang] Cleanup -- Remove unnecessary inline keyword,
remove unnecessary (void) casts when ignoring
return values, call context_.Say() directly
instead of via messages(), and fix up some
formatting issues using clang-format.

Original-commit: flang-compiler/f18@68e5c02541
Reviewed-on: https://github.com/flang-compiler/f18/pull/404
2019-04-11 15:20:14 -07:00
psteinfeld
4e440846ac [flang] Merge pull request flang-compiler/f18#400 from flang-compiler/ps1-392
Removed unused parameter and tweaked the error message one more time.

Original-commit: flang-compiler/f18@2d20bc549c
Reviewed-on: https://github.com/flang-compiler/f18/pull/400
2019-04-11 15:35:44 -07:00
Peter Steinfeld
cdede97e39 [flang] Hopefully the last fixup of messages that appear for bad termination
of a DO loop.

Original-commit: flang-compiler/f18@23f7471f3a
Reviewed-on: https://github.com/flang-compiler/f18/pull/400
2019-04-11 15:35:44 -07:00
Peter Steinfeld
563d7a6c4c [flang] My last change neglected to include the change to the message.
Original-commit: flang-compiler/f18@09444379f7
Reviewed-on: https://github.com/flang-compiler/f18/pull/400
Tree-same-pre-rewrite: false
2019-04-11 15:35:44 -07:00
Peter Steinfeld
22b489508c [flang] Removed unused parameter and tweaked the error message one more time.
Original-commit: flang-compiler/f18@476791da2a
Reviewed-on: https://github.com/flang-compiler/f18/pull/400
Tree-same-pre-rewrite: false
2019-04-11 15:35:44 -07:00
Steve Scalpone
e3f57417b5 [flang] Merge pull request flang-compiler/f18#401 from flang-compiler/check-deallocate
Implement semantic checks for DEALLOCATE statements.

Original-commit: flang-compiler/f18@e68120d7fa
Reviewed-on: https://github.com/flang-compiler/f18/pull/401
2019-04-11 14:37:49 -07:00
Steve Scalpone
23c31c968e [flang] Simply use context_.Say. Update test with duplicate dealloc opts.
Original-commit: flang-compiler/f18@61b7461552
Reviewed-on: https://github.com/flang-compiler/f18/pull/401
2019-04-11 09:39:32 -07:00
Steve Scalpone
ee79690a0f [flang] Correct constraint numbers. Fix spelling error. Run clang-format.
Original-commit: flang-compiler/f18@59df0d39f3
Reviewed-on: https://github.com/flang-compiler/f18/pull/401
Tree-same-pre-rewrite: false
2019-04-11 04:16:14 -07:00
Steve Scalpone
70285af0ad [flang] Implement semantic checks for DEALLOCATE statements.
The parser checks for duplicate dealloc-opts and expr
analysis checks that dealloc-opts are the right type.

Original-commit: flang-compiler/f18@1ade7f6617
Reviewed-on: https://github.com/flang-compiler/f18/pull/401
Tree-same-pre-rewrite: false
2019-04-10 22:17:44 -07:00
Eric Schweitz
28329e92b6 [flang] Merge pull request flang-compiler/f18#399 from schweitzpgi/qualtype
add QualifiedStmt class

Original-commit: flang-compiler/f18@984f9d7a29
Reviewed-on: https://github.com/flang-compiler/f18/pull/399
2019-04-11 09:55:23 -07:00
Eric Schweitz
4ebcf8b702 [flang] add std::move per review comments
Original-commit: flang-compiler/f18@0f3c1616ed
Reviewed-on: https://github.com/flang-compiler/f18/pull/399
2019-04-11 09:50:55 -07:00
Eric Schweitz
af375b2560 [flang] add QualifiedStmt class
Original-commit: flang-compiler/f18@6bc660c355
Reviewed-on: https://github.com/flang-compiler/f18/pull/399
Tree-same-pre-rewrite: false
2019-04-09 11:52:04 -07:00
psteinfeld
f6893e2409 [flang] Merge pull request flang-compiler/f18#398 from flang-compiler/ps-392
Fix issue 392, improve the error message when a DO loop is terminated by something other than
END DO or CONTINUE

Original-commit: flang-compiler/f18@747858b7eb
Reviewed-on: https://github.com/flang-compiler/f18/pull/398
2019-04-10 13:13:27 -07:00
Peter Steinfeld
95d8de80fe [flang] Changed the DO loop termination message to be different for the error
case.

Original-commit: flang-compiler/f18@51cf517cca
Reviewed-on: https://github.com/flang-compiler/f18/pull/398
2019-04-10 13:06:48 -07:00
Peter Steinfeld
5c7687bdbe [flang] Removed erroneous reference to "obsolete" and fixed up the message
as per Peter Klauser's recommendation.

Original-commit: flang-compiler/f18@f4d6d7007d
Reviewed-on: https://github.com/flang-compiler/f18/pull/398
Tree-same-pre-rewrite: false
2019-04-10 11:40:52 -07:00
Peter Steinfeld
7272fb7834 [flang] Fixed up messages per comments from Peter Klausler.
Original-commit: flang-compiler/f18@4103ca4297
Reviewed-on: https://github.com/flang-compiler/f18/pull/398
Tree-same-pre-rewrite: false
2019-04-10 10:52:47 -07:00
Peter Steinfeld
259c540191 [flang] Fix issue 392, improve the error message when a DO loop is
terminated by a statement other than END DO or CONTINUE.

Original-commit: flang-compiler/f18@0a9280eab1
Reviewed-on: https://github.com/flang-compiler/f18/pull/398
Tree-same-pre-rewrite: false
2019-04-10 09:50:27 -07:00
Peter Klausler
f02d8d3aed [flang] Merge pull request flang-compiler/f18#394 from flang-compiler/pmk-nml
Rewrite read-stmt/write-stmt parse trees for misparsed namelist group…

Original-commit: flang-compiler/f18@9e08bd4cec
Reviewed-on: https://github.com/flang-compiler/f18/pull/394
2019-04-10 09:28:06 -07:00
peter klausler
923c891111 [flang] Do not replace format with namelist if there is no unit (avoiding accidental language extension)
Original-commit: flang-compiler/f18@08562d9b86
Reviewed-on: https://github.com/flang-compiler/f18/pull/394
2019-04-10 08:52:46 -07:00
peter klausler
0e55f2463b [flang] Rewrite read-stmt/write-stmt parse trees for misparsed namelist group names
Original-commit: flang-compiler/f18@e0f1b1c469
Reviewed-on: https://github.com/flang-compiler/f18/pull/394
Tree-same-pre-rewrite: false
2019-04-10 08:52:42 -07:00
Eric Schweitz
798e5544b0 [flang] Merge pull request flang-compiler/f18#393 from schweitzpgi/forward
Forwarding, etc.

Original-commit: flang-compiler/f18@0e587c9315
Reviewed-on: https://github.com/flang-compiler/f18/pull/393
2019-04-10 08:14:40 -07:00
Eric Schweitz
253f361152 [flang] make the ctor use special type deduction so members can be moved and
copied in the same call

Original-commit: flang-compiler/f18@d18e8391fc
Reviewed-on: https://github.com/flang-compiler/f18/pull/393
2019-04-09 11:36:42 -07:00
Eric Schweitz
2f64d464d5 [flang] fix forward references
Original-commit: flang-compiler/f18@4d8902887d
Reviewed-on: https://github.com/flang-compiler/f18/pull/393
Tree-same-pre-rewrite: false
2019-04-09 11:36:28 -07:00
Tim Keith
3f4a22f53a [flang] Merge pull request flang-compiler/f18#395 from flang-compiler/tsk3
Fix source locations for some expressions

Original-commit: flang-compiler/f18@ac4fb9a1be
Reviewed-on: https://github.com/flang-compiler/f18/pull/395
2019-04-09 18:34:39 -07:00
Tim Keith
0671857b69 [flang] Fix source locations for some expressions
When expressions are parsed iteratively they weren't getting the correct
source positions. For example, when parsing an `add-operand` as a sequence
of `mult-operand`s separated by `mult-op`.

This shows up when we report an error message referring to this kind
of expression:
```
t.f90:1:11: error: Expected a LOGICAL expression
  if (i * j * k) then
            ^^^
```

The fix is to remember the location of the first operand and then
for each sub-expression (`i * j` and `i * j * k` in this example)
extend its location back to include that first operand.

Original-commit: flang-compiler/f18@e276f11f48
Reviewed-on: https://github.com/flang-compiler/f18/pull/395
2019-04-09 16:48:37 -07:00
Peter Klausler
90b8f222b8 [flang] Merge pull request flang-compiler/f18#390 from flang-compiler/pmk-389
Fix bug#389, prevent std::move() on forwarded lvalue references

Original-commit: flang-compiler/f18@198b0cc572
Reviewed-on: https://github.com/flang-compiler/f18/pull/390
2019-04-09 14:06:45 -07:00
peter klausler
4950dfa04e [flang] Redo without macros
Original-commit: flang-compiler/f18@8d955cfb3b
Reviewed-on: https://github.com/flang-compiler/f18/pull/390
2019-04-09 13:29:40 -07:00
peter klausler
3230a2f3ce [flang] fix bug found in testing
Original-commit: flang-compiler/f18@297ad78510
Reviewed-on: https://github.com/flang-compiler/f18/pull/390
Tree-same-pre-rewrite: false
2019-04-08 16:57:30 -07:00
peter klausler
8057a2ce32 [flang] Lots of debugging and refinement
Original-commit: flang-compiler/f18@1c3c30b540
Reviewed-on: https://github.com/flang-compiler/f18/pull/390
Tree-same-pre-rewrite: false
2019-04-08 16:16:55 -07:00
peter klausler
17c4ae070b [flang] Revert that reversion. Move semantics work just fine.
Original-commit: flang-compiler/f18@72bd8e7b03
Reviewed-on: https://github.com/flang-compiler/f18/pull/390
Tree-same-pre-rewrite: false
2019-04-08 14:29:47 -07:00
peter klausler
d0e7775431 [flang] Revert to forwarding on variadic messaging APIs
Original-commit: flang-compiler/f18@d2e464eb15
Reviewed-on: https://github.com/flang-compiler/f18/pull/390
Tree-same-pre-rewrite: false
2019-04-08 14:29:47 -07:00
peter klausler
84f7c4a658 [flang] Fix comment
Original-commit: flang-compiler/f18@d1345ca4fc
Reviewed-on: https://github.com/flang-compiler/f18/pull/390
Tree-same-pre-rewrite: false
2019-04-08 14:29:46 -07:00
peter klausler
dc9c3d1c46 [flang] Fix bug#389, prevent std::move() on forwarded lvalue references
Original-commit: flang-compiler/f18@9d61c091ad
Reviewed-on: https://github.com/flang-compiler/f18/pull/390
Tree-same-pre-rewrite: false
2019-04-08 14:29:45 -07:00
Steve Scalpone
1e8670bb4e [flang] Merge pull request flang-compiler/f18#388 from flang-compiler/check-nullify
Check semantic constraints for the nullify statement.

Original-commit: flang-compiler/f18@a2f19b6563
Reviewed-on: https://github.com/flang-compiler/f18/pull/388
2019-04-08 22:46:27 +02:00
Steve Scalpone
9fbc37abf7 [flang] Use structureComponent.component.symbol directly instead of getting
the symbol from the result of expression analysis.  (This opens the
door to moving structure component semantic checking to expression
analysis.)

Also, improve error messages, remove unused include files, and add
copyright headers to test files.

Original-commit: flang-compiler/f18@17780c40d7
Reviewed-on: https://github.com/flang-compiler/f18/pull/388
2019-04-08 00:26:10 -07:00
Steve Scalpone
37a53df82c [flang] Check semantic contraints for the nullify statement. The full
legality check is up to the user; however, some checks could
be done at compile time and others at runtime.  We choose to
skip any checking at compile time because it would not be
complete.

Note the instantiation of ExtractDataRef in expressions.cc.
This instantiation satifies the reference in check-nullify.cc
because expression.h just has a declaration of ExtractDataRef
instead of the definition.

Original-commit: flang-compiler/f18@b7199219fb
Reviewed-on: https://github.com/flang-compiler/f18/pull/388
Tree-same-pre-rewrite: false
2019-04-07 11:29:48 -07:00
Eric Schweitz
d48ac531b9 [flang] Merge pull request flang-compiler/f18#385 from schweitzpgi/fir3
fix some bugs with use of std::move

Original-commit: flang-compiler/f18@5569e8ede2
Reviewed-on: https://github.com/flang-compiler/f18/pull/385
2019-04-08 13:11:11 -07:00
Eric Schweitz
3151250d43 [flang] more fine-tuning of mixin classes to get lightweight constructors,
handle copies and moves, etc.

Original-commit: flang-compiler/f18@72a776b4c1
Reviewed-on: https://github.com/flang-compiler/f18/pull/385
2019-04-08 12:57:46 -07:00
Eric Schweitz
dbd8533e39 [flang] use std::forward, avoid std::move usage bugs
Original-commit: flang-compiler/f18@0d66bc2439
Reviewed-on: https://github.com/flang-compiler/f18/pull/385
Tree-same-pre-rewrite: false
2019-04-05 11:17:42 -07:00
Eric Schweitz
02faca4bb5 [flang] anchor virtual dtor
Original-commit: flang-compiler/f18@7121ccecb2
Reviewed-on: https://github.com/flang-compiler/f18/pull/385
Tree-same-pre-rewrite: false
2019-04-05 11:17:27 -07:00
Tim Keith
f0db68c952 [flang] Merge pull request flang-compiler/f18#387 from flang-compiler/tsk3
Update the grammar with team-value

Original-commit: flang-compiler/f18@b8e95dcd1d
Reviewed-on: https://github.com/flang-compiler/f18/pull/387
2019-04-08 10:37:08 -07:00
Tim Keith
1599d09041 [flang] Update the grammar with team-value
Everywhere we had `team-variable` except for the FORM TEAM statement is
now `team-value`, according to the N2162 draft standard. The grammar
and parse tree are updated to reflect that.

The addition of the production for `team-value` caused productions
R1177-R1181 to have their numbers increased by one.

Original-commit: flang-compiler/f18@9071f0a352
Reviewed-on: https://github.com/flang-compiler/f18/pull/387
2019-04-06 11:17:07 -07:00
Peter Klausler
ce69b801d1 [flang] Merge pull request flang-compiler/f18#386 from flang-compiler/pmk-sjs-reshape-bug
Shape analysis

Original-commit: flang-compiler/f18@47fc2c4b2c
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
2019-04-05 15:57:29 -07:00
peter klausler
94d0b8fb0a [flang] Address review comments
Original-commit: flang-compiler/f18@20cef2db45
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
2019-04-05 15:19:13 -07:00
peter klausler
130e166a6e [flang] Remove hash from expected module file output
Original-commit: flang-compiler/f18@8da47c44d2
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 13:09:02 -07:00
peter klausler
5c3197fa0b [flang] Fix implied DO folding with negative strides, add test
Original-commit: flang-compiler/f18@2e14b76041
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:58:19 -07:00
peter klausler
f0a19461ea [flang] Remove a needless Indirection
Original-commit: flang-compiler/f18@eb637232b1
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:56:13 -07:00
peter klausler
2e2389c46d [flang] More folding of SIZE()
Original-commit: flang-compiler/f18@23f62fea1d
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:56:12 -07:00
peter klausler
28184c4a49 [flang] Simplify expression visitor usage
Original-commit: flang-compiler/f18@9ab121d6a6
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:56:09 -07:00
peter klausler
c49f7da3f2 [flang] complete GetShape, compile
Original-commit: flang-compiler/f18@ff124f69a9
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:56:06 -07:00