A temp directory is created in `common.sh` and it is cleaned up by
`trap ... EXIT`. If the test script has its own trap, as this one does,
it seems to replace the first one. So the cleanup from `common.sh` was
not being executed when the `%t` feature was used and empty temp
directories were being left in the directory where the tests ran.
Since we already have a temp directory that is cleaned up, just use
that for `%t` and don't bother with another `mktemp`.
Original-commit: flang-compiler/f18@f61d62ddec
Reviewed-on: https://github.com/flang-compiler/f18/pull/754
Instead of using an `ENUM_CLASS Kind` to distinguish a `Designator`
or common-block name, change it to `std::variant`. If the `Name`
is available, then it is common-block name.
Original-commit: flang-compiler/f18@abf5db6171
When a derived type is use-associated with a rename, like
`use m, only: t2 => t1`
we need to record in the `DerivedTypeSpec` both the local-name in this
scope and the symbol for the derived type.
In most cases we need to work the the type symbol and its
`DerivedTypeDetails`, but when writing the type to the module file
we need the local-name. The name of the type symbol may be hidden
or not use-associated.
When analyzing a `parser::Name` we don't want to follow use-associations
because we could end up with the wrong name in a `DataRef` (i.e. the
use-name rather than the local-name). But that means that
`GetNamedConstantValue()` does have to follow them or named constants
won't always be folded.
Fixesflang-compiler/f18#729.
Original-commit: flang-compiler/f18@50d8921c69
Reviewed-on: https://github.com/flang-compiler/f18/pull/740
When a module contains a use-association with rename, we have to be
careful to use the correct name (i.e. the local-name, not the use-name)
when writing out its `.mod` file.
When analyzing a `Name` in an expression, follow the use-association
for details, attributes, and constant values; but if we need to make a
`Designator` or `ProcedureDesignator`, use the local name.
Original-commit: flang-compiler/f18@8f07b803e1
Reviewed-on: https://github.com/flang-compiler/f18/pull/740
Tree-same-pre-rewrite: false
Eliminate two of the three overloadings of `Scope::MakeDerivedType()`.
Keep the one that has `Category` first because that's the order the
constructor of `DeclTypeSpec` uses.
In `mod-file.cc`, eliminate some calls to `PutLower()`. Symbols and
names are already lower case so they don't need to be converted.
In `modfile03.f90`, move the expected `.mod` file comments to right
after the corresponding modules. That makes it easier to work with.
Original-commit: flang-compiler/f18@86874d9bf8
Reviewed-on: https://github.com/flang-compiler/f18/pull/740
Tree-same-pre-rewrite: false
If a generic name is use-associated from two different modules and they
both have a specific procedure or both have a derived type with the same
name, report it as an error.
Original-commit: flang-compiler/f18@42369af96d
Reviewed-on: https://github.com/flang-compiler/f18/pull/741
Tree-same-pre-rewrite: false
When we use-associate the same generic name from two different modules
they are merged together. If the same specific procedure occurs in both
generics it should only occur once in the merged one.
Similarly, it's not an error if they both have a derived type or
specific procedure named the same as the generic, as long as they are
the same symbol.
Fixesflang-compiler/f18#733.
Original-commit: flang-compiler/f18@d37db07691
Reviewed-on: https://github.com/flang-compiler/f18/pull/741
Tree-same-pre-rewrite: false
- -fget-definitions finds the definition of the symbol under specified source
position.
- -fget-all-symbols finds definition locations of all symbols in a document. For
symbols found in other modules, shows which module the symbol came from.
- Tests.
- New structure SourcePosition with file, line, column information.
Original-commit: flang-compiler/f18@e0099b0900
Reviewed-on: https://github.com/flang-compiler/f18/pull/698
Tree-same-pre-rewrite: false
I changed the interface of ```PushConstruct()``` to take an rvalue reference as its only parameter and made the construction of the ```ConstructNode```s explicit in all of the ```Pre()``` functions for the various construct types.
Original-commit: flang-compiler/f18@f8be813874
Reviewed-on: https://github.com/flang-compiler/f18/pull/686
Tree-same-pre-rewrite: false
The most significant change is that I replaced the stack of
ExecutableConstruct's with a stack composed of ConstructNode's, each of which
is a variant of the constructs that made up the type ExecutableConstruct. This
change allows the nodes of the stack to be extended to include the types needed
for OMP semantic checking.
I also extended the existing test to include some correct DO loops with CYCLE
and EXIT statements to test the code more completely.
Original-commit: flang-compiler/f18@d26f34e3a4
Reviewed-on: https://github.com/flang-compiler/f18/pull/686
Tree-same-pre-rewrite: false
I added a stack of ExecutableConstruct's to SemanticsContext along with
functions to push and pop constructs. I added code to the SemanticsVisitor
to use these new functions. I also added functions Pre and Post functions
for UnlabeledStatement's so that we could isolate the source positions for
statements embedded in "if" statements to improve error messages.
I also added code to check-do.[h,cc] to use this new infrastructure to check
for CYCLE and EXIT statements that are not contained within DO constructs
along with a test.
Original-commit: flang-compiler/f18@b8370bdeb8
Reviewed-on: https://github.com/flang-compiler/f18/pull/686
Tree-same-pre-rewrite: false