Commit graph

810 commits

Author SHA1 Message Date
peter klausler d28adc2e7f [flang] Use braces for auto initialization in lib/common and lib/evaluate
Original-commit: flang-compiler/f18@b0d1dd434b
Reviewed-on: https://github.com/flang-compiler/f18/pull/119
Tree-same-pre-rewrite: false
2018-07-11 10:21:34 -07:00
peter klausler f147abdee2 [flang] Use braces in auto initializers.
Original-commit: flang-compiler/f18@b68fdff537
Reviewed-on: https://github.com/flang-compiler/f18/pull/119
Tree-same-pre-rewrite: false
2018-07-11 10:21:32 -07:00
Peter Klausler bb51015002 [flang] Merge pull request flang-compiler/f18#118 from flang-compiler/pmk2
Better error recovery in the face of input that's not Fortran at all

Original-commit: flang-compiler/f18@7edf728444
Reviewed-on: https://github.com/flang-compiler/f18/pull/118
2018-07-11 10:18:49 -07:00
peter klausler 8d0f44fb91 [flang] Better error recovery (for a case from Tim) and fix a problem where context is lost.
Original-commit: flang-compiler/f18@522822fd5a
Reviewed-on: https://github.com/flang-compiler/f18/pull/118
2018-07-10 16:09:21 -07:00
Peter Klausler 5976b66417 [flang] Merge pull request flang-compiler/f18#117 from flang-compiler/pmk1
Variables

Original-commit: flang-compiler/f18@d38c14ef24
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
2018-07-10 10:58:34 -07:00
peter klausler ea08e1bc72 [flang] Extend documentation
Original-commit: flang-compiler/f18@ac375a00ba
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
2018-07-10 10:56:55 -07:00
peter klausler b081bc9d04 [flang] Address review comments
Original-commit: flang-compiler/f18@9e59b9b79d
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
Tree-same-pre-rewrite: false
2018-07-10 10:18:34 -07:00
peter klausler 10d54a505a [flang] Resolve build issues with older compilers.
Original-commit: flang-compiler/f18@d8723284d3
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
Tree-same-pre-rewrite: false
2018-07-09 16:26:01 -07:00
peter klausler 74b12f1a31 [flang] Refine variable structure definitions, add references to Standard.
Original-commit: flang-compiler/f18@dbc6d45e02
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
Tree-same-pre-rewrite: false
2018-07-09 16:26:01 -07:00
peter klausler d218ddcae4 [flang] Start cleaning up for merging.
Original-commit: flang-compiler/f18@7355bd5b42
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
Tree-same-pre-rewrite: false
2018-07-09 16:26:01 -07:00
peter klausler e6fc51c731 [flang] Use Indirection. Get variables to work in int expressions.
Original-commit: flang-compiler/f18@1000717da8
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
Tree-same-pre-rewrite: false
2018-07-09 16:26:00 -07:00
peter klausler f8f98ca3b6 [flang] More abstraction in expressions.
Original-commit: flang-compiler/f18@2dc425acf5
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
Tree-same-pre-rewrite: false
2018-07-09 16:26:00 -07:00
peter klausler d7b3accb32 [flang] tweaks
Original-commit: flang-compiler/f18@624c1d2ec8
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
Tree-same-pre-rewrite: false
2018-07-09 16:25:59 -07:00
peter klausler 897e78defb [flang] clean up dumping code
Original-commit: flang-compiler/f18@2969888360
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
Tree-same-pre-rewrite: false
2018-07-09 16:25:58 -07:00
peter klausler 22786d89e4 [flang] Fix issue flang-compiler/f18#113.
Original-commit: flang-compiler/f18@835e51b6e6
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
Tree-same-pre-rewrite: false
2018-07-09 16:25:58 -07:00
peter klausler 06fe266998 [flang] work on variables and traversal
Original-commit: flang-compiler/f18@432779b221
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
Tree-same-pre-rewrite: false
2018-07-09 16:25:57 -07:00
peter klausler 4795738c40 [flang] Commit work in progress to branch for f18 repository move.
Original-commit: flang-compiler/f18@e0db6903c7
Reviewed-on: https://github.com/flang-compiler/f18/pull/117
Tree-same-pre-rewrite: false
2018-07-09 16:25:57 -07:00
Tim Keith 0b487a1f51 [flang] Merge pull request flang-compiler/f18#116 from flang-compiler/tsk8
Fix bug recognizing derived type constructor call

