platform/upstream/llvm.git
5 years ago[flang] Rework expression constraint checking
peter klausler [Fri, 28 Dec 2018 23:58:17 +0000 (15:58 -0800)]
[flang] Rework expression constraint checking

Original-commit: flang-compiler/f18@7a31c1ed2ba3c57575d3bd98f6b13dfc94a07af0
Reviewed-on: https://github.com/flang-compiler/f18/pull/250
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#249 from flang-compiler/tsk3
Tim Keith [Fri, 28 Dec 2018 18:33:51 +0000 (10:33 -0800)]
[flang] Merge pull request flang-compiler/f18#249 from flang-compiler/tsk3

Various name resolution improvements

Original-commit: flang-compiler/f18@a7c41c0ccdf0131d75cdd8c6165153c23e73b62b
Reviewed-on: https://github.com/flang-compiler/f18/pull/249

5 years ago[flang] Add support for type-bound generics
Tim Keith [Wed, 26 Dec 2018 21:31:13 +0000 (13:31 -0800)]
[flang] Add support for type-bound generics

Record the bindings in a symbol with GenericBindingDetails, including
bindings inherited from extended types. Check that they have consistent
accessibility.

Original-commit: flang-compiler/f18@0f780abcea829d807493cf6a71eab9d8cffd4673
Reviewed-on: https://github.com/flang-compiler/f18/pull/249

5 years ago[flang] Handle structure constructor in entity-decl
Tim Keith [Wed, 19 Dec 2018 01:19:41 +0000 (17:19 -0800)]
[flang] Handle structure constructor in entity-decl

As with array constructors, we can encounter a decl-type-spec for a
structure-constructor while the decl-type-spec for the
type-declaration-stmt is still active. So here too we need to save and
restore the state.

In this case, it is done in DeclarationVisitor, so add
SetDeclTypeSpecState() to get and set the state.

Example where this occurs:
```
type(t(2)) :: x = t(2)()
```

Original-commit: flang-compiler/f18@aa5ca8d7b21d75ecd3c66a59589efd3ebb66af48
Reviewed-on: https://github.com/flang-compiler/f18/pull/249
Tree-same-pre-rewrite: false

5 years ago[flang] Fix bug making symbol for external procedure
Tim Keith [Wed, 19 Dec 2018 00:35:31 +0000 (16:35 -0800)]
[flang] Fix bug making symbol for external procedure

When we encounter a ProcedureDesignator, if it is an external procedure
(i.e. there is no visible declaration) it must be implicitly created in
the global scope, not the current scope.

If there is already a symbol there (i.e. a module) it is an error, even
if that symbol is not visible due to an IMPORT statement.

Original-commit: flang-compiler/f18@835e234ded3f4f9b47565c46fcbf42e25e966550
Reviewed-on: https://github.com/flang-compiler/f18/pull/249
Tree-same-pre-rewrite: false

5 years ago[flang] Handle array constructor in entity-decl
Tim Keith [Tue, 18 Dec 2018 22:35:58 +0000 (14:35 -0800)]
[flang] Handle array constructor in entity-decl

We can encounter a decl-type-spec for an array constructor while the
decl-type-spec for type-declaration-stmt is still active:
```
integer, allocatable :: a(:) = [integer :: 1, 2, 3]
```

To handle this, save the state of the current decl-type-spec while
processing the second one, then restore when done.

Original-commit: flang-compiler/f18@d125a0f612a320bd6faa103665ddfe0cb48199d9
Reviewed-on: https://github.com/flang-compiler/f18/pull/249
Tree-same-pre-rewrite: false

5 years ago[flang] Resolve names in ProcedureStmt and GenericStmt
Tim Keith [Tue, 18 Dec 2018 15:59:40 +0000 (07:59 -0800)]
[flang] Resolve names in ProcedureStmt and GenericStmt

We need to save the names of specific procedures that appear in a
ProcedureStmt or GenericStmt to resolve at the end of the specification
section. They may be forward references to interface bodies.

We were saving them in the GenericDetails but that was not the right
place: we need to save the parser::Name so that we can eventually
resolve it to a Symbol, but the symbol table should not contains
references to Name because they go away with the parse tree.

The fix is to save the mapping in a new multimap, specificProcs_ in
InterfaceVisitor. We can reference parser::Names there and resolve them
during ResolveSpecificsInGenerics(). We no longer need to clutter
GenericDetails with data structures for unresolved names.

Also handle the case where a specific procedure is use-associated from
another module.

Original-commit: flang-compiler/f18@c7f7b1e72da58a125fcc9ca6ea9cb23a8d4a1c6c
Reviewed-on: https://github.com/flang-compiler/f18/pull/249
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#247 from flang-compiler/tsk3
Tim Keith [Tue, 18 Dec 2018 15:45:39 +0000 (07:45 -0800)]
[flang] Merge pull request flang-compiler/f18#247 from flang-compiler/tsk3

Support character types

Original-commit: flang-compiler/f18@2884608901c4cced1f3860058afca832499bb218
Reviewed-on: https://github.com/flang-compiler/f18/pull/247

5 years ago[flang] Handle TypeStar and ClassStar in GetSymbolType()
Tim Keith [Tue, 18 Dec 2018 01:22:42 +0000 (17:22 -0800)]
[flang] Handle TypeStar and ClassStar in GetSymbolType()

Add DeclTypeSpec::AsDerived() to get the DerivedTypeSpec from a
DeclTypeSpec when it has one.

Original-commit: flang-compiler/f18@3bd921d8f365e9fb1422aec96d02b9ec333c4d68
Reviewed-on: https://github.com/flang-compiler/f18/pull/247

5 years ago[flang] Treat CHARACTER like other intrinsic types with default kind
Tim Keith [Mon, 17 Dec 2018 23:46:30 +0000 (15:46 -0800)]
[flang] Treat CHARACTER like other intrinsic types with default kind

