Commit graph

1672 commits

Author SHA1 Message Date
Tim Keith
fab062244b [flang] Fix bug resolving internal and module functions
When analyzing a function call in an expression we weren't properly
recognizing a ProcedureDesignator that was the name of an internal
or module function, i.e. a symbol with SubprogramDetails.

The fix is to add IsProcedure to identify symbols that correspond
to procedures. IsFunction and GetType also need to be extended to
handle this case.

Fixes flang-compiler/f18#391.

Original-commit: flang-compiler/f18@f165f8d38c
Reviewed-on: https://github.com/flang-compiler/f18/pull/417
Tree-same-pre-rewrite: false
2019-04-17 07:42:16 -07:00
Peter Klausler
e99ba0bc7d [flang] Merge pull request flang-compiler/f18#416 from flang-compiler/pmk-val-fix
Resolve ambiguous I/O unit parse in favor of CharVariable.

Original-commit: flang-compiler/f18@cd7e907333
Reviewed-on: https://github.com/flang-compiler/f18/pull/416
2019-04-17 08:42:57 -07:00
peter klausler
a8bf4d488f [flang] More clean-up
Original-commit: flang-compiler/f18@ba2365f5f7
Reviewed-on: https://github.com/flang-compiler/f18/pull/416
2019-04-16 16:14:14 -07:00
peter klausler
f79e3dd0b9 [flang] Generalize tools, clean up common/unwrap.h with new-found knowledge
Original-commit: flang-compiler/f18@aac16907cd
Reviewed-on: https://github.com/flang-compiler/f18/pull/416
Tree-same-pre-rewrite: false
2019-04-16 15:59:04 -07:00
peter klausler
bfb65b5476 [flang] Address review comments
Original-commit: flang-compiler/f18@7bc3c97f1e
Reviewed-on: https://github.com/flang-compiler/f18/pull/416
Tree-same-pre-rewrite: false
2019-04-16 12:29:00 -07:00
peter klausler
1498911aa2 [flang] Rewrite I/O units in the parse tree when a variable is not character.
Original-commit: flang-compiler/f18@46791a73e7
Reviewed-on: https://github.com/flang-compiler/f18/pull/416
Tree-same-pre-rewrite: false
2019-04-16 12:28:59 -07:00
peter klausler
1b8a78ac13 [flang] Resolve ambiguous I/O unit parse in favor of CharVariable.
Original-commit: flang-compiler/f18@ecabe82825
Reviewed-on: https://github.com/flang-compiler/f18/pull/416
Tree-same-pre-rewrite: false
2019-04-16 12:28:59 -07:00
jeanPerier
f7895f3ef0 [flang] Add software subnormal flushing around host library calls for hosts that cannot do it in HW
Merge pull request flang-compiler/f18#403 from flang-compiler/jpr1

Original-commit: flang-compiler/f18@31125bb081
2019-04-16 01:56:08 -07:00
Jean Perier
d8182b9089 [flang] Remove user warning messages for lack of subnormal HW flushing
Original-commit: flang-compiler/f18@4aecc1bcee
2019-04-15 01:54:35 -07:00
Jean Perier
db57831869 [flang] also fix accessor name
Original-commit: flang-compiler/f18@6ff8d22a57
Tree-same-pre-rewrite: false
2019-04-15 01:18:41 -07:00
Jean Perier
2aad0564cb [flang] address comment. Follow style guideline
Original-commit: flang-compiler/f18@60da44dc7d
Tree-same-pre-rewrite: false
2019-04-15 01:18:40 -07:00
Jean Perier
d1659ca3b4 [flang] removed unused func in tests
Original-commit: flang-compiler/f18@4c6e6ad4d0
Tree-same-pre-rewrite: false
2019-04-15 01:18:40 -07:00
Jean Perier
44e0c5084d [flang] Add software subnormal flusing around host library call for host arch that do not support it
Original-commit: flang-compiler/f18@04555f5359
Tree-same-pre-rewrite: false
2019-04-15 01:18:40 -07:00
Jean Perier
48daa0f9a9 [flang] make host subnormal flsuhing control test runtime independent
Original-commit: flang-compiler/f18@96b25596a7
Tree-same-pre-rewrite: false
2019-04-15 01:18:39 -07:00
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