Commit graph

1658 commits

Author SHA1 Message Date
Jean Perier
db2f460e52 [flang] Test host subnormal flushing setup when folding on host
Original-commit: flang-compiler/f18@78381c897d
Tree-same-pre-rewrite: false
2019-04-15 01:18:38 -07:00
Peter Klausler
8c3c26bf35 [flang] Merge pull request flang-compiler/f18#415 from flang-compiler/pmk-source-variables
Capture source locations for Designators and Calls

Original-commit: flang-compiler/f18@389423c718
Reviewed-on: https://github.com/flang-compiler/f18/pull/415
2019-04-15 16:06:26 -07:00
peter klausler
b147f32dcc [flang] Fix bug found in testing
Original-commit: flang-compiler/f18@45a1e6e3dc
Reviewed-on: https://github.com/flang-compiler/f18/pull/415
2019-04-15 15:53:18 -07:00
peter klausler
ce9716d037 [flang] Capture source locations for Designators and Calls
Original-commit: flang-compiler/f18@970333fff7
Reviewed-on: https://github.com/flang-compiler/f18/pull/415
Tree-same-pre-rewrite: false
2019-04-15 15:18:07 -07:00
Tim Keith
2c472d6b8a [flang] Merge pull request flang-compiler/f18#414 from flang-compiler/tsk3
More coarray name resolution and semantic checks

Original-commit: flang-compiler/f18@3008e8638d
Reviewed-on: https://github.com/flang-compiler/f18/pull/414
2019-04-15 14:07:11 -07:00
Tim Keith
c51c9399f9 [flang] Address review comments
Original-commit: flang-compiler/f18@577629f489
Reviewed-on: https://github.com/flang-compiler/f18/pull/414
2019-04-15 14:07:11 -07:00
Tim Keith
b2f84a5eda [flang] More coarray name resolution and semantic checks
Add CoarrayChecker to check for valid team-value in CHANGE TEAM,
SYNC TEAM, and image selector. Check that coarray names and selector
names are distinct in CHANGE TEAM.

Resolve the variable in a coarray-association.
Create a scope for the construct entities of a CHANGE TEAM construct.

Add ResolveSelector to resolve a parser::Selector into an Expr and
optional variable name (and a source location for messages). Make use of
ResolveSelector to handle coarray-association, as well as it's previous
use in associate-stmt.

Improve the check for C1157 in select-type-stmt and add a test.

Add a test for "Associate name must have a type".

Move ResolveName, ResolveDataRef, etc. from ResolveNamesVisitor
to DeclarationVisitor so that they are available in ConstructVisitor
as well. Add ResolveVariable and ResolveDesignator.

In the parse tree, change TeamValue from a type alias to a wrapper
class. We already had a wrapper class anyway, ImageSelectorSpec::Team,
so the new TeamValue can be used instead. This allows the member
of ImageSelectorSpec to be treated like other occurrences of TeamValue.

Original-commit: flang-compiler/f18@f856744b54
Reviewed-on: https://github.com/flang-compiler/f18/pull/414
Tree-same-pre-rewrite: false
2019-04-15 14:07:11 -07:00
Steve Scalpone
ecc3869964 [flang] Merge branch 'sjs-check-return'
Conflicts:
	lib/semantics/semantics.cc
	test/semantics/CMakeLists.txt

Original-commit: flang-compiler/f18@71ae0d0915
2019-04-15 10:59:12 -07:00
Steve Scalpone
3568e45856 [flang] FindContainingSubprogram returns a pointer, not a reference.
Original-commit: flang-compiler/f18@7d221b09bd
2019-04-15 10:59:12 -07:00
Steve Scalpone
05f0145be5 [flang] Avoid copying scope. Improve readability.
Original-commit: flang-compiler/f18@5d2213cd7a
Tree-same-pre-rewrite: false
2019-04-15 10:59:12 -07:00
Steve Scalpone
e2d6bbc016 [flang] Scope is only ever set to the address of a Scope,
so it can never be null. The condition should be
scope->kind() != Scope::Kind::Global.
And clang-format.

