Commit Graph

1563 Commits

Author SHA1 Message Date
Tim Keith 40d79cda9f [flang] Merge pull request flang-compiler/f18#380 from flang-compiler/tsk3
Pointer assignment bounds, section subscript, substring

Original-commit: flang-compiler/f18@1165a7c57f
Reviewed-on: https://github.com/flang-compiler/f18/pull/380
2019-04-03 09:54:38 -07:00
Tim Keith 0f4ef956a9 [flang] Pointer assignment bounds, section subscript, substring
Resolve bounds in pointer assignment.
Remove TODOs for section-subscript and substring range.
Add tests that verify they are done.

Original-commit: flang-compiler/f18@dc2dd85a9a
Reviewed-on: https://github.com/flang-compiler/f18/pull/380
2019-04-02 15:36:20 -07:00
jeanPerier 06481a4eff [flang] Fix doc typo
Merge pull request flang-compiler/f18#382 from flang-compiler/jeanPerier-typo-fix

Original-commit: flang-compiler/f18@101145787f
2019-04-03 01:41:04 -07:00
jeanPerier 5d18a30c83 [flang] Fix doc typo
Original-commit: flang-compiler/f18@c571a3faf3
2019-04-03 10:26:46 +02:00
psteinfeld 7e63e269ac [flang] Merge pull request flang-compiler/f18#379 from flang-compiler/options
Options comparison document

Original-commit: flang-compiler/f18@05b0f1dd83
Reviewed-on: https://github.com/flang-compiler/f18/pull/379
2019-04-02 19:10:08 -07:00
psteinfeld ed579e3e31 [flang] Update OptionComparison.md
Original-commit: flang-compiler/f18@27c77d164f
Reviewed-on: https://github.com/flang-compiler/f18/pull/379
2019-04-02 14:29:01 -07:00
psteinfeld d857930e68 [flang] Update OptionComparison.md
Original-commit: flang-compiler/f18@9926fc9145
Reviewed-on: https://github.com/flang-compiler/f18/pull/379
Tree-same-pre-rewrite: false
2019-04-02 11:57:45 -07:00
psteinfeld 6659aa3178 [flang] Fixed an encoding error
Original-commit: flang-compiler/f18@0f9eff1bb0
Reviewed-on: https://github.com/flang-compiler/f18/pull/379
Tree-same-pre-rewrite: false
2019-04-02 11:24:04 -07:00
psteinfeld 6461504ad9 [flang] Description of command line options for Fortran compilers.
Original-commit: flang-compiler/f18@f170466bb9
Reviewed-on: https://github.com/flang-compiler/f18/pull/379
Tree-same-pre-rewrite: false
2019-04-02 11:13:49 -07:00
Steve Scalpone d23c08468b [flang] Merge pull request flang-compiler/f18#375 from flang-compiler/if-stmt-2
Remove unused variable in check-if-stmt.cc

Original-commit: flang-compiler/f18@274d66bcb0
Reviewed-on: https://github.com/flang-compiler/f18/pull/375
2019-04-02 16:39:37 -07:00
Steve Scalpone c95b56d5a0 [flang] Remove unused variable in check-if-stmt.cc
Original-commit: flang-compiler/f18@520751311d
Reviewed-on: https://github.com/flang-compiler/f18/pull/375
2019-04-01 21:28:16 -07:00
Peter Klausler fb61247093 [flang] Merge pull request flang-compiler/f18#378 from flang-compiler/pmk-fix376
Fix bugs flang-compiler/f18#376, flang-compiler/f18#377

Original-commit: flang-compiler/f18@89ef8f9270
Reviewed-on: https://github.com/flang-compiler/f18/pull/378
2019-04-02 12:21:52 -07:00
peter klausler 4eade259b3 [flang] Address comments, clean up warnings
Original-commit: flang-compiler/f18@a5eeeb4430
Reviewed-on: https://github.com/flang-compiler/f18/pull/378
2019-04-02 11:56:19 -07:00
peter klausler 70b05522b0 [flang] Also fix bug#377
Original-commit: flang-compiler/f18@56631cf5e1
Reviewed-on: https://github.com/flang-compiler/f18/pull/378
Tree-same-pre-rewrite: false
2019-04-02 11:02:30 -07:00
peter klausler 5dae2fb1a9 [flang] Clean up and prep for review
Original-commit: flang-compiler/f18@3f96c673e0
Reviewed-on: https://github.com/flang-compiler/f18/pull/378
Tree-same-pre-rewrite: false
2019-04-02 10:59:11 -07:00
peter klausler ec2448123e [flang] Fix bug flang-compiler/f18#376, internal error when correcting misparse of structure constructor
Original-commit: flang-compiler/f18@f18a94ef96
Reviewed-on: https://github.com/flang-compiler/f18/pull/378
Tree-same-pre-rewrite: false
2019-04-02 10:59:09 -07:00
Tim Keith 304b3797c0 [flang] Merge pull request flang-compiler/f18#368 from flang-compiler/tsk4b
Rework .mod file writing for subprogram interfaces