Original-commit: flang-compiler/f18@e529105144
Reviewed-on: https://github.com/flang-compiler/f18/pull/116
2018-07-09 16:02:23 -07:00
Tim Keith d7d69474c8 [flang] Fix bug recognizing derived type constructor call
A ProcedureDesignator is a derived type constructor call if the name
resolves to a derived type. We need to recognize it as such and not
report an error. It may be in another derived type so we have to call
FindSymbol() first to find the derived type.

Most of the diffs are due to `symbol` changing from a reference to a
pointer.

In this example we were reporting an error on the first `t1()` and
resolving the second as an external function call.
```
module m
  type :: t1
  end type
  type(t1) :: x = t1()
  type t2
    type(t1) :: y = t1()
  end type
end module
```

Original-commit: flang-compiler/f18@717b22ca2b
Reviewed-on: https://github.com/flang-compiler/f18/pull/116
2018-07-09 15:25:49 -07:00
Tim Keith b1ecac1e74 [flang] Merge pull request flang-compiler/f18#114 from flang-compiler/tsk5
Check consistency of generic interfaces.

Original-commit: flang-compiler/f18@16ed60240a
Reviewed-on: https://github.com/flang-compiler/f18/pull/114
2018-07-05 14:47:48 -07:00
Tim Keith a39376c08b [flang] Add missing copyright.
Original-commit: flang-compiler/f18@cf7087b381
Reviewed-on: https://github.com/flang-compiler/f18/pull/114
2018-07-05 10:36:18 -07:00
Tim Keith c0c19100be [flang] Check consistency of generic interfaces.
The specific procedures in a generic interface must be all functions or
all subroutines. If there is a derived type with the same name they can
only be functions.

Original-commit: flang-compiler/f18@e02cef047a
Reviewed-on: https://github.com/flang-compiler/f18/pull/114
Tree-same-pre-rewrite: false
2018-07-05 10:28:34 -07:00
Tim Keith fd99bb43e8 [flang] Merge pull request flang-compiler/f18#112 from ThePortlandGroup/tsk5
Support unparse with symbol annotations.

Original-commit: flang-compiler/f18@fcca042a10
Reviewed-on: https://github.com/flang-compiler/f18/pull/112
2018-06-26 15:43:01 -07:00
Tim Keith f77f9309fc [flang] Add -funparse-with-symbols to enable new behavior
Original-commit: flang-compiler/f18@7ad44e7e33
Reviewed-on: https://github.com/flang-compiler/f18/pull/112
2018-06-26 15:40:52 -07:00
Tim Keith 89840b5087 [flang] Support unparse with symbol annotations.
When `-fdebug-dump-symbols` is supplied with `-funparse`, include symbol
information in comments in the Fortran output. This will be used for
testing to verify that correct symbols are defined and references in
the right place.

In `UnparseWithSymbols()`, walk the parse tree and collect symbol
definitions and references, organized by statement. When a symbol is
defined across several statement it is associated with the first.
The definition of implicitly defined symbols is associated with the
first reference.

To write out the symbol information, a new optional argument is added to
`Unparse()`: it is a function that is called immediately before each
statement is unparsed. We pass in a function that prints out the symbol
information collected for that statement.

Add `Symbol::GetType()` to make it easier to write the symbol types
and add `Symbol::SetType()` for uniformity.

Original-commit: flang-compiler/f18@2e827de4ad
Reviewed-on: https://github.com/flang-compiler/f18/pull/112
Tree-same-pre-rewrite: false
2018-06-26 15:01:42 -07:00
Peter Klausler ffbd0b2b17 [flang] Merge pull request flang-compiler/f18#111 from ThePortlandGroup/pmk-expr
Expressions