Original-commit: flang-compiler/f18@b686ab548a
Tree-same-pre-rewrite: false
2019-04-15 10:59:12 -07:00
Steve Scalpone
85661f4657 [flang] Implement semantic checks for return and alt-return.
Original-commit: flang-compiler/f18@123c23783b
Tree-same-pre-rewrite: false
2019-04-15 10:59:12 -07:00
Peter Klausler
709ae5a9d5 [flang] Merge pull request flang-compiler/f18#413 from flang-compiler/pmk-no-scope-copy-constr
Delete the default copy constructor for Scope.

Original-commit: flang-compiler/f18@d77e93fcec
Reviewed-on: https://github.com/flang-compiler/f18/pull/413
2019-04-15 10:40:35 -07:00
peter klausler
73bcc7a7cd [flang] Delete the default copy constructor for Scope.
Original-commit: flang-compiler/f18@e8e3e5fd46
Reviewed-on: https://github.com/flang-compiler/f18/pull/413
2019-04-15 10:30:40 -07:00
Peter Klausler
9a9c2dfa21 [flang] Merge pull request flang-compiler/f18#406 from flang-compiler/pmk-fix-expr-constraints
Reactivate tree-driven expression constraint checking

Original-commit: flang-compiler/f18@febcdef368
Reviewed-on: https://github.com/flang-compiler/f18/pull/406
2019-04-15 10:29:41 -07:00
peter klausler
907bb361c5 [flang] Fix clang warning that crept into codebase over weekend
Original-commit: flang-compiler/f18@8c8ad4c0d8
Reviewed-on: https://github.com/flang-compiler/f18/pull/406
2019-04-15 10:09:22 -07:00
peter klausler
32424cad2d [flang] reformatting
Original-commit: flang-compiler/f18@d9bfa6f48e
Reviewed-on: https://github.com/flang-compiler/f18/pull/406
Tree-same-pre-rewrite: false
2019-04-15 09:44:54 -07:00
peter klausler
ba2ef03a02 [flang] pass all tests
Original-commit: flang-compiler/f18@3cee1993a1
Reviewed-on: https://github.com/flang-compiler/f18/pull/406
Tree-same-pre-rewrite: false
2019-04-15 09:41:50 -07:00
peter klausler
a90455057c [flang] Ensure no failed expression analyses without fatal errors.
Original-commit: flang-compiler/f18@3ef8b43031
Reviewed-on: https://github.com/flang-compiler/f18/pull/406
Tree-same-pre-rewrite: false
2019-04-15 09:41:49 -07:00
peter klausler
8529034ea0 [flang] Capitalize INTEGER in error messages
Original-commit: flang-compiler/f18@c00527c681
Reviewed-on: https://github.com/flang-compiler/f18/pull/406
Tree-same-pre-rewrite: false
2019-04-15 09:41:48 -07:00
peter klausler
3484149aa7 [flang] Finish up
Original-commit: flang-compiler/f18@8c8242e6f4
Reviewed-on: https://github.com/flang-compiler/f18/pull/406
Tree-same-pre-rewrite: false
2019-04-15 09:41:48 -07:00
peter klausler
7243929103 [flang] Split doconcurrent04.f90 test into one with expression checks and one for later semantics pass.
Original-commit: flang-compiler/f18@6b9c25177b
Reviewed-on: https://github.com/flang-compiler/f18/pull/406
Tree-same-pre-rewrite: false
2019-04-15 09:41:47 -07:00
peter klausler
b39d0c51e4 [flang] Reactivate tree-driven constraint checking on expressions.
Original-commit: flang-compiler/f18@85c4a6aab6
Reviewed-on: https://github.com/flang-compiler/f18/pull/406
Tree-same-pre-rewrite: false
2019-04-15 09:41:41 -07:00
Peter Klausler
2f486a7fa4 [flang] Merge pull request flang-compiler/f18#409 from flang-compiler/klausler-patch-1
Update FortranForCProgrammers.md

Original-commit: flang-compiler/f18@ed5d245cc3
Reviewed-on: https://github.com/flang-compiler/f18/pull/409
2019-04-15 09:39:33 -07:00
Peter Klausler
381377848f [flang] Update FortranForCProgrammers.md
Clean up grammar and fix errata.

Original-commit: flang-compiler/f18@d886453148
Reviewed-on: https://github.com/flang-compiler/f18/pull/409
2019-04-12 11:26:36 -07:00
Steve Scalpone
6d123d1c94 [flang] Merge pull request flang-compiler/f18#397 from pawosm-arm/ftz-aarch64
AArch64: Set flushing mode for subnormals on glibc and bionic based systems