Character decl-type-specs with no kind specified had no kind written to
the .mod file. That was different from the other intrinsic types which
always have an explicit type. This change make character like the other
intrinsic types.

Original-commit: flang-compiler/f18@5b4f047a13c76e56579c1f06dbdf7b74358f16aa
Reviewed-on: https://github.com/flang-compiler/f18/pull/247
Tree-same-pre-rewrite: false

5 years ago[flang] Simplify creation of Expr values from ints.
Tim Keith [Mon, 17 Dec 2018 23:19:11 +0000 (15:19 -0800)]
[flang] Simplify creation of Expr values from ints.

Original-commit: flang-compiler/f18@56f007493bdc74d155d85cfaa96166907a17c54a
Reviewed-on: https://github.com/flang-compiler/f18/pull/247
Tree-same-pre-rewrite: false

5 years ago[flang] Refactoring: improve some names
Tim Keith [Mon, 17 Dec 2018 20:41:43 +0000 (12:41 -0800)]
[flang] Refactoring: improve some names

IntrinsicTypeSpec was used for all intrinsics except for character.
Change it to be a common base class for NumericTypeSpec,
LogicalTypeSpec, and CharacterTypeSpec.

Change DeclTypeSpec to categorize the intrinsics as Numeric, Logical,
and Character. Add some utility methods: AsIntrinsic() and IsNumeric().

In scope.h, give the functions that create DeclTypeSpecs better names.

In semantics.h, replace MakeIntrinsicTypeSpec() with MakeNumericType()
and MakeLogicalType() as it does not apply to character types.

Original-commit: flang-compiler/f18@8ad92d069c5ac56a9610937e5669848b67664203
Reviewed-on: https://github.com/flang-compiler/f18/pull/247
Tree-same-pre-rewrite: false

5 years ago[flang] Add support for character type specs
Tim Keith [Fri, 14 Dec 2018 22:04:15 +0000 (14:04 -0800)]
[flang] Add support for character type specs

Recognize the various ways of specifying character lengths.

Define CharacterTypeSpec with length and kind and store them in the
current scope, as is done with DerivedTypeSpec (which can also have
length parameters).

Note: IntrinsicTypeSpec is no longer used for characters, so it
should have a different name. Similarly, in DeclTypeSpec::Category,
Intrinsic does not include Character.

Original-commit: flang-compiler/f18@5f847851933b27dd30bd8165d16a7c390e787b9a
Reviewed-on: https://github.com/flang-compiler/f18/pull/247
Tree-same-pre-rewrite: false

5 years ago[flang] Rework how DeclTypeSpecs are stored
Tim Keith [Tue, 11 Dec 2018 22:51:08 +0000 (14:51 -0800)]
[flang] Rework how DeclTypeSpecs are stored

Now DeclTypeSpecs are stored in the scope so that they remain available
as long as the scope exists. DeclTypeSpecs for intrinsic types are
stored in the global scope; those for derived types are in the current
scope. They can contains type parameter values so they can't be reused.

Add `Semantics::MakeIntrinsicTypeSpec` to simplify creating
DeclTypeSpecs for intrinsic types.

Replace `std::optional<DeclTypeSpec>` with `DeclTypeSpec *` as they do
not need to be copied around.

Also fix a small bug with writing `class(t(...))` to the module file --
the type parameters were missing.

Original-commit: flang-compiler/f18@e4744418fc1cdc9728bba4b9ecde51cb5bdd2efa
Reviewed-on: https://github.com/flang-compiler/f18/pull/247
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#244 from flang-compiler/pmk1
Peter Klausler [Mon, 17 Dec 2018 18:21:25 +0000 (10:21 -0800)]
[flang] Merge pull request flang-compiler/f18#244 from flang-compiler/pmk1

fix bug noticed by Jean

Original-commit: flang-compiler/f18@c4c54f05f3a5aba2d9c429cb99d22f57dfdb8541
Reviewed-on: https://github.com/flang-compiler/f18/pull/244

5 years ago[flang] fix bug noticed by Jean
peter klausler [Fri, 14 Dec 2018 19:07:12 +0000 (11:07 -0800)]
[flang] fix bug noticed by Jean

Original-commit: flang-compiler/f18@9acbff7585fbc113391066e5e79c1059c0e22d54
Reviewed-on: https://github.com/flang-compiler/f18/pull/244

5 years ago[flang] Merge pull request flang-compiler/f18#245 from flang-compiler/pmk3
Peter Klausler [Fri, 14 Dec 2018 21:18:21 +0000 (13:18 -0800)]
[flang] Merge pull request flang-compiler/f18#245 from flang-compiler/pmk3

fix crash that Tim ran into

Original-commit: flang-compiler/f18@d7e914719e7ab9851c9d8e9127930c77f0ce47a2
Reviewed-on: https://github.com/flang-compiler/f18/pull/245

5 years ago[flang] fix crash that Tim ran into
peter klausler [Fri, 14 Dec 2018 19:23:14 +0000 (11:23 -0800)]
[flang] fix crash that Tim ran into

Original-commit: flang-compiler/f18@498a8c6fb82be85a60d8ccb18e398c6a3336a035
Reviewed-on: https://github.com/flang-compiler/f18/pull/245

5 years ago[flang] Merge pull request flang-compiler/f18#246 from flang-compiler/pmk4
Peter Klausler [Fri, 14 Dec 2018 21:17:16 +0000 (13:17 -0800)]
[flang] Merge pull request flang-compiler/f18#246 from flang-compiler/pmk4

add Unwrap

Original-commit: flang-compiler/f18@7516db24478835ea75e9e2082e8d71e9dd6ec15d
Reviewed-on: https://github.com/flang-compiler/f18/pull/246

5 years ago[flang] add Unwrap
peter klausler [Fri, 14 Dec 2018 19:33:32 +0000 (11:33 -0800)]
[flang] add Unwrap

