Tim Keith [Mon, 4 Nov 2019 20:58:48 +0000 (12:58 -0800)]
[flang] Merge pull request flang-compiler/f18#810 from flang-compiler/tsk-defined-ops
Fix build error using clang
Original-commit: flang-compiler/f18@
0879810f8bf4f84bcce06a5b6feb7817609c1cdb
Reviewed-on: https://github.com/flang-compiler/f18/pull/810
Tim Keith [Mon, 4 Nov 2019 20:05:51 +0000 (12:05 -0800)]
[flang] Fix build error using clang
Change `AllFortranNames()` to return a `std::vector` rather than a
`std::initialization_list`. The latter doesn't own its underlying
storage and so can't be returned as a value. clang detects this and
issues a warning.
Two tests in `resolve63.f90` behave differently with clang and require
further investigation.
Original-commit: flang-compiler/f18@
1ed3a3cfee1d372b23afc4529d5867ecd46db681
Reviewed-on: https://github.com/flang-compiler/f18/pull/810
Tim Keith [Mon, 4 Nov 2019 18:56:12 +0000 (10:56 -0800)]
[flang] Merge pull request flang-compiler/f18#807 from flang-compiler/tsk-defined-ops
Resolve extended intrinsic operators
Original-commit: flang-compiler/f18@
bcdf3fc6e58ae5dca72247df8793221175a885b0
Reviewed-on: https://github.com/flang-compiler/f18/pull/807
Tim Keith [Sat, 2 Nov 2019 16:56:46 +0000 (09:56 -0700)]
[flang] Resolve extended intrinsic operators
Enhance `ArgumentAnalyzer` to do most of the work for this.
For each kind of operator that might have a user-defined form we follow
this process:
- analyze the arguments
- if the types and shapes match the intrinsic operator do the usual
processing
- otherwise attempt to interpret it as a user-defined operator with
`TryDefinedOp`
When we fail to resolve an operator, produce different errors depending
on whether there is a user-defined operator available or not.
If there is, report that neither user-defined nor intrinsic operator
worked. If there is not, describe the rules for the intrinsic operator.
In either case, include the type(s) of the operand(s).
Most of the uses of `ArgumentAnalyzer` are in helper functions that
apply to classes of operators.
For consistency, rename `BinaryOperationHelper` to `NumericBinaryOperator`
and `LogicalHelper` to `LogicalBinaryHelper` and introduce `NumericUnaryHelper`
for unary `+` and `-`. `.NOT.` and `//` are not implemented in helpers.
Replace `success_` with `fatalErrors_` in `ArgumentAnalyzer` for
consistency with `ExpressionAnalyzer`.
Add `NumericOperator` and `LogicalOperator` enums to `Fortran.h` to go
with `RelationalOperator`. Add `AddFortran` functions to each to convert
to a Fortran source string. `RelationalOperator` also has `AllFortranNames`
because there are multiple names for each operator. This replaces
`LogicalOperator` in `expression.h` and the string representation of
the operators in `formatting.cc`.
Original-commit: flang-compiler/f18@
3bb9d664e86c931a67b3e78859d2108e53d23f80
Reviewed-on: https://github.com/flang-compiler/f18/pull/807
Peter Klausler [Sat, 2 Nov 2019 17:56:47 +0000 (10:56 -0700)]
[flang] Merge pull request flang-compiler/f18#806 from flang-compiler/pmk-calls
Enable and pass test call07.f90
Original-commit: flang-compiler/f18@
ac3c69f29c4a8c75ac700052ef95debba8808221
Reviewed-on: https://github.com/flang-compiler/f18/pull/806
peter klausler [Fri, 1 Nov 2019 20:08:16 +0000 (13:08 -0700)]
[flang] Enable and pass test call07.f90
Remove a std::move()
Final tweaks after testing and review
Original-commit: flang-compiler/f18@
b3fe97b1a0cd21b238d8511b44be3feb01823fc4
Reviewed-on: https://github.com/flang-compiler/f18/pull/806
Peter Klausler [Thu, 31 Oct 2019 21:01:14 +0000 (14:01 -0700)]
[flang] Merge pull request flang-compiler/f18#804 from flang-compiler/pmk-c_str
Use c_str() rather than data() where NUL termination is assumed
Original-commit: flang-compiler/f18@
97a0a0f78f6b51dfecb5ce3302496a4982394ab7
Reviewed-on: https://github.com/flang-compiler/f18/pull/804
peter klausler [Thu, 31 Oct 2019 20:25:28 +0000 (13:25 -0700)]
[flang] Use c_str() rather than data() where NUL termination is assumed
Original-commit: flang-compiler/f18@
5baed3c856bcffdb2024e6b20f0f20411b0a15f7
Reviewed-on: https://github.com/flang-compiler/f18/pull/804
Peter Klausler [Wed, 30 Oct 2019 22:51:17 +0000 (15:51 -0700)]
[flang] Merge pull request flang-compiler/f18#801 from flang-compiler/pmk-call06
More semantic checks for calls & declarations
Original-commit: flang-compiler/f18@
d29f634c350085e4dade3feabd28e4486de34bfb
Reviewed-on: https://github.com/flang-compiler/f18/pull/801
peter klausler [Tue, 29 Oct 2019 19:46:25 +0000 (12:46 -0700)]
[flang] enable call06.f90 test
Relax checking when irrelevant due to INTENT(IN)
Add and pass call14.f90 test on VALUE
Allow ASYNCHRONOUS/VOLATILE to apply to host/USE associated entities, add tests
Pass call06
Check C827 & C828, fix tests
Original-commit: flang-compiler/f18@
df6cb83794b4f8842170c748d9edb7b53ba56fe8
Reviewed-on: https://github.com/flang-compiler/f18/pull/801
Peter Klausler [Tue, 29 Oct 2019 19:45:13 +0000 (12:45 -0700)]
[flang] Merge pull request flang-compiler/f18#788 from flang-compiler/pmk-ref-wrap
Create `common::Reference<>`, use it to replace non-nullable pointers
Original-commit: flang-compiler/f18@
0857755e59b822115370f26f5951046068e7ee7d
Reviewed-on: https://github.com/flang-compiler/f18/pull/788
peter klausler [Tue, 22 Oct 2019 23:53:29 +0000 (16:53 -0700)]
[flang] Use reference_wrapper in vectors and sets
Convert some CharBlock references to values
Replace more pointers with reference wrappers
Restore object references that were converted to value semantics in an earlier commit
Use Reference<> in Scope
Fix new component iterator
Document pitfall that bit me
final tweaks before rebasing and merging
Rebasing
Original-commit: flang-compiler/f18@
87874af934a0344f40374d9288e6805a2757e32f
Reviewed-on: https://github.com/flang-compiler/f18/pull/788
Jinxin Yang [Mon, 28 Oct 2019 17:34:47 +0000 (10:34 -0700)]
[flang] Throw error in case of missing listed test
Original-commit: flang-compiler/f18@
dabc0ba0e0441d1057218d84a6b6f755985e50cc
Jinxin Yang [Fri, 25 Oct 2019 22:56:53 +0000 (15:56 -0700)]
[flang] [OpenMP] Test Infra update to support OpenMP symbol tests
During the symbol tests, OpenMP directives (start with "!$omp")
line needs to be saved for 1.f90 and 2.f90. Also moved "OPTIONS:"
detection to common.sh as "$USER_OPTIONS"
Original-commit: flang-compiler/f18@
7d4e8e8ad52608ed9e4b5239371533cd28f0fbda
Jinxin Yang [Thu, 24 Oct 2019 14:04:44 +0000 (07:04 -0700)]
[flang] [OpenMP] address more comments
The major changes are:
1) changed the non-nullptr type to reference
2) changed ResolveOmpObject to use std::visit
3) the rest of the changes are about positions and naming
Original-commit: flang-compiler/f18@
93debe59f39542aa6c891a0b7b320ac48ddad44a
Jinxin Yang [Mon, 21 Oct 2019 22:51:46 +0000 (15:51 -0700)]
[flang] [OpenMP] adjust for PR#753 `OmpObject` parse tree change
PR#753 changed the `OmpObject` to be:
```
struct OmpObject {
UNION_CLASS_BOILERPLATE(OmpObject);
std::variant<Designator, /*common block*/ Name> u;
};
```
This commit adjust the logic flow for `ResolveOmpObject` based on
the above parse tree change.
For an `OmpObject`,
```
if (Designator) {
if (DataRef.Name) {
// Resolve Names
} else {
// ResolveDesignator
// AnalyzeExpr
if (Designator.Substring) {
// Error
}
// other checks like StructureComponent, ArrayElement, etc.
}
} else if (Name) {
// Resolve COMMON block
}
```
Original-commit: flang-compiler/f18@
e5c1b92c15e5e8aee202d3469e337893510cfe21
Jinxin Yang [Wed, 18 Sep 2019 00:52:46 +0000 (17:52 -0700)]
[flang] [OpenMP] Implement no-multiple-appearance rule for DSA Clauses
DSA stands for Data-Sharing Attribute. This work is part of the
Name Resolution for OpenMP framework (data-refs on clauses part)
Based on 2.15.3: A list item that specifies a given variable may
not appear in more than one clause on the same directive, except that
a variable may be specified in both firstprivate and lastprivate clauses.
Through a temporary `std::set` of `const Symbol *` to keep track of
all the symbols on a certain OpenMP directive, we can determine whether
a variable `Name` (or `Symbol`, more accurately) has already appeared on
another DSA clause already, with the exception of FIRSTPRIVATE clause
and LASTPRIVATE clause. This rule applies to `/COMMON block/` also and
the source provenance shows on error message points to the `Name` between
slashes.
Added two more tests and changed some existing tests to accommodate
this commit. I intend to keep the `omp-clause-validity01.f90` test to
do the validity checks only.
Original-commit: flang-compiler/f18@
0d7828c21e8dfe02e470a861178b7747100516ae
Jinxin Yang [Tue, 17 Sep 2019 04:26:40 +0000 (21:26 -0700)]
[flang] [OpenMP] avoid creating new symbol for common block
Original-commit: flang-compiler/f18@
ba2cceb4a2eb3846053d8f480bd6406d562f9f1c
Jinxin Yang [Mon, 16 Sep 2019 06:08:29 +0000 (23:08 -0700)]
[flang] [OpenMP] add common block example
Original-commit: flang-compiler/f18@
a4c923e848bd55adc734808dbc019951610c29e6
Jinxin Yang [Wed, 11 Sep 2019 21:42:51 +0000 (14:42 -0700)]
[flang] [OpenMP] OmpVisitor framework for Name Resolution
This is a preliminary framework to do the name resolution for
data references on the OpenMP clauses. Unlike data references
in the OpenMP region, clauses determining the data-sharing or
data-mapping attributes are straightforward and the resolution
process could be extended to do the name resolution in the OpenMP
region. It is hard to determine what kind of checks can be done
in this visitor and what checks should be done later after name
resolution. But the guide line is that `After the completion of
this phase, every Name corresponds to a Symbol with proper OpenMP
attribute(s) determined unless an error occurred.`
1. Take data-sharing clauses as example, create new symbol for
variable that require private access within the OpenMP region.
Declare the entity implicitly if necessary. The new symbol has
`HostAssocDetails`, which is mentioned in the `OpenMP-semantics.md`.
2. For `Shared` or `ThreadPrivate`, no symbol needs to be created.
OpenMP attribute Flag `OmpThreadprivate` needs to be marked for
`Threadprivate` because the `threadprivate` attribute remains the
same whenever these variables are referenced in the program.
`Names` in `Shared` clause need to be resolved to associate the
symbols in the clause enclosing scope (contains the OpenMP directive)
but `OmpShared` does not need to be marked. Declare the entity
implicitly if necessary.
3. For `COMMON block`, when a named common block appears in a list,
it has the same meaning as if every explicit member of the common
block appeared in the list. Also, a common block name specified in
a data-sharing attribute clause must be declared to be a common
block in the same scoping unit in which the data-sharing attribute
clause appears. So, if a named common block appears on a `PRIVATE`
clause, all its members should have new symbols created within the
OpenMP region (scope). For later Semantic checks and CG, a new
symbol is also created for common block name with `HostAssocDetails`.
There are many things are still on the TODO list:
- Better error/warning messages with directive/clause source provenance
- Resolve variables referenced in the OpenMP region, for example,
`private(tt%a)` is not allowed but `tt%a = 1` is allowed in the
OpenMP region and a private version of `tt` maybe created for
the region. The functions created in the `OmpVisitor` should be
able to handle the name resolution on the statement too (more
data structures may be introduced). This is a big portion and may
require some interface changes to distinguish a reference is on
`OpenMP directive/clause` or `statements within OpenMP region`.
- Same data reference appears on multiple data-sharing clauses.
- Take association into consideration for example Pointer association,
`ASSOCIATE` construct, and etc.
- Handle `Array Sections` and `Array or Structure Element`.
- Handle all the name resolution for directives/clauses that have
`parser::Name`.
- More tests
Original-commit: flang-compiler/f18@
b2ea520885eceb6e118f690b95e1846183fe378b
psteinfeld [Fri, 25 Oct 2019 17:26:58 +0000 (10:26 -0700)]
[flang] Merge pull request flang-compiler/f18#789 from flang-compiler/ps-issue781
Changes to check for calls to PURE procedure components
Original-commit: flang-compiler/f18@
3a0457adee173b77439569fdcd795ba5c67faa0c
Reviewed-on: https://github.com/flang-compiler/f18/pull/789
Pete Steinfeld [Wed, 23 Oct 2019 22:56:22 +0000 (15:56 -0700)]
[flang] Changes to check for calls to PURE procedure components
This addresses issue flang-compiler/f18#781. I changed my test to create a PURE procedure
component by using an interface as suggested by Peter and Jean. I then
enhanced the function IsPureProcedure() in tools.cc to cover this case
and updated the code in check-do.cc to perform the test.
Original-commit: flang-compiler/f18@
5df56a217dfc93775305ecb077aa4de2852ab71f
Reviewed-on: https://github.com/flang-compiler/f18/pull/789
Peter Klausler [Fri, 25 Oct 2019 16:01:51 +0000 (09:01 -0700)]
[flang] Merge pull request flang-compiler/f18#792 from flang-compiler/pmk-call05-again
pmk-call05 again
Original-commit: flang-compiler/f18@
2b88ae44db2c7377fd655ff381ba1a23150be52c
Reviewed-on: https://github.com/flang-compiler/f18/pull/792
peter klausler [Fri, 25 Oct 2019 16:01:27 +0000 (09:01 -0700)]
[flang] Restore a review comment response
Original-commit: flang-compiler/f18@
d9673df31c7cd011a03685da000279b78c69d6b5
Reviewed-on: https://github.com/flang-compiler/f18/pull/792
peter klausler [Thu, 24 Oct 2019 23:38:09 +0000 (16:38 -0700)]
[flang] Fix duplicate messages
Original-commit: flang-compiler/f18@
6528c5f31b8ee9a281b672927a636cee67381d4e
Reviewed-on: https://github.com/flang-compiler/f18/pull/792
Tree-same-pre-rewrite: false
peter klausler [Thu, 24 Oct 2019 23:08:06 +0000 (16:08 -0700)]
[flang] Restored changes from pmk-call05
Original-commit: flang-compiler/f18@
bb9c12eec36e7737ebc20b17d7e51da127aa1fbf
Reviewed-on: https://github.com/flang-compiler/f18/pull/792
Tree-same-pre-rewrite: false
Peter Klausler [Thu, 24 Oct 2019 22:03:26 +0000 (15:03 -0700)]
[flang] Merge pull request flang-compiler/f18#790 from flang-compiler/pmk-expr-msgs
Add contextualizing interfaces to ExpressionAnalyzer and ContextualMe…
Original-commit: flang-compiler/f18@
85136c45efaea28e502e66a498604ac64fb7924f
Reviewed-on: https://github.com/flang-compiler/f18/pull/790
peter klausler [Thu, 24 Oct 2019 21:55:25 +0000 (14:55 -0700)]
[flang] Add contextualizing interfaces to ExpressionAnalyzer and ContextualMessages
Original-commit: flang-compiler/f18@
30a004d7b162a425fa41acd9f51fc3dc5e8624c4
Reviewed-on: https://github.com/flang-compiler/f18/pull/790
psteinfeld [Wed, 23 Oct 2019 21:17:30 +0000 (14:17 -0700)]
[flang] Merge pull request flang-compiler/f18#780 from flang-compiler/ps-move_alloc
Changes to disallow image control statements in DO CONCURRENT
Original-commit: flang-compiler/f18@
adc753c306b690426a955023ebcfb0891a9a545b
Reviewed-on: https://github.com/flang-compiler/f18/pull/780
Pete Steinfeld [Fri, 11 Oct 2019 21:39:33 +0000 (14:39 -0700)]
[flang] # This is a combination of 2 commits.
# This is the 1st commit message:
Changes to disallow image control statements in DO CONCURRENT
Most of these changes were already implemented. The last remaining part was to check for calls to move_alloc with coarray arguments. This set of changes implements that. I also bundled other changes. Specifically:
All of the code to detect image control statements was moved from check-do.cc to tools.cc so that it could be used by other semantic checking functions.
I added location information to the error messages for all DO semantics checks to highlight either the DO loop associated with the error or other relevant source locations.
I cleaned up the error messages associated with DO semantics so that they have more consistent grammar and punctuation.
I eliminated redundant checks for IEEE_GET_FLAG and IEEE_HALTING_MODE.
I removed the redundant test doconcurrent08.f90.
Responses to pull request comments
I changed the interface to determine whether a statement is an image control
statement to use an ExecutableConstruct as its input. Since
ExecutableConstruct contains types that do not have source location information
(ChangeTeamConstruct and CriticalConstruct), I also created a function to get
the source location of an ExecutableConstruct. Also, some ExecutableConstructs
are image control statements because they reference coarrays. I wanted to tell
users that the reason that an ALLOCATE statement (for example) is an image
control statement because it references a coarray. To make this happen, I
added another function to return a message for image control statements that
reference coarrays.
I also cleaned up the references to the standard in comments in check-do.cc to
briefly describe the contents of those constraints.
I also added messages that refer to the enclosing DO CONCURRENT statement for
error messages where appropriate.
Responses to pull request comments
The biggest change was to redo the implementation of "IsImageControlStmt()" to
use a custom visitor that strips off the "common::Indirection<...>" prefix of
most of the image control statement types and also takes advantage of
"common::HasMember<...>" to determine if a variant contains a specific type.
Spelling error.
# This is the commit message flang-compiler/f18#2:
More refactoring in response to comments on the pull request.
Original-commit: flang-compiler/f18@
3f0a0155b3fc3ae8bd81780c1254e235dc272b77
Reviewed-on: https://github.com/flang-compiler/f18/pull/780
Tim Keith [Wed, 23 Oct 2019 13:31:27 +0000 (06:31 -0700)]
[flang] Merge pull request flang-compiler/f18#786 from flang-compiler/tsk-defined-ops
Resolve defined operators to specifics
Original-commit: flang-compiler/f18@
b10a60d2d6fa3257e5c3429c93e900e96fd646ad
Reviewed-on: https://github.com/flang-compiler/f18/pull/786
Tim Keith [Tue, 22 Oct 2019 16:31:33 +0000 (09:31 -0700)]
[flang] Resolve defined operators to specifics
Most of these changes involve moving code around so that it case be
used for `DefinedUnary` and `DefinedBinary`. The functional changes are
in the `Analyze` member functions for those cases where the arguments
are now analyzed, the generic is resolved, and a `FunctionRef` is
created.
Add `ArgumentAnalyzer` to handling building of the `ActualArguments`
of a call. This allows the code to be shared with the defined unary
and defined binary cases. Move `AnalyzeActualArgument` and
`AnalyzeActualArgument` into that class (renaming both to `Analyze`).
Create an overload of `GetCalleeAndArguments` for the `Name` case so it
can be used for defined ops where we don't have a `ProcedureDesignator`.
Move `IsGenericDefinedOp` to `tools.h` to make it available to the
new code.
We were using `semantics::CheckExplicitInterface` to resolve a generic
interface to a specific procedure based on actual arguments. The problem
with that is that it performs too many checks. We just want to get the
right specific; there may be errors reported later during call analysis.
To fix this, add a new function, `CheckInterfaceForGeneric`, to perform
this check. It shares code with `CheckExplicitInterface`, but it passes
in a null scope to indicate that the full set of checks aren't
necessary in `CheckExplicitInterfaceArg`. Instead we lift the call to
`TypeAndShape::IsCompatibleWith` out of `CheckExplicitDataArg`, and skip
the latter when there is no scope.
Original-commit: flang-compiler/f18@
fff2d1580f26719e0c384c66576aa6620d04faff
Reviewed-on: https://github.com/flang-compiler/f18/pull/786
Peter Klausler [Tue, 22 Oct 2019 22:57:00 +0000 (15:57 -0700)]
[flang] Merge pull request flang-compiler/f18#787 from flang-compiler/pmk-fix
Fix bad new test, and fix detection of test failures in that test too
Original-commit: flang-compiler/f18@
7c32e6757134223d1bd900e7e8bd2e5aa41b1c5a
Reviewed-on: https://github.com/flang-compiler/f18/pull/787
peter klausler [Tue, 22 Oct 2019 22:28:26 +0000 (15:28 -0700)]
[flang] Fix bad new test, and fix detection of test failures in that test too
Original-commit: flang-compiler/f18@
38ec2a879b63e633a7663698861cfc9aba56acd6
Reviewed-on: https://github.com/flang-compiler/f18/pull/787
Peter Klausler [Tue, 22 Oct 2019 20:18:59 +0000 (13:18 -0700)]
[flang] Merge pull request flang-compiler/f18#785 from flang-compiler/pmk-int128
Implement uint128_t for impoverished build environments
Original-commit: flang-compiler/f18@
6ea37f7cf56056e8d2bd815f87ae669f29787aed
Reviewed-on: https://github.com/flang-compiler/f18/pull/785
peter klausler [Tue, 22 Oct 2019 17:34:05 +0000 (10:34 -0700)]
[flang] Work around a gcc-7.2 specific build bug by recoding with a better approach
Original-commit: flang-compiler/f18@
bc2b4015b06cc2c669e97dc56821050c6022ff7e
Reviewed-on: https://github.com/flang-compiler/f18/pull/785
peter klausler [Mon, 21 Oct 2019 21:57:48 +0000 (14:57 -0700)]
[flang] Fix clang performance problem with new code
Original-commit: flang-compiler/f18@
b70cac3ba8e093eeb62cec8d1a8eb932eff585c8
Reviewed-on: https://github.com/flang-compiler/f18/pull/785
Tree-same-pre-rewrite: false
peter klausler [Mon, 21 Oct 2019 21:14:38 +0000 (14:14 -0700)]
[flang] Testing and debugging
Original-commit: flang-compiler/f18@
3fa2e55bef6858e1f6bf49b3cd96d424163156d3
Reviewed-on: https://github.com/flang-compiler/f18/pull/785
Tree-same-pre-rewrite: false
peter klausler [Fri, 18 Oct 2019 23:51:29 +0000 (16:51 -0700)]
[flang] Add software uint128_t (debugging incomplete)
Original-commit: flang-compiler/f18@
5be270e604965626ece73ca376ec450986cc5ae1
Reviewed-on: https://github.com/flang-compiler/f18/pull/785
Tree-same-pre-rewrite: false
Peter Klausler [Mon, 21 Oct 2019 20:21:48 +0000 (13:21 -0700)]
[flang] Merge pull request flang-compiler/f18#783 from flang-compiler/pmk-call04
Add call semantics checks, pass call04.f90 test
Original-commit: flang-compiler/f18@
2555860e779d5ee3e475e72fa66027ddbb1cd394
Reviewed-on: https://github.com/flang-compiler/f18/pull/783
peter klausler [Thu, 17 Oct 2019 23:15:20 +0000 (16:15 -0700)]
[flang] Pass call04
Original-commit: flang-compiler/f18@
5a4483780420e105b2a5aeb82a1b268c028ef7f1
Reviewed-on: https://github.com/flang-compiler/f18/pull/783
peter klausler [Thu, 17 Oct 2019 19:28:25 +0000 (12:28 -0700)]
[flang] most call04 checks
Original-commit: flang-compiler/f18@
65289a66d10d21df497b677164bdf26bc10da6b2
Reviewed-on: https://github.com/flang-compiler/f18/pull/783
Tree-same-pre-rewrite: false
Peter Klausler [Mon, 21 Oct 2019 19:43:13 +0000 (12:43 -0700)]
[flang] Merge pull request flang-compiler/f18#782 from flang-compiler/pmk-calls
Further semantics checks for procedure references
Original-commit: flang-compiler/f18@
fbdd919a1452a10e3ddeed2c219f840ba9638704
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
peter klausler [Thu, 17 Oct 2019 22:29:26 +0000 (15:29 -0700)]
[flang] Use component iterators in check-call.cc
Original-commit: flang-compiler/f18@
e78db8907f75ebad88b53126b2cfbc743336a8bf
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
peter klausler [Thu, 17 Oct 2019 19:10:33 +0000 (12:10 -0700)]
[flang] Address remaining initial comments
Original-commit: flang-compiler/f18@
acd307c91fc27ae0edb6695fd4955ae38c916903
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
peter klausler [Thu, 17 Oct 2019 17:57:01 +0000 (10:57 -0700)]
[flang] Address most review comments
Original-commit: flang-compiler/f18@
43720b5057437c77bbe7baa45c7e93ac871e17f9
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
peter klausler [Wed, 16 Oct 2019 22:36:54 +0000 (15:36 -0700)]
[flang] Pad short CHARACTER actual arguments
Original-commit: flang-compiler/f18@
b9c890ca9cc3e07967ece4dee739ac8059bb9388
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
peter klausler [Wed, 16 Oct 2019 18:53:03 +0000 (11:53 -0700)]
[flang] Revert to returning default INTEGER for LEN() and offset-in-CHARACTER intrinsics; further shape analysis of intrinsic results
Original-commit: flang-compiler/f18@
561f5965b2309df3cd15d7e2a96d7e73f2f76e35
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
peter klausler [Wed, 16 Oct 2019 17:35:34 +0000 (10:35 -0700)]
[flang] Better shape analysis for CSHIFT, EOSHIFT, SPREAD
Original-commit: flang-compiler/f18@
eb43df85a6048d0ffe417998d068bb6c45e702e0
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
peter klausler [Wed, 16 Oct 2019 16:39:37 +0000 (09:39 -0700)]
[flang] Fix some bugs exposed by testing new checks
Original-commit: flang-compiler/f18@
9cc70dcad64a77bb67cdb30f157a00898227f727
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
peter klausler [Fri, 11 Oct 2019 22:41:11 +0000 (15:41 -0700)]
[flang] rebase
Original-commit: flang-compiler/f18@
2691da38361cb4040e394dd5f631becf4caef221
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
peter klausler [Thu, 10 Oct 2019 23:06:05 +0000 (16:06 -0700)]
[flang] pass call03
Original-commit: flang-compiler/f18@
8c076bd89b30351b0b6470f4cf621efed1c2ae27
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
peter klausler [Thu, 10 Oct 2019 20:09:35 +0000 (13:09 -0700)]
[flang] definability tests
Original-commit: flang-compiler/f18@
4b71f003a9c3a88b4a3e5cbad12f33fb46ef0657
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
peter klausler [Wed, 9 Oct 2019 23:30:34 +0000 (16:30 -0700)]
[flang] Move call semantic checking into lib/semantics
Original-commit: flang-compiler/f18@
7996c85cf3311506093a9864263e198e4199ea29
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
peter klausler [Tue, 8 Oct 2019 22:21:09 +0000 (15:21 -0700)]
[flang] checkpoint
checkpoint
checkpoint
Original-commit: flang-compiler/f18@
99d12a7215089b4aefdaef39a2407b84538c29ef
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
Tim Keith [Thu, 10 Oct 2019 18:47:12 +0000 (11:47 -0700)]
[flang] Merge pull request flang-compiler/f18#778 from flang-compiler/tsk-generics
Generic name resolution in expression analysis
Original-commit: flang-compiler/f18@
1688bef152eca1144c985ec7cf9b352a02465130
Reviewed-on: https://github.com/flang-compiler/f18/pull/778
Tim Keith [Wed, 9 Oct 2019 23:08:13 +0000 (16:08 -0700)]
[flang] Generic name resolution in expression analysis
Implement the basics of resolving generic names in expressions.
`ExpressionAnalyzer::ResolveGeneric` maps the symbol for a generic
name to the specific procedure appropriate for the actual arguments.
Extract `CheckExplicitInterface` out of `CheckArguments` so that it
can be tried for each specific procedure of the generic as part of
the test to see which is compatible.
Note that it may be there is an elemental and non-elemental specific
procedure that is compatible with the actual arguments. In that case
the generic is resolved to the non-elemental one.
Test this by using generic functions in specification expressions
that must be written to module files. Verify how the generics were
resolved by looking at the generated `.mod` files.
There is more work to be done in this area: the passed-object dummy
argument is not considered and in some cases generated module files
are not correct.
Original-commit: flang-compiler/f18@
50e458045a3de42bd60515956e09f0f2d654ae1e
Reviewed-on: https://github.com/flang-compiler/f18/pull/778
Peter Klausler [Mon, 7 Oct 2019 18:28:40 +0000 (11:28 -0700)]
[flang] Merge pull request flang-compiler/f18#776 from flang-compiler/pmk-call
More procedure reference semantics checking (mostly arguments)
Original-commit: flang-compiler/f18@
c582562397a47498a55aaa3671dc0a84d1201af1
Reviewed-on: https://github.com/flang-compiler/f18/pull/776
peter klausler [Mon, 16 Sep 2019 23:58:13 +0000 (16:58 -0700)]
[flang] Update preprocessing document, commentary
Extend documentation on preprocessing
IsSimplyContiguous
basic skeleton
Apply suggested improvements to mod-file.cc
Checks for new call13.f90 (15.4.2.2 explicit interfaces)
Implement checking for procedures that can be called via an implicit interface
Argument checking, test fixing
Better argument checking
Better derived type compatibility checking
Treat externals as if implicitly interfaced
Extend IEEE_EXCEPTIONS module so tests still pass with argument checking
SAME_TYPE_AS and EXTENDS_TYPE_OF intrinsic inquiry functions
Define interfaces for most intrinsic subroutines
Better PASS arguments
More with PASS() argument
Prep for review
address comments
fix comment
Remove formatted expression from specification expression error message per review
more review comments
Original-commit: flang-compiler/f18@
3cca775da9302e3a2acec4a34800cd7666899b5f
Reviewed-on: https://github.com/flang-compiler/f18/pull/776
Peter Klausler [Mon, 7 Oct 2019 16:40:47 +0000 (09:40 -0700)]
[flang] Merge pull request flang-compiler/f18#777 from flang-compiler/pmk-pp-tests
Import preprocessing tests
Original-commit: flang-compiler/f18@
98f1b5f60b3becd6433ccb1fa1d070529c4cf109
Reviewed-on: https://github.com/flang-compiler/f18/pull/777
peter klausler [Fri, 4 Oct 2019 22:21:31 +0000 (15:21 -0700)]
[flang] Import preprocessing tests
Original-commit: flang-compiler/f18@
7ef7029604fa62c33d47ef0d710403b9f2aae670
Reviewed-on: https://github.com/flang-compiler/f18/pull/777
Steve Scalpone [Thu, 3 Oct 2019 17:59:31 +0000 (10:59 -0700)]
[flang] Merge pull request flang-compiler/f18#775 from flang-compiler/pmk-fix
Fix flang-compiler/f18#773: ambiguous REALA=3 should be an assignment, not a declaration
Original-commit: flang-compiler/f18@
adbb8becdae433b1727f47cf10affc6eb4328482
Reviewed-on: https://github.com/flang-compiler/f18/pull/775
peter klausler [Wed, 2 Oct 2019 22:42:07 +0000 (15:42 -0700)]
[flang] Fix flang-compiler/f18#773
Original-commit: flang-compiler/f18@
d12d1129b746394d3a179b49c3c2034ecdeafd59
Reviewed-on: https://github.com/flang-compiler/f18/pull/775
Steve Scalpone [Thu, 3 Oct 2019 17:59:14 +0000 (10:59 -0700)]
[flang] Merge pull request flang-compiler/f18#774 from flang-compiler/pmk-more-warnings
Enable clang warnings used by LLVM
Original-commit: flang-compiler/f18@
c098156735a9e6b1844f97800be2a94b6a89978f
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
peter klausler [Wed, 2 Oct 2019 23:52:27 +0000 (16:52 -0700)]
[flang] Final tweaks
Original-commit: flang-compiler/f18@
6e269b4e299d04a14eb4efc125821168eedeef04
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
peter klausler [Wed, 2 Oct 2019 23:30:36 +0000 (16:30 -0700)]
[flang] Extend documentation
Original-commit: flang-compiler/f18@
7e11f8165f67426ff33887677adf5d723e3895b6
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
Tree-same-pre-rewrite: false
peter klausler [Wed, 2 Oct 2019 23:14:01 +0000 (16:14 -0700)]
[flang] Dodge weird clang-format behavior
Original-commit: flang-compiler/f18@
48b81a2dd9e6f92725be92b3225b1cd258173607
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
Tree-same-pre-rewrite: false
peter klausler [Wed, 2 Oct 2019 22:48:20 +0000 (15:48 -0700)]
[flang] Address review comments
Original-commit: flang-compiler/f18@
b2a0503614b325c62af920db5a183a2e254994f7
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
Tree-same-pre-rewrite: false
peter klausler [Wed, 2 Oct 2019 21:24:44 +0000 (14:24 -0700)]
[flang] Retain no-op default: cases when compiling with gcc
Original-commit: flang-compiler/f18@
8ebfd8d2e9b00ae003ecdc5eb71f63e6fe908143
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
Tree-same-pre-rewrite: false
peter klausler [Wed, 2 Oct 2019 19:40:52 +0000 (12:40 -0700)]
[flang] Enable more warnings, clean them up
Original-commit: flang-compiler/f18@
c6b3420e5fd7aca76453ae996bec1c8402a2ab43
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
Tree-same-pre-rewrite: false
Steve Scalpone [Thu, 3 Oct 2019 17:58:45 +0000 (10:58 -0700)]
[flang] Merge pull request flang-compiler/f18#772 from DavidTruby/dist-schedule
Make the second argument to dist_schedule optional.
Original-commit: flang-compiler/f18@
ff8dde78e6c7ad93fe1d9055d345f7355706eaad
Reviewed-on: https://github.com/flang-compiler/f18/pull/772
David Truby [Thu, 3 Oct 2019 09:37:05 +0000 (10:37 +0100)]
[flang] Removed stray comma in unparse for dist_schedule clause
Original-commit: flang-compiler/f18@
0b61bc22c23fa302b34cb560cb291f0484926e5e
Reviewed-on: https://github.com/flang-compiler/f18/pull/772
David Truby [Wed, 2 Oct 2019 15:58:11 +0000 (16:58 +0100)]
[flang] Make the second argument to dist_schedule optional.
Original-commit: flang-compiler/f18@
7ed2d0e3ec68f00c483d3107d0383a4f172d1feb
Reviewed-on: https://github.com/flang-compiler/f18/pull/772
Tree-same-pre-rewrite: false
Steve Scalpone [Thu, 3 Oct 2019 17:58:24 +0000 (10:58 -0700)]
[flang] Merge pull request flang-compiler/f18#771 from DavidTruby/distribute
Added basic sema checks for distribute construct
Original-commit: flang-compiler/f18@
3aeb44b3a8a5fe8baa2e1758ae2e38c89a57eedd
Reviewed-on: https://github.com/flang-compiler/f18/pull/771
David Truby [Wed, 2 Oct 2019 15:04:30 +0000 (16:04 +0100)]
[flang] Added basic sema checks for distribute construct
Original-commit: flang-compiler/f18@
f23059bf308a3d29b60bc0452deaa23da3d8eaa1
Reviewed-on: https://github.com/flang-compiler/f18/pull/771
Steve Scalpone [Thu, 3 Oct 2019 17:57:46 +0000 (10:57 -0700)]
[flang] Merge pull request flang-compiler/f18#767 from DavidTruby/generic-fp
Replace access through union with reinterpret_cast.
Original-commit: flang-compiler/f18@
f7d8318b56665ed1c6d7998310bf3d51db4aae12
Reviewed-on: https://github.com/flang-compiler/f18/pull/767
David Truby [Tue, 1 Oct 2019 10:15:43 +0000 (11:15 +0100)]
[flang] Added comment about gcc function cast workaround.
Original-commit: flang-compiler/f18@
28bc021323b5b76371fe3f5640b17f8adb0ee4b1
Reviewed-on: https://github.com/flang-compiler/f18/pull/767
David Truby [Mon, 30 Sep 2019 11:41:34 +0000 (12:41 +0100)]
[flang] Replace access through union with reinterpret_cast.
This avoids undefined behaviour.
Original-commit: flang-compiler/f18@
e289bbfa83ebb818971a688b019be697fd900d62
Reviewed-on: https://github.com/flang-compiler/f18/pull/767
Tree-same-pre-rewrite: false
Eric Schweitz [Wed, 2 Oct 2019 18:02:24 +0000 (11:02 -0700)]
[flang] Merge pull request flang-compiler/f18#720 from schweitzpgi/resurrect-flat-form
re-add files from old FIR code
Original-commit: flang-compiler/f18@
5bf0827c20f4b9be3b49c1fd28bb14871a3ed9ad
Reviewed-on: https://github.com/flang-compiler/f18/pull/720
Eric Schweitz [Mon, 9 Sep 2019 18:20:02 +0000 (11:20 -0700)]
[flang] add initial Burnside bridge code
Original-commit: flang-compiler/f18@
0d387d146849ecb218b554e3b072794c8d6216d6
Reviewed-on: https://github.com/flang-compiler/f18/pull/720
psteinfeld [Tue, 1 Oct 2019 20:10:21 +0000 (13:10 -0700)]
[flang] Merge pull request flang-compiler/f18#769 from flang-compiler/ps-c1137
More semantic checking for DO constructs
Original-commit: flang-compiler/f18@
3a13d84742a88a0684e372e025e4e7530378d3bf
Reviewed-on: https://github.com/flang-compiler/f18/pull/769
Pete Steinfeld [Mon, 30 Sep 2019 20:52:05 +0000 (13:52 -0700)]
[flang] More semantic checking for DO constructs
This time I'm adding to the checks for constraint C1137, which states
that image control statements cannot appear in a DO CONCURRENT. The
checks I added test to see if the DO CONCURRENT contains an ALLOCATE or
DEALLOCATE that references a coarray.
Original-commit: flang-compiler/f18@
c16b883db3016bceb2c795babe047d297ba92717
Reviewed-on: https://github.com/flang-compiler/f18/pull/769
Steve Scalpone [Tue, 1 Oct 2019 07:09:40 +0000 (00:09 -0700)]
[flang] Merge pull request flang-compiler/f18#748 from DavidTruby/map
Added semantic checks for map clauses
Original-commit: flang-compiler/f18@
183b3aab8351bdc0018c9d4963e9ce07588560af
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
David Truby [Wed, 18 Sep 2019 09:12:57 +0000 (10:12 +0100)]
[flang] Added grammar comments for enter data and exit data directives
Original-commit: flang-compiler/f18@
a1e6cded2f0c0af9fda8ea53ac8c6636843e07e1
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
David Truby [Tue, 17 Sep 2019 08:53:27 +0000 (09:53 +0100)]
[flang] Corrected check for required OpenMP clauses
Original-commit: flang-compiler/f18@
ce3ec50c3f01785f8bc0f92f1a7f6b65b2e52973
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
Tree-same-pre-rewrite: false
David Truby [Mon, 16 Sep 2019 14:44:31 +0000 (15:44 +0100)]
[flang] Corrections for map semantics to match coding style
Original-commit: flang-compiler/f18@
f2d97c3a1e77398addecbdb20ed55f2aa01361d8
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
Tree-same-pre-rewrite: false
David Truby [Fri, 13 Sep 2019 14:42:19 +0000 (15:42 +0100)]
[flang] Added semantic checks for map clauses
Original-commit: flang-compiler/f18@
75b62283888c53c066999245bcd1fe9bdd29fe41
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
Tree-same-pre-rewrite: false
Eric Schweitz [Fri, 27 Sep 2019 22:07:44 +0000 (15:07 -0700)]
[flang] Merge pull request flang-compiler/f18#696 from schweitzpgi/fir-type
add fir types header
Original-commit: flang-compiler/f18@
fc53f3415ee67bf731287e44593fa51ef4fd82ec
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Eric Schweitz [Thu, 26 Sep 2019 20:08:27 +0000 (13:08 -0700)]
[flang] sync latest changes to these files
Original-commit: flang-compiler/f18@
97becf30fa9cf79f8fd1aa01d1e1e2271251e4a9
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Eric Schweitz [Tue, 17 Sep 2019 21:23:20 +0000 (14:23 -0700)]
[flang] latest changes
Original-commit: flang-compiler/f18@
c4278fe1aa82c5667f7dd9de21c8d3777a48d07b
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
Eric Schweitz [Tue, 10 Sep 2019 15:25:34 +0000 (08:25 -0700)]
[flang] add FIROps.h
Original-commit: flang-compiler/f18@
e53fefb66cd1f86b0c157786f41b05bbb607c54c
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
Eric Schweitz [Mon, 9 Sep 2019 23:05:02 +0000 (16:05 -0700)]
[flang] fix name of argument
Original-commit: flang-compiler/f18@
ad505459416fabf3f9b3663bd170f1645abbfc88
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
Eric Schweitz [Fri, 6 Sep 2019 23:15:37 +0000 (16:15 -0700)]
[flang] add attributes
Original-commit: flang-compiler/f18@
d35f55b0d5fc45d161515824731430bda8fd3d67
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
Eric Schweitz [Fri, 6 Sep 2019 20:37:14 +0000 (13:37 -0700)]
[flang] more cleanup
Original-commit: flang-compiler/f18@
23fdcf77d03e0b813eb000237e127bf9eea92a15
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
Eric Schweitz [Fri, 6 Sep 2019 20:25:42 +0000 (13:25 -0700)]
[flang] changes per review comments
Original-commit: flang-compiler/f18@
eb34e2d47b1a8d43c87ce4368046fe2195e3b783
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
Eric Schweitz [Wed, 28 Aug 2019 20:53:50 +0000 (13:53 -0700)]
[flang] add fir types header
Original-commit: flang-compiler/f18@
4dc278b271ca5c30505db1c980d284929e464541
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
Peter Klausler [Fri, 27 Sep 2019 21:53:14 +0000 (14:53 -0700)]
[flang] Merge pull request flang-compiler/f18#766 from flang-compiler/pmk-fix-765
Fix flang-compiler/f18#765
Original-commit: flang-compiler/f18@
2fffc265c328ef0169ca63f654f1d54401a86880
Reviewed-on: https://github.com/flang-compiler/f18/pull/766
peter klausler [Fri, 27 Sep 2019 21:08:09 +0000 (14:08 -0700)]
[flang] Fix flang-compiler/f18#765
Original-commit: flang-compiler/f18@
bb2ffac7176ce81079940b8736461cb01794f9c8
Reviewed-on: https://github.com/flang-compiler/f18/pull/766
psteinfeld [Thu, 26 Sep 2019 21:06:58 +0000 (14:06 -0700)]
[flang] Merge pull request flang-compiler/f18#764 from flang-compiler/ps-do
Added tests for image control statements in DO CONCURRENT
Original-commit: flang-compiler/f18@
2856f0f2488c57874d2d06a6f40a02b4ddf1a109
Reviewed-on: https://github.com/flang-compiler/f18/pull/764
Pete Steinfeld [Thu, 26 Sep 2019 20:33:48 +0000 (13:33 -0700)]
[flang] Added tests for image control statements in DO CONCURRENT
There was already code in check-do.cc to test for the presence of a
variety of different image control statements, but several of them did
not have associated tests. This change adds tests for most of them.
Also, I removed the check for the END PROGRAM statement, since its
presence causes a syntax error which prevents the semantic check from
ever being reached.
Original-commit: flang-compiler/f18@
9cc6f5bd40689fa4bd0972e821ad3a871733b6fb
Reviewed-on: https://github.com/flang-compiler/f18/pull/764