Original-commit: flang-compiler/f18@f252855a3a
Reviewed-on: https://github.com/flang-compiler/f18/pull/397
2019-04-15 01:16:29 -07:00
Paul Osmialowski
ebd3759f64 [flang] AArch64: Set flushing mode for subnormals on glibc and bionic based systems
Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>

Original-commit: flang-compiler/f18@4881e3a91c
Reviewed-on: https://github.com/flang-compiler/f18/pull/397
2019-04-10 17:11:03 +01:00
Tim Keith
b6fbf84580 [flang] Merge pull request flang-compiler/f18#410 from flang-compiler/tsk6
Remove ObjectName alternative from Designator

Original-commit: flang-compiler/f18@7c56fc3afb
Reviewed-on: https://github.com/flang-compiler/f18/pull/410
2019-04-13 11:10:18 -07:00
Tim Keith
b69c2c6997 [flang] Remove ObjectName alternative from Designator
A simple name in a `Designator` is always parsed as a `DataRef`, not
an `ObjectName`. So remove that alternative.

`StmtFunctionStmt::ConvertToAssignment` was creating a `Designator` with
that alternative: change it to do the same thing as the parser.

Add `GetSimpleName` utility functions to check if an `Expr` or `Variable`
represents a simple name. Many of the places that checked for `ObjectName`
in `Designator` are trying to do that.

Clean up includes and forward declarations in `tools.h`.

Original-commit: flang-compiler/f18@97d44de7b1
Reviewed-on: https://github.com/flang-compiler/f18/pull/410
2019-04-12 16:30:03 -07:00
Eric Schweitz
a398c8cae1 [flang] Merge pull request flang-compiler/f18#408 from schweitzpgi/qualtype
various code cleanups from QualifiedSmt reviews

Original-commit: flang-compiler/f18@71c5859d07
Reviewed-on: https://github.com/flang-compiler/f18/pull/408
2019-04-12 10:52:01 -07:00
Eric Schweitz
da8d735a00 [flang] tweak comment
Original-commit: flang-compiler/f18@7f5f440439
Reviewed-on: https://github.com/flang-compiler/f18/pull/408
2019-04-12 10:22:09 -07:00
Eric Schweitz
d653839dd3 [flang] handle review comment: make ctor private
Original-commit: flang-compiler/f18@cc6bf19f81
Reviewed-on: https://github.com/flang-compiler/f18/pull/408
Tree-same-pre-rewrite: false
2019-04-12 10:19:41 -07:00
Eric Schweitz
80c3d5cfc3 [flang] various code cleanups from QualifiedType reviews
Original-commit: flang-compiler/f18@b17f24da8f
Reviewed-on: https://github.com/flang-compiler/f18/pull/408
Tree-same-pre-rewrite: false
2019-04-12 09:21:29 -07:00
Tim Keith
0b2dd21616 [flang] Merge pull request flang-compiler/f18#405 from flang-compiler/tsk-include-cleanup
Clean up includes

Original-commit: flang-compiler/f18@a0b5037c36
Reviewed-on: https://github.com/flang-compiler/f18/pull/405
2019-04-12 08:03:18 -07:00
Tim Keith
4ee3386c8f [flang] Clean up includes
indirection.h: Doesn't need ../common because it is in common.

expression.h: ../lib is the wrong path but the includes are needed.
They were probably coming in indirectly through other includes.

token-parsers.h: Include was not needed and parser shouldn't have
dependency on evaluate.

Original-commit: flang-compiler/f18@86f6b0023d
Reviewed-on: https://github.com/flang-compiler/f18/pull/405
2019-04-11 16:12:10 -07:00
Steve Scalpone
1c9f84d493 [flang] Merge pull request flang-compiler/f18#404 from flang-compiler/sjs-cleanup
Misc code cleanup.

Original-commit: flang-compiler/f18@034c1317e6
Reviewed-on: https://github.com/flang-compiler/f18/pull/404
2019-04-11 16:21:38 -07:00
Steve Scalpone
a0e06bb5d4 [flang] Cleanup -- Remove unnecessary inline keyword,
remove unnecessary (void) casts when ignoring
return values, call context_.Say() directly
instead of via messages(), and fix up some
formatting issues using clang-format.