Original-commit: flang-compiler/f18@3003363a2d5644a4c4ce1fc93f04ac70b7e2fe38
Reviewed-on: https://github.com/flang-compiler/f18/pull/246

5 years ago[flang] Merge pull request flang-compiler/f18#243 from flang-compiler/pmk3
Peter Klausler [Tue, 11 Dec 2018 22:48:25 +0000 (14:48 -0800)]
[flang] Merge pull request flang-compiler/f18#243 from flang-compiler/pmk3

Strengthen FORALL scoping check

Original-commit: flang-compiler/f18@0eac648123d00383bfe9acc8e828cdd05dc41c83
Reviewed-on: https://github.com/flang-compiler/f18/pull/243

5 years ago[flang] improve test
peter klausler [Tue, 11 Dec 2018 22:40:01 +0000 (14:40 -0800)]
[flang] improve test

Original-commit: flang-compiler/f18@cfcf9dae4d9268c84baaf87ab1bb85832f100f07
Reviewed-on: https://github.com/flang-compiler/f18/pull/243

5 years ago[flang] revert obsolete tweak
peter klausler [Tue, 11 Dec 2018 22:14:24 +0000 (14:14 -0800)]
[flang] revert obsolete tweak

Original-commit: flang-compiler/f18@9b679e34dc09da9765b2e6e9fb5b16e2bb327246
Reviewed-on: https://github.com/flang-compiler/f18/pull/243
Tree-same-pre-rewrite: false

5 years ago[flang] Strengthen FORALL scoping check
peter klausler [Tue, 11 Dec 2018 22:03:55 +0000 (14:03 -0800)]
[flang] Strengthen FORALL scoping check

Original-commit: flang-compiler/f18@e57eb413145080cbd1d055d2a359493f7bcfc24f
Reviewed-on: https://github.com/flang-compiler/f18/pull/243
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#241 from flang-compiler/pmk1
Peter Klausler [Tue, 11 Dec 2018 22:26:50 +0000 (14:26 -0800)]
[flang] Merge pull request flang-compiler/f18#241 from flang-compiler/pmk1

More precise locations for construct name errors; some refactoring

Original-commit: flang-compiler/f18@e41c76cf766eb1d40808b23a548c2c8b87e09a22
Reviewed-on: https://github.com/flang-compiler/f18/pull/241

5 years ago[flang] reflect review comment
peter klausler [Mon, 10 Dec 2018 18:12:11 +0000 (10:12 -0800)]
[flang] reflect review comment

Original-commit: flang-compiler/f18@6f26bfb905a98266485ee59c6b461d30b801f3ea
Reviewed-on: https://github.com/flang-compiler/f18/pull/241

5 years ago[flang] delete unused private member to silence clang warning
peter klausler [Sat, 8 Dec 2018 01:03:55 +0000 (17:03 -0800)]
[flang] delete unused private member to silence clang warning

Original-commit: flang-compiler/f18@d3c5caab3449d36880128a641af5858891897b96
Reviewed-on: https://github.com/flang-compiler/f18/pull/241
Tree-same-pre-rewrite: false

5 years ago[flang] More precise locations for construct name errors; some refactoring
peter klausler [Sat, 8 Dec 2018 00:39:22 +0000 (16:39 -0800)]
[flang] More precise locations for construct name errors; some refactoring

Original-commit: flang-compiler/f18@2f35605d205531b5584355a97c639c4b4611d53d
Reviewed-on: https://github.com/flang-compiler/f18/pull/241
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#239 from flang-compiler/tsk1
Tim Keith [Fri, 7 Dec 2018 19:58:12 +0000 (11:58 -0800)]
[flang] Merge pull request flang-compiler/f18#239 from flang-compiler/tsk1

Preserve order of type parameters

Original-commit: flang-compiler/f18@83fa2376fdc4374bc655285cc4367b2a0f0367f8
Reviewed-on: https://github.com/flang-compiler/f18/pull/239

5 years ago[flang] Preserve order of type parameters
Tim Keith [Fri, 7 Dec 2018 01:52:43 +0000 (17:52 -0800)]
[flang] Preserve order of type parameters

Type parameters were sorted by the order of the type-param-def-stmts.
But we need to preserve the order of the type-param-name-list.
The is the order of positional parameters in a derived-type-spec.

So add `paramNames` to `DerivedTypeDetails` to preserve the original
order. Using this allows us to write module files with both the
type-param-name-list and type-param-def-stmts in the original order.

Also fix a bug where a duplicate type-param-def caused a spurious
extra error. If `MakeTypeSymbol()` reports an error we should not
call `SetType()` because it will just report another error.

Original-commit: flang-compiler/f18@3ca55b63333db3d779fe263583e3cb9fe7f4b2b1
Reviewed-on: https://github.com/flang-compiler/f18/pull/239

5 years ago[flang] Merge pull request flang-compiler/f18#240 from flang-compiler/tsk10
Tim Keith [Fri, 7 Dec 2018 18:09:51 +0000 (10:09 -0800)]
[flang] Merge pull request flang-compiler/f18#240 from flang-compiler/tsk10

Fix bug converting actual argument to Fortran

Original-commit: flang-compiler/f18@b529f20ca3b9df397af814f6e2ad646a9e7b2f80
Reviewed-on: https://github.com/flang-compiler/f18/pull/240

5 years ago[flang] Fix bug converting actual argument to Fortran
Tim Keith [Fri, 7 Dec 2018 15:41:49 +0000 (07:41 -0800)]
[flang] Fix bug converting actual argument to Fortran

This fixes a problem with converting the ubound call in the example
below back to Fortran (in this case, for writing to the .mod file).
One of the ActualArguments encountered in ProcedureRef::AsFortran is
a `std::nullopt`, so we need to handle that case.

```
module m
  real :: x(10)
  real :: y(ubound(x, dim=1))
end module
```

Original-commit: flang-compiler/f18@c5ace6b8241cd1ef86f0649941bf38386d99bdc4
Reviewed-on: https://github.com/flang-compiler/f18/pull/240