Original-commit: flang-compiler/f18@807824cb51
Reviewed-on: https://github.com/flang-compiler/f18/pull/368
2019-04-02 10:55:16 -07:00
Tim Keith 720b1a7de4 [flang] Fix test
A sequence type must have a component.

Original-commit: flang-compiler/f18@937b3eaf06
Reviewed-on: https://github.com/flang-compiler/f18/pull/368
2019-04-01 07:15:03 -07:00
Tim Keith d628a6f983 [flang] Rework .mod file writing for subprogram interfaces
A subprogram interface in a `.mod` file requires all of the symbols
needed to declare the function return value and dummy arguments.
Some of those were missing.

`SubprogramSymbolCollector` recursively discovers all such symbols,
including symbols used in type parameters, array bounds, character
lengths, parent types.

Common blocks require special handling: If any of the symbols that
are need appear in a common block, we have to include that common block
and all other symbols in it. To make that easier to figure out, add the
`commonBlock` property to `ObjectEntityDetails` to map the entity to
the common block it is in, if any.

Original-commit: flang-compiler/f18@08709f8e88
Reviewed-on: https://github.com/flang-compiler/f18/pull/368
Tree-same-pre-rewrite: false
2019-03-29 15:04:17 -07:00
Tim Keith b4dc611eb4 [flang] Resolve LHS in pointer assignment
Original-commit: flang-compiler/f18@9a3525275c
Reviewed-on: https://github.com/flang-compiler/f18/pull/368
Tree-same-pre-rewrite: false
2019-03-29 09:08:49 -07:00
Tim Keith e1ea983b0a [flang] Dump function return attributes
Also, change SubprogramDetails::result_ from `std::optional<Symbol *>`
to `Symbol *`. We don't need two levels of optional-ness.

Original-commit: flang-compiler/f18@db3b874946
Reviewed-on: https://github.com/flang-compiler/f18/pull/368
Tree-same-pre-rewrite: false
2019-03-29 09:08:18 -07:00
Tim Keith fdba48a74c [flang] Don't add inherited procedures to generic binding
In this example:
```
  type t1
  contains
    procedure, nopass :: s1
    generic :: foo => s1
  end type
  type, extends(t1) :: t2
  contains
    procedure, nopass :: s2
    generic :: foo => s2
  end type
```

The GenericBindingDetails for foo in t2 include both s1 and s2 as
specific procs. There is no way to distinguish between the binding in
the current type and the binding that was inherited. In particular,
the .mod file will have a binding for s1 in t2, so it won't match the
original source (for exampke, see the old version of modfile14.f90).

Original-commit: flang-compiler/f18@4e2c6be5cb
Reviewed-on: https://github.com/flang-compiler/f18/pull/368
Tree-same-pre-rewrite: false
2019-03-29 09:07:27 -07:00
Peter Klausler 423b0e8606 [flang] Merge pull request flang-compiler/f18#370 from flang-compiler/pmk-fix363
Fix flang-compiler/f18#363: Adjust member function names in integer.h to avoid confusion.

Original-commit: flang-compiler/f18@bdd750f742
Reviewed-on: https://github.com/flang-compiler/f18/pull/370
2019-04-02 09:26:05 -07:00
peter klausler e2e2ec387a [flang] Adjust member function names in integer.h to avoid confusion.
Original-commit: flang-compiler/f18@56dba8fa08
Reviewed-on: https://github.com/flang-compiler/f18/pull/370
2019-04-01 16:52:03 -07:00
Peter Klausler 6a24189119 [flang] Merge pull request flang-compiler/f18#373 from flang-compiler/pmk-source
Fix flang-compiler/f18#358: Define and use UnlabeledStatement<> for if & forall

Original-commit: flang-compiler/f18@7c76ba5158
Reviewed-on: https://github.com/flang-compiler/f18/pull/373
2019-04-01 16:49:59 -07:00
peter klausler 39b7433194 [flang] some debugging after more testing
Original-commit: flang-compiler/f18@005b841dd1
Reviewed-on: https://github.com/flang-compiler/f18/pull/373
2019-04-01 16:23:34 -07:00
peter klausler 3c5a25a1bd [flang] Use source location in IF statement checks.
Original-commit: flang-compiler/f18@9e08746e2b
Reviewed-on: https://github.com/flang-compiler/f18/pull/373
Tree-same-pre-rewrite: false
2019-04-01 16:23:34 -07:00
peter klausler 1fb4869367 [flang] Fix typo
Original-commit: flang-compiler/f18@c5b05009df
Reviewed-on: https://github.com/flang-compiler/f18/pull/373
Tree-same-pre-rewrite: false
2019-04-01 16:23:33 -07:00
peter klausler 6fa22f95e0 [flang] Fix typo
Original-commit: flang-compiler/f18@6be309300e
Reviewed-on: https://github.com/flang-compiler/f18/pull/373
Tree-same-pre-rewrite: false
2019-04-01 16:23:33 -07:00
peter klausler 0ff94b9d0b [flang] Define and use UnlabeledStatement<> for if & forall
Original-commit: flang-compiler/f18@028e6aba6c
Reviewed-on: https://github.com/flang-compiler/f18/pull/373
Tree-same-pre-rewrite: false
2019-04-01 16:23:32 -07:00
Tim Keith 10442cc825 [flang] Merge pull request flang-compiler/f18#372 from flang-compiler/tsk3
Name resolution bug fixes