Original-commit: flang-compiler/f18@802e18cb5a
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
2018-06-25 09:32:14 -07:00
peter klausler 97f0a05235 [flang] Incorporate suggestions from code review.
Original-commit: flang-compiler/f18@c66bd9ab15
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
2018-06-22 16:44:23 -07:00
peter klausler cf410675cf [flang] Begin folding, with simple test, as sanity check on usability.
Original-commit: flang-compiler/f18@3839c65cd5
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:59:28 -07:00
peter klausler efcbf1f7df [flang] clean up for push
Original-commit: flang-compiler/f18@8b5bbcedba
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:59:28 -07:00
peter klausler 4c11bc07d4 [flang] Prepare for check-in
Original-commit: flang-compiler/f18@2f5b2d5f40
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:59:28 -07:00
peter klausler 4da490882b [flang] Operator overloads for expression construction.
Original-commit: flang-compiler/f18@a4d3a736cf
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:59:27 -07:00
peter klausler e5e5f6319f [flang] clean up clang warnings from master
Original-commit: flang-compiler/f18@1c9aa95f8d
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:59:25 -07:00
peter klausler 7a3f25ce8a [flang] More refinement, use const on subexpressions.
Original-commit: flang-compiler/f18@f484325c61
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:58:06 -07:00
peter klausler 953c667703 [flang] Simplification
Original-commit: flang-compiler/f18@a50ce6e499
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:58:06 -07:00
peter klausler a55ea1b5d5 [flang] fix builds, all now clear
Original-commit: flang-compiler/f18@7c32a531a0
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:58:06 -07:00
peter klausler 4b3dea1d38 [flang] Dump complex expressions
Original-commit: flang-compiler/f18@da25b870d3
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:58:05 -07:00
peter klausler 32b2ce7282 [flang] More dumping code
Original-commit: flang-compiler/f18@43d147144a
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:58:05 -07:00
peter klausler 508ed8dd76 [flang] Use unique_ptr for operands. Refactor comparisons.
Original-commit: flang-compiler/f18@92e154e76e
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:58:05 -07:00
peter klausler a88a55b500 [flang] Expression formatting
Original-commit: flang-compiler/f18@3d0977a57e
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:58:04 -07:00
peter klausler dd5470b128 [flang] Change memcpy to memmove for overlap case.
Original-commit: flang-compiler/f18@cb400284e4
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:58:04 -07:00
peter klausler 9e1ba097f5 [flang] Numeric constant formatting and tests.
Original-commit: flang-compiler/f18@ade6442020
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:58:04 -07:00
peter klausler 3d867f3202 [flang] Character LEN, operator overloadings
Original-commit: flang-compiler/f18@08c32de24c
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:58:04 -07:00
peter klausler 229d6c413a [flang] Finish first cut at expression.h.
Original-commit: flang-compiler/f18@07142e7fad
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:56:18 -07:00
peter klausler e03280c09c [flang] Expression work
Original-commit: flang-compiler/f18@b60c84fff4
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:56:17 -07:00
peter klausler c2e06e25cd [flang] reformat c++
Original-commit: flang-compiler/f18@6c5c9b3165
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:56:17 -07:00
peter klausler ca1b8d80f6 [flang] first cut at expressions
Original-commit: flang-compiler/f18@b06c5486e4
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:56:17 -07:00
peter klausler cc13dbdde1 [flang] begin expression representation
Original-commit: flang-compiler/f18@627c057d5c
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:56:16 -07:00
peter klausler dacbfeef32 [flang] Documentation
Original-commit: flang-compiler/f18@27f6927053
Reviewed-on: https://github.com/flang-compiler/f18/pull/111
Tree-same-pre-rewrite: false
2018-06-22 14:56:16 -07:00
Tim Keith ec20aa2dd4 [flang] Merge pull request flang-compiler/f18#110 from ThePortlandGroup/tsk1
Fix problems in PR 109 when compiling with clang.

Original-commit: flang-compiler/f18@f21c334589
Reviewed-on: https://github.com/flang-compiler/f18/pull/110
2018-06-22 14:45:41 -07:00
Tim Keith c7eb38530c [flang] Fix problems in PR 109 when compiling with clang.
This gets the code base back to compiling cleanly with clang after
pull request 109.

There were two overloadings of `Post(const parser::DeclarationTypeSpec::Type &)`.
The one in DeclarationVisitor needed to call the one in DeclTypeSpecVisitor.
This was fixed by introducing a new function, SetDerivedDeclTypeSpec, to do
the equivalent thing.

Original-commit: flang-compiler/f18@81e447bf4e
Reviewed-on: https://github.com/flang-compiler/f18/pull/110
2018-06-22 14:08:04 -07:00