5 years ago[flang] Merge pull request flang-compiler/f18#238 from flang-compiler/tsk11
Tim Keith [Thu, 6 Dec 2018 22:37:32 +0000 (14:37 -0800)]
[flang] Merge pull request flang-compiler/f18#238 from flang-compiler/tsk11

Rework expression evaluation in symbol table

Original-commit: flang-compiler/f18@0e91bd34729d4d718887b70a09a40f7a97aecc50
Reviewed-on: https://github.com/flang-compiler/f18/pull/238

5 years ago[flang] Rework when symbol table expressions are evaluated
Tim Keith [Thu, 6 Dec 2018 14:59:37 +0000 (06:59 -0800)]
[flang] Rework when symbol table expressions are evaluated

It's not good enough to evaluate expressions in the symbol table after
name resolution has completed. This is because we need the values of
constant expressions for types, for example, we need to evaluate `k` in
`integer(k) :: x` to know the type of `x`.

So, eliminate `LazyExpr` and call `EvaluateExpr()` on expressions that
we need in the symbol table. The latter evaluates and folds an
expression in the current context. This is now possible because symbols
are added to `parser::Name` as soon as possible rather than in a pass
after name resolution. Along with `LazyExpr` we can eliminate the whole
`ResolveSymbolExprs` pass that used to resolve them.

In resolve-names.cc, many `Pre` functions are changed to `Post` so that
names are resolved before doing the associated processing. For example,
with intrinsic type specs, names in the kind expression must be resolved
before attempting to evaluate that expression.

In `GetSymbolType()` in type.cc, handle both `ObjectEntityDetails` and
`EntityDetails` by using `Symbol::GetType()`.

Add explicit declarations in label01.F90 because we can't handle
implicitly typed array bounds yet.

Original-commit: flang-compiler/f18@d67716640baeedca150205f9f3845ceb5d2f6402
Reviewed-on: https://github.com/flang-compiler/f18/pull/238

5 years ago[flang] Fix error is Negation on integer
Tim Keith [Wed, 5 Dec 2018 21:11:55 +0000 (13:11 -0800)]
[flang] Fix error is Negation on integer

The minus sign was missing.

Original-commit: flang-compiler/f18@5fa0a97de5dcdcfeecc3999a1f84dd7858f5b35c
Reviewed-on: https://github.com/flang-compiler/f18/pull/238
Tree-same-pre-rewrite: false

5 years ago[flang] Add common base class for context, Walk(), and Say()
Tim Keith [Sat, 17 Nov 2018 00:40:00 +0000 (16:40 -0800)]
[flang] Add common base class for context, Walk(), and Say()

We need access to the SemanticsContext and Walk() function everywhere,
so move them to a BaseVisitor, a base class at the root of the class
hierarchy.

Also move MessageHandler to be a data member of BaseVisitor and forward
Say calls to it.

Original-commit: flang-compiler/f18@eb9adc342a5495b0070a14d163f55209c63623d7
Reviewed-on: https://github.com/flang-compiler/f18/pull/238
Tree-same-pre-rewrite: false

5 years ago[flang] Change when symbol is set in parser::Name
Tim Keith [Fri, 16 Nov 2018 20:43:08 +0000 (12:43 -0800)]
[flang] Change when symbol is set in parser::Name

Rework how `parser::Name` is resolved to contain a `Symbol`. so that
constants in types can be evaluated. For example:
```
  integer, parameter :: k = 8
  integer(k) :: i
```
The old approach of collecting the symbols at the end of name resolution
and filling in the `parser::Name` does not work because the type of `i`
needs to be set in the symbol table.

The symbol field in `parser::Name` is now mutable so that we can set it
during name resolution. `RewriteParseTree` no longer needs to do that
(it still warns about unresolved ones), so it does not need to collect
symbols and fill them in. Consequently, we can eliminate "occurrences"
from symbols -- we just need the name where each is first defined.

This requires a lot of refactoring in `resolve-names.cc` to pass around
`parser::Name` rather than `SourceName` so that we can resolve the
name to a symbol.

Fix some bugs where we stored `SourceName *` instead of `SourceName`
in the symbol table. The pointers were into the parse tree, so they
were only valid as long as the parse tree was around. The symbol
table needs to remain valid longer than that, so the names need to
be copied. `parser::Name` is not used in the symbol table.

Eliminate `GenericSpec`. Currently all we need to do is to resolve
the kinds of GenericSpec that contain names.

Add `ScopeName` kind of `MiscDetails` for when we need a symbol in
the scope to match the name of the scope. For example, `module m`
cannot contain a declaration of a new `m`. Subprograms need real
details because they can be called recursively.

Fix output of partially resolved modules where we know it is a submodule
but have not yet resolved the ancestor.

Original-commit: flang-compiler/f18@5c1a4b99d2421f5b32e83426488d3fdf7951cfba
Reviewed-on: https://github.com/flang-compiler/f18/pull/238
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#237 from flang-compiler/pmk1
Peter Klausler [Wed, 5 Dec 2018 21:36:03 +0000 (13:36 -0800)]
[flang] Merge pull request flang-compiler/f18#237 from flang-compiler/pmk1

Use `std::optional<>::value()` where appropriate in place of `operator*`.

Original-commit: flang-compiler/f18@611ee9be5d610a6593072672b358f1ab038681ad
Reviewed-on: https://github.com/flang-compiler/f18/pull/237

5 years ago[flang] one more file
peter klausler [Wed, 5 Dec 2018 21:06:00 +0000 (13:06 -0800)]
[flang] one more file

Original-commit: flang-compiler/f18@9d3f502e803ceb4a72f5ba9da9d54477656c8b1d
Reviewed-on: https://github.com/flang-compiler/f18/pull/237

5 years ago[flang] Use std::optional<>::value() where appropriate.
peter klausler [Wed, 5 Dec 2018 21:03:39 +0000 (13:03 -0800)]
[flang] Use std::optional<>::value() where appropriate.

Original-commit: flang-compiler/f18@4278b79b3dc3b73a8229a24d11d195015e7f2840
Reviewed-on: https://github.com/flang-compiler/f18/pull/237
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#236 from flang-compiler/pmk1
Peter Klausler [Wed, 5 Dec 2018 00:39:33 +0000 (16:39 -0800)]
[flang] Merge pull request flang-compiler/f18#236 from flang-compiler/pmk1

work around template specialization problem

Original-commit: flang-compiler/f18@d122b4e618111c05deb9abaadef6d636fa11a72c
Reviewed-on: https://github.com/flang-compiler/f18/pull/236

5 years ago[flang] work around template specialization problem
peter klausler [Tue, 4 Dec 2018 23:52:50 +0000 (15:52 -0800)]
[flang] work around template specialization problem

Original-commit: flang-compiler/f18@1d67d72bea24a4ade66920527d2cc9104d2dfd48
Reviewed-on: https://github.com/flang-compiler/f18/pull/236

5 years ago[flang] Merge pull request flang-compiler/f18#235 from flang-compiler/pmk1
Peter Klausler [Tue, 4 Dec 2018 18:51:41 +0000 (10:51 -0800)]
[flang] Merge pull request flang-compiler/f18#235 from flang-compiler/pmk1

last minute changes for recent PR that were not pushed, sorry

Original-commit: flang-compiler/f18@f9ee3753ea1e151ddfe56a0db37aa9e69626da7f
Reviewed-on: https://github.com/flang-compiler/f18/pull/235

5 years ago[flang] last minute changes for recent PR that were not pushed, sorry
peter klausler [Tue, 4 Dec 2018 18:21:38 +0000 (10:21 -0800)]
[flang] last minute changes for recent PR that were not pushed, sorry

Original-commit: flang-compiler/f18@9f9258e0067bfe9406f61f5f67d37b54f004e266
Reviewed-on: https://github.com/flang-compiler/f18/pull/235

5 years ago[flang] Merge pull request flang-compiler/f18#234 from flang-compiler/pmk0
Peter Klausler [Tue, 4 Dec 2018 18:18:10 +0000 (10:18 -0800)]
[flang] Merge pull request flang-compiler/f18#234 from flang-compiler/pmk0

Refactoring of expr analysis API and implementation

Original-commit: flang-compiler/f18@2a1fb648d96811c4d7ee0177b17aed94b66e3077
Reviewed-on: https://github.com/flang-compiler/f18/pull/234

5 years ago[flang] fixes
peter klausler [Tue, 4 Dec 2018 01:20:28 +0000 (17:20 -0800)]
[flang] fixes

Original-commit: flang-compiler/f18@d312b2298a36c5676fdac66ec2acbf188dd80f4d
Reviewed-on: https://github.com/flang-compiler/f18/pull/234

5 years ago[flang] address review comments
peter klausler [Tue, 4 Dec 2018 00:44:25 +0000 (16:44 -0800)]
[flang] address review comments

Original-commit: flang-compiler/f18@2f4b7ac97cd35e7a4d1e4ea558a8bb98c34b663a
Reviewed-on: https://github.com/flang-compiler/f18/pull/234
Tree-same-pre-rewrite: false

5 years ago[flang] complete refactor of expression analysis api and impl
peter klausler [Mon, 3 Dec 2018 19:40:53 +0000 (11:40 -0800)]
[flang] complete refactor of expression analysis api and impl

Original-commit: flang-compiler/f18@fc83cdeabb38b94061fec5f70dc81b69c28ebe50
Reviewed-on: https://github.com/flang-compiler/f18/pull/234
Tree-same-pre-rewrite: false

5 years ago[flang] checkpoint before another refactoring
peter klausler [Sat, 1 Dec 2018 00:04:51 +0000 (16:04 -0800)]
[flang] checkpoint before another refactoring

Original-commit: flang-compiler/f18@033efb95c2aff84ac17d460438e43573fab5eac6
Reviewed-on: https://github.com/flang-compiler/f18/pull/234
Tree-same-pre-rewrite: false

5 years ago[flang] checkpoint
peter klausler [Fri, 30 Nov 2018 23:23:33 +0000 (15:23 -0800)]
[flang] checkpoint

Original-commit: flang-compiler/f18@1c65ed9a6f73b3b70a7cb6e023e55e196bf1dd4f
Reviewed-on: https://github.com/flang-compiler/f18/pull/234
Tree-same-pre-rewrite: false

5 years ago[flang] checkpoint during refactor
peter klausler [Fri, 30 Nov 2018 22:03:05 +0000 (14:03 -0800)]
[flang] checkpoint during refactor

Original-commit: flang-compiler/f18@01fe82b95bebb5977fb5fa9c90ea1b8a6894a18c
Reviewed-on: https://github.com/flang-compiler/f18/pull/234
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#233 from flang-compiler/pmk1
Peter Klausler [Thu, 29 Nov 2018 21:39:51 +0000 (13:39 -0800)]
[flang] Merge pull request flang-compiler/f18#233 from flang-compiler/pmk1

small TODO: eliminate per-specialization flag in expression type representation

Original-commit: flang-compiler/f18@03a2a10a48149432d69e5ad0af24d033e094ced7
Reviewed-on: https://github.com/flang-compiler/f18/pull/233

5 years ago[flang] address TODO: replace Type flag member with IsSpecificIntrinsicType<T> predicate
peter klausler [Thu, 29 Nov 2018 18:25:46 +0000 (10:25 -0800)]
[flang] address TODO: replace Type flag member with IsSpecificIntrinsicType<T> predicate

Original-commit: flang-compiler/f18@68b89c008ffb8df9e706633c09a2257d0e970bb9
Reviewed-on: https://github.com/flang-compiler/f18/pull/233