Original-commit: flang-compiler/f18@68e5c02541
Reviewed-on: https://github.com/flang-compiler/f18/pull/404
2019-04-11 15:20:14 -07:00
psteinfeld
4e440846ac [flang] Merge pull request flang-compiler/f18#400 from flang-compiler/ps1-392
Removed unused parameter and tweaked the error message one more time.

Original-commit: flang-compiler/f18@2d20bc549c
Reviewed-on: https://github.com/flang-compiler/f18/pull/400
2019-04-11 15:35:44 -07:00
Peter Steinfeld
cdede97e39 [flang] Hopefully the last fixup of messages that appear for bad termination
of a DO loop.

Original-commit: flang-compiler/f18@23f7471f3a
Reviewed-on: https://github.com/flang-compiler/f18/pull/400
2019-04-11 15:35:44 -07:00
Peter Steinfeld
563d7a6c4c [flang] My last change neglected to include the change to the message.
Original-commit: flang-compiler/f18@09444379f7
Reviewed-on: https://github.com/flang-compiler/f18/pull/400
Tree-same-pre-rewrite: false
2019-04-11 15:35:44 -07:00
Peter Steinfeld
22b489508c [flang] Removed unused parameter and tweaked the error message one more time.
Original-commit: flang-compiler/f18@476791da2a
Reviewed-on: https://github.com/flang-compiler/f18/pull/400
Tree-same-pre-rewrite: false
2019-04-11 15:35:44 -07:00
Steve Scalpone
e3f57417b5 [flang] Merge pull request flang-compiler/f18#401 from flang-compiler/check-deallocate
Implement semantic checks for DEALLOCATE statements.

Original-commit: flang-compiler/f18@e68120d7fa
Reviewed-on: https://github.com/flang-compiler/f18/pull/401
2019-04-11 14:37:49 -07:00
Steve Scalpone
23c31c968e [flang] Simply use context_.Say. Update test with duplicate dealloc opts.
Original-commit: flang-compiler/f18@61b7461552
Reviewed-on: https://github.com/flang-compiler/f18/pull/401
2019-04-11 09:39:32 -07:00
Steve Scalpone
ee79690a0f [flang] Correct constraint numbers. Fix spelling error. Run clang-format.
Original-commit: flang-compiler/f18@59df0d39f3
Reviewed-on: https://github.com/flang-compiler/f18/pull/401
Tree-same-pre-rewrite: false
2019-04-11 04:16:14 -07:00
Steve Scalpone
70285af0ad [flang] Implement semantic checks for DEALLOCATE statements.
The parser checks for duplicate dealloc-opts and expr
analysis checks that dealloc-opts are the right type.

Original-commit: flang-compiler/f18@1ade7f6617
Reviewed-on: https://github.com/flang-compiler/f18/pull/401
Tree-same-pre-rewrite: false
2019-04-10 22:17:44 -07:00
Eric Schweitz
28329e92b6 [flang] Merge pull request flang-compiler/f18#399 from schweitzpgi/qualtype
add QualifiedStmt class

Original-commit: flang-compiler/f18@984f9d7a29
Reviewed-on: https://github.com/flang-compiler/f18/pull/399
2019-04-11 09:55:23 -07:00
Eric Schweitz
4ebcf8b702 [flang] add std::move per review comments
Original-commit: flang-compiler/f18@0f3c1616ed
Reviewed-on: https://github.com/flang-compiler/f18/pull/399
2019-04-11 09:50:55 -07:00
Eric Schweitz
af375b2560 [flang] add QualifiedStmt class
Original-commit: flang-compiler/f18@6bc660c355
Reviewed-on: https://github.com/flang-compiler/f18/pull/399
Tree-same-pre-rewrite: false
2019-04-09 11:52:04 -07:00
psteinfeld
f6893e2409 [flang] Merge pull request flang-compiler/f18#398 from flang-compiler/ps-392
Fix issue 392, improve the error message when a DO loop is terminated by something other than
END DO or CONTINUE

Original-commit: flang-compiler/f18@747858b7eb
Reviewed-on: https://github.com/flang-compiler/f18/pull/398
2019-04-10 13:13:27 -07:00
Peter Steinfeld
95d8de80fe [flang] Changed the DO loop termination message to be different for the error
case.

Original-commit: flang-compiler/f18@51cf517cca
Reviewed-on: https://github.com/flang-compiler/f18/pull/398
2019-04-10 13:06:48 -07:00