Original-commit: flang-compiler/f18@74c994e9a5
Reviewed-on: https://github.com/flang-compiler/f18/pull/372
2019-04-01 16:21:44 -07:00
Tim Keith 68df5ac3a2 [flang] Name resolution bug fixes
Fix a but where a derived type was not use-associated correctly
due to missing call to `GetUltimate()`.

Fix a bug with access statement, generic interface, and derived
type all with the same name.

Remove some TODOs that have been done.

Original-commit: flang-compiler/f18@4ba2b64c6d
Reviewed-on: https://github.com/flang-compiler/f18/pull/372
2019-04-01 13:08:57 -07:00
Peter Klausler cf67cbe724 [flang] Merge pull request flang-compiler/f18#371 from flang-compiler/pmk-parens
Fix flang-compiler/f18#350: insert parens into formatted expressions only when required

Original-commit: flang-compiler/f18@24fd62850c
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
2019-04-01 15:20:18 -07:00
peter klausler f719b4ae6e [flang] Revert to AsFortran in module file output.
Original-commit: flang-compiler/f18@3dc7f685d1
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
2019-04-01 15:02:23 -07:00
peter klausler af958345ce [flang] Use operator<< in test.
Original-commit: flang-compiler/f18@e3f321e9f0
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 13:03:26 -07:00
peter klausler 547a0601f1 [flang] Logical operation precedence
Original-commit: flang-compiler/f18@060bc39fb4
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 13:01:42 -07:00
peter klausler 9e9b9f0776 [flang] Pass tests
Original-commit: flang-compiler/f18@ffb057f262
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 12:30:08 -07:00
peter klausler b35f4a98e2 [flang] work in progress
Original-commit: flang-compiler/f18@33ea8e506a
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 10:59:00 -07:00
peter klausler 95b4e65ecf [flang] Move some AsFortran() implementations into new formatting.cc; use precedence for parentheses
Original-commit: flang-compiler/f18@2b5fa051df
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 10:58:55 -07:00
Peter Klausler ed88a239cc [flang] Merge pull request flang-compiler/f18#352 from flang-compiler/pmk-parsing
Fix some parsing issues found by Steve

Original-commit: flang-compiler/f18@683766f7f5
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
2019-04-01 10:49:45 -07:00
peter klausler 4d21120d89 [flang] Add extension edit descriptors to the unparser.
Original-commit: flang-compiler/f18@74e09e249a
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
2019-04-01 10:14:20 -07:00
peter klausler e0f76d2306 [flang] Support CONVERT= and DISPOSE= on INQUIRE
Original-commit: flang-compiler/f18@fbedd32376
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
2019-04-01 10:14:19 -07:00
peter klausler 822810f017 [flang] Check int literals for overflow when kind is known.
improve test

Original-commit: flang-compiler/f18@09ce783cd3
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
2019-04-01 10:14:16 -07:00
peter klausler 1d2a212c38 [flang] Allow dollar and backslash formats
Original-commit: flang-compiler/f18@4d8d6e599e
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
2019-04-01 10:14:15 -07:00
peter klausler 5b0e18b0e4 [flang] Allow multiple associations on legacy POINTER declaration
fix that fix

Original-commit: flang-compiler/f18@f096b73842
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
2019-04-01 10:14:12 -07:00
jeanPerier e278ed5a0a [flang] Update documentation to reflect current intrinsic procedure support in f18
Merge pull request flang-compiler/f18#366 from flang-compiler/jpr0

Original-commit: flang-compiler/f18@0f310c8a8c
2019-04-01 01:44:51 -07:00
Jean Perier f9ab321ed4 [flang] Address review comment
Original-commit: flang-compiler/f18@1e3b3b457d
2019-04-01 01:39:19 -07:00
Jean Perier 3774e9d173 [flang] Update documentation with status of intrinsic procedure support in f18
Original-commit: flang-compiler/f18@aa12037a5b
Tree-same-pre-rewrite: false
2019-03-29 08:48:39 -07:00
Jean Perier 382aafad68 [flang] Remove useless dummy return statements
I first added these because I had issues with return type deduction
in lambdas, but they are actually useless when the return type is
specified in the lambda signature.

Original-commit: flang-compiler/f18@5bcbbd8bdc
Tree-same-pre-rewrite: false
2019-03-29 04:30:35 -07:00
psteinfeld 54a3e9af38 [flang] Merge pull request flang-compiler/f18#365 from flang-compiler/do2
Fix semantics test for "DO".

Original-commit: flang-compiler/f18@62794b980e
Reviewed-on: https://github.com/flang-compiler/f18/pull/365
2019-03-29 08:48:24 -07:00