5 years ago[flang] Merge pull request flang-compiler/f18#230 from flang-compiler/tsk2
Tim Keith [Thu, 29 Nov 2018 20:27:34 +0000 (12:27 -0800)]
[flang] Merge pull request flang-compiler/f18#230 from flang-compiler/tsk2

Add mapping of source location to Scope

Original-commit: flang-compiler/f18@bec1cfdc05bacefa000dccfec78670affce3f1be
Reviewed-on: https://github.com/flang-compiler/f18/pull/230

5 years ago[flang] Add ExtendToCover() to CharBlock and Interval
Tim Keith [Thu, 29 Nov 2018 17:10:19 +0000 (09:10 -0800)]
[flang] Add ExtendToCover() to CharBlock and Interval

Use them in Scope::AddSourceRange().

Original-commit: flang-compiler/f18@ec2f6db46a42998ee1b1bed955538387fadf5c09
Reviewed-on: https://github.com/flang-compiler/f18/pull/230

5 years ago[flang] Add mapping of source location to Scope
Tim Keith [Wed, 28 Nov 2018 23:55:55 +0000 (15:55 -0800)]
[flang] Add mapping of source location to Scope

Each Scope now tracks the source locations that it and its nested scopes
span. This is achieved by extending the source range of a scope for each
statement encountered while it is the current scope.

Semantics::FindScope maps a source location (from the cooked character
stream) to the narrowest scope that contains it.

Original-commit: flang-compiler/f18@7b4d2bb113e4a1018c5f6aa740b02e423ff61799
Reviewed-on: https://github.com/flang-compiler/f18/pull/230
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#232 from flang-compiler/tsk9
Tim Keith [Thu, 29 Nov 2018 20:26:57 +0000 (12:26 -0800)]
[flang] Merge pull request flang-compiler/f18#232 from flang-compiler/tsk9

Change formatting of common::visitors{}

Original-commit: flang-compiler/f18@a442658ec57157ea40d06d24e8a814648d19cf5e
Reviewed-on: https://github.com/flang-compiler/f18/pull/232

5 years ago[flang] Change formatting of common::visitors{}
Tim Keith [Thu, 29 Nov 2018 17:27:34 +0000 (09:27 -0800)]
[flang] Change formatting of common::visitors{}

Including a comma after the last lambda in a `common::visitors{}` list
causes clang-format to do a better job of formatting them.

Add that recommendation to C++style.md, insert the missing commas,
and reformat the changed files.

Original-commit: flang-compiler/f18@a2486ca3b6daf6cfc3a5cf95ad89719297d04b72
Reviewed-on: https://github.com/flang-compiler/f18/pull/232

5 years ago[flang] Merge pull request flang-compiler/f18#231 from flang-compiler/pmk0
Peter Klausler [Thu, 29 Nov 2018 17:36:34 +0000 (09:36 -0800)]
[flang] Merge pull request flang-compiler/f18#231 from flang-compiler/pmk0

Lossless binary floating-point -> decimal, and correct decimal -> binary FP

Original-commit: flang-compiler/f18@57cf544a089eaac266c3b8e5d153722f0d142e15
Reviewed-on: https://github.com/flang-compiler/f18/pull/231

5 years ago[flang] dodge gcc warning on test
peter klausler [Thu, 29 Nov 2018 00:44:38 +0000 (16:44 -0800)]
[flang] dodge gcc warning on test

Original-commit: flang-compiler/f18@10e9a820885a3fa91e4f60dd95f810527a5c6bc3
Reviewed-on: https://github.com/flang-compiler/f18/pull/231

5 years ago[flang] tested
peter klausler [Thu, 29 Nov 2018 00:20:16 +0000 (16:20 -0800)]
[flang] tested

Original-commit: flang-compiler/f18@e77681a2ff914284f5cd969f403c966fd5f770b7
Reviewed-on: https://github.com/flang-compiler/f18/pull/231
Tree-same-pre-rewrite: false

5 years ago[flang] debugged full precision FP formatting
peter klausler [Wed, 28 Nov 2018 17:13:01 +0000 (09:13 -0800)]
[flang] debugged full precision FP formatting

Original-commit: flang-compiler/f18@ac9a684b910e6bf3f32496883b16d6b3e547169e
Reviewed-on: https://github.com/flang-compiler/f18/pull/231
Tree-same-pre-rewrite: false

5 years ago[flang] debugging
peter klausler [Wed, 28 Nov 2018 00:23:07 +0000 (16:23 -0800)]
[flang] debugging

Original-commit: flang-compiler/f18@9f30eac130514fa04212d402734d41c63078bb9e
Reviewed-on: https://github.com/flang-compiler/f18/pull/231
Tree-same-pre-rewrite: false

5 years ago[flang] initial exact decimal conversion code
peter klausler [Mon, 26 Nov 2018 19:18:53 +0000 (11:18 -0800)]
[flang] initial exact decimal conversion code

Original-commit: flang-compiler/f18@a34afdc73b8ca43cb20234849a2e9d3f77bbc8e6
Reviewed-on: https://github.com/flang-compiler/f18/pull/231
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#229 from flang-compiler/pmk1
Peter Klausler [Wed, 28 Nov 2018 18:31:41 +0000 (10:31 -0800)]
[flang] Merge pull request flang-compiler/f18#229 from flang-compiler/pmk1

document C++17 feature usage

Original-commit: flang-compiler/f18@d1d18fad363f6e59c8c18e2db5a41a8474751a83
Reviewed-on: https://github.com/flang-compiler/f18/pull/229

5 years ago[flang] proofreading
peter klausler [Mon, 26 Nov 2018 20:46:11 +0000 (12:46 -0800)]
[flang] proofreading

Original-commit: flang-compiler/f18@2af5c40bc144cdf180dd3eef19ffa697a68f4fc1
Reviewed-on: https://github.com/flang-compiler/f18/pull/229

5 years ago[flang] document C++17 feature usage
peter klausler [Mon, 26 Nov 2018 20:42:11 +0000 (12:42 -0800)]
[flang] document C++17 feature usage

Original-commit: flang-compiler/f18@40d84ca20f1b7f53661fa1101646f7071a4cb962
Reviewed-on: https://github.com/flang-compiler/f18/pull/229
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#228 from flang-compiler/pmk0
Peter Klausler [Mon, 19 Nov 2018 22:49:57 +0000 (14:49 -0800)]
[flang] Merge pull request flang-compiler/f18#228 from flang-compiler/pmk0

Extend `AnalyzeExpr` to handle wrapped expression parse trees

Original-commit: flang-compiler/f18@7ddf0c159f70d189dbfa38fa4369b3101fa453ae
Reviewed-on: https://github.com/flang-compiler/f18/pull/228

5 years ago[flang] Analyze wrapped expressions
peter klausler [Mon, 19 Nov 2018 19:14:41 +0000 (11:14 -0800)]
[flang] Analyze wrapped expressions

Original-commit: flang-compiler/f18@b34db5d38f03b11b85890696569a22d506a98736
Reviewed-on: https://github.com/flang-compiler/f18/pull/228

5 years ago[flang] fix comments
peter klausler [Mon, 19 Nov 2018 18:29:04 +0000 (10:29 -0800)]
[flang] fix comments

Original-commit: flang-compiler/f18@a01eaaacc2af1caffeb0a788eecf3cb25f230c64
Reviewed-on: https://github.com/flang-compiler/f18/pull/228
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#226 from flang-compiler/pmk2
Peter Klausler [Thu, 15 Nov 2018 00:12:23 +0000 (16:12 -0800)]
[flang] Merge pull request flang-compiler/f18#226 from flang-compiler/pmk2

fix issue#224

Original-commit: flang-compiler/f18@cd6e4f0adaecde8d58e03c67542f9a9b6c3b68d2
Reviewed-on: https://github.com/flang-compiler/f18/pull/226

5 years ago[flang] fix issue#224
peter klausler [Wed, 14 Nov 2018 23:44:17 +0000 (15:44 -0800)]
[flang] fix issue#224

Original-commit: flang-compiler/f18@c40e197c61c8192fe7932932390417c8b47f79c6
Reviewed-on: https://github.com/flang-compiler/f18/pull/226

5 years ago[flang] Merge pull request flang-compiler/f18#225 from flang-compiler/pmk1
Peter Klausler [Wed, 14 Nov 2018 23:23:40 +0000 (15:23 -0800)]
[flang] Merge pull request flang-compiler/f18#225 from flang-compiler/pmk1

Roll up a bunch of changes

Original-commit: flang-compiler/f18@9ad19cd89298a3d4a4d468145b8a5dffec8b936d
Reviewed-on: https://github.com/flang-compiler/f18/pull/225

5 years ago[flang] review comments
peter klausler [Wed, 14 Nov 2018 22:35:10 +0000 (14:35 -0800)]
[flang] review comments

Original-commit: flang-compiler/f18@32c02cb668f17e31061c3f52c834e4029e410381
Reviewed-on: https://github.com/flang-compiler/f18/pull/225

5 years ago[flang] bugfixing and review comments
peter klausler [Wed, 14 Nov 2018 19:57:47 +0000 (11:57 -0800)]
[flang] bugfixing and review comments

Original-commit: flang-compiler/f18@6df4a52d6bb2575c3eb4726b633a0cf98da0d298
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

5 years ago[flang] bugfixing from regression testing
peter klausler [Wed, 14 Nov 2018 19:12:09 +0000 (11:12 -0800)]
[flang] bugfixing from regression testing

Original-commit: flang-compiler/f18@f1bcaa0292cb0eec2fdc10df347b78c2329a379e
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

5 years ago[flang] remove unused variable
peter klausler [Wed, 14 Nov 2018 00:26:26 +0000 (16:26 -0800)]
[flang] remove unused variable

Original-commit: flang-compiler/f18@64773cef2c1b31a72fb61c2cdc8dce7eeddefffe
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

5 years ago[flang] revamp Real::Read(), use it for mutual testing of ScaledDecimals
peter klausler [Wed, 14 Nov 2018 00:02:52 +0000 (16:02 -0800)]
[flang] revamp Real::Read(), use it for mutual testing of ScaledDecimals

Original-commit: flang-compiler/f18@a2054bb9dfa3753f49ab7d35c842ed47b41fc374
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

5 years ago[flang] binary->decimal conversion for module files
peter klausler [Tue, 13 Nov 2018 19:29:54 +0000 (11:29 -0800)]
[flang] binary->decimal conversion for module files

Original-commit: flang-compiler/f18@6364799e7adda3b6b5280b0305d55a2bfa7eabe0
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] save work in progress
peter klausler [Thu, 8 Nov 2018 17:32:28 +0000 (09:32 -0800)]
[flang] save work in progress

Original-commit: flang-compiler/f18@98bac3d297af460ae80467f257f724cd7b041dbd
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] Rename Dump() as AsFortran(), tweak output for use in .mod files
peter klausler [Mon, 5 Nov 2018 23:02:37 +0000 (15:02 -0800)]
[flang] Rename Dump() as AsFortran(), tweak output for use in .mod files

Original-commit: flang-compiler/f18@4e9dd16d6a84c728a86e187fe59500638ebbfe35
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] fix warning
peter klausler [Mon, 5 Nov 2018 22:08:17 +0000 (14:08 -0800)]
[flang] fix warning

Original-commit: flang-compiler/f18@92003070de18bc7f4b78a8b00d72c324a554d523
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] multi-byte character TODOs
peter klausler [Mon, 5 Nov 2018 21:48:00 +0000 (13:48 -0800)]
[flang] multi-byte character TODOs

Original-commit: flang-compiler/f18@3bd2d227dc4c6c3f6d721e95c8cd07075021f462
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] more substring clean-up
peter klausler [Fri, 2 Nov 2018 23:42:45 +0000 (16:42 -0700)]
[flang] more substring clean-up

Original-commit: flang-compiler/f18@e1c19ccd168f2dc3f9df9ab9328bdc6bbb61a5b4
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] documentation
peter klausler [Fri, 2 Nov 2018 21:48:28 +0000 (14:48 -0700)]
[flang] documentation

Original-commit: flang-compiler/f18@92f0c397f658a865ecab347b31773999f6503693
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] documentation
peter klausler [Fri, 2 Nov 2018 21:38:27 +0000 (14:38 -0700)]
[flang] documentation

Original-commit: flang-compiler/f18@9aba35a2582bbb8100a275d701e3013dfa478c45
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] BaseObjects and static data placeholder
peter klausler [Fri, 2 Nov 2018 21:13:12 +0000 (14:13 -0700)]
[flang] BaseObjects and static data placeholder

Original-commit: flang-compiler/f18@3ddfd5cadfafffe9c58cedd7a625cd071820c79c
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] update pointer documentation
peter klausler [Fri, 2 Nov 2018 17:48:20 +0000 (10:48 -0700)]
[flang] update pointer documentation

Original-commit: flang-compiler/f18@0f04468c000f23f606d8cf14348af7ee318fd298
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] small tweaks
peter klausler [Thu, 1 Nov 2018 19:39:09 +0000 (12:39 -0700)]
[flang] small tweaks

Original-commit: flang-compiler/f18@5bbd6c3c1995edf5ee909648e517ca3dde2560e0
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] take literal substrings out of variable.h
peter klausler [Thu, 1 Nov 2018 18:18:12 +0000 (11:18 -0700)]
[flang] take literal substrings out of variable.h

Original-commit: flang-compiler/f18@a762b70bebc5428adec75b85801aef8ee88bcf42
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] allow array constructors in all expressions
peter klausler [Tue, 30 Oct 2018 23:25:10 +0000 (16:25 -0700)]
[flang] allow array constructors in all expressions

Original-commit: flang-compiler/f18@6dd5431cd9a0da203f098487a7d5db379c64b3ea
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] represent array constructors
peter klausler [Tue, 30 Oct 2018 22:24:35 +0000 (15:24 -0700)]
[flang] represent array constructors

Original-commit: flang-compiler/f18@74ccff6b39972ada3d344ae8ee72d4c18842d35c
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] Clean up Designator and GetSymbol()
peter klausler [Tue, 30 Oct 2018 20:30:56 +0000 (13:30 -0700)]
[flang] Clean up Designator and GetSymbol()

Original-commit: flang-compiler/f18@61c0af323c13f7ad97521332603497d21638e2f9
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] Make all Expr<> instances derived from ExpressionBase
peter klausler [Tue, 30 Oct 2018 19:44:09 +0000 (12:44 -0700)]
[flang] Make all Expr<> instances derived from ExpressionBase

Original-commit: flang-compiler/f18@f7d1a21532a51dc10aa7a8fd775e3404320986a6
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] Address TODO: define IsAssumedRank predicate, use it
peter klausler [Mon, 29 Oct 2018 22:25:35 +0000 (15:25 -0700)]
[flang] Address TODO: define IsAssumedRank predicate, use it

Original-commit: flang-compiler/f18@f75c3e0ccfc763644afc3b0fe37861e3a5adcdd9
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false

6 years ago[flang] Merge pull request flang-compiler/f18#222 from flang-compiler/jpr0
jeanPerier [Thu, 8 Nov 2018 10:37:53 +0000 (11:37 +0100)]
[flang] Merge pull request flang-compiler/f18#222 from flang-compiler/jpr0

C interoperability: Fixes CFI_CDESC_T macro and CFI_establish function

Original-commit: flang-compiler/f18@e104912ef1f146817b411162e8a657e504a8fc82
Reviewed-on: https://github.com/flang-compiler/f18/pull/222

6 years ago[flang] Simplified C++ CFI_CDESC_T implem. Added local namespace around
Jean Perier [Wed, 7 Nov 2018 10:27:04 +0000 (02:27 -0800)]
[flang] Simplified C++ CFI_CDESC_T implem. Added local namespace around

Original-commit: flang-compiler/f18@456f5a09949701b74b02834668f161bbb5d68009
Reviewed-on: https://github.com/flang-compiler/f18/pull/222

6 years ago[flang] Changed CFI_CDESC_T macro in C++. Cleaned related tests.
Jean Perier [Tue, 6 Nov 2018 17:06:10 +0000 (09:06 -0800)]
[flang] Changed CFI_CDESC_T macro in C++. Cleaned related tests.

Original-commit: flang-compiler/f18@752f8eefa0cdf310afcdab50241885a644ea2fb4
Reviewed-on: https://github.com/flang-compiler/f18/pull/222
Tree-same-pre-rewrite: false

6 years ago[flang] Fixed CFI_establish. Improved and renamed related test suit
Jean Perier [Mon, 5 Nov 2018 15:07:18 +0000 (07:07 -0800)]
[flang] Fixed CFI_establish. Improved and renamed related test suit

Original-commit: flang-compiler/f18@b75d858e4f96c21da67a8c7ecc4d4bdbcc9c8498
Reviewed-on: https://github.com/flang-compiler/f18/pull/222
Tree-same-pre-rewrite: false

6 years ago[flang] Fixed CFI_DESC_T macro. Started unit test for C interop
Jean Perier [Fri, 2 Nov 2018 16:42:35 +0000 (09:42 -0700)]
[flang] Fixed CFI_DESC_T macro. Started unit test for C interop

Original-commit: flang-compiler/f18@f29b80c7582f6b5f18ca26f6fd9466da56479664
Reviewed-on: https://github.com/flang-compiler/f18/pull/222
Tree-same-pre-rewrite: false