Commit graph

2042 commits

Author SHA1 Message Date
peter klausler 15f38e2d67 [flang] Use component iterators in check-call.cc
Original-commit: flang-compiler/f18@e78db8907f
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
2019-10-17 15:29:26 -07:00
peter klausler 5f8817bdac [flang] Address remaining initial comments
Original-commit: flang-compiler/f18@acd307c91f
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
2019-10-17 12:10:33 -07:00
peter klausler db4ae5cd98 [flang] Address most review comments
Original-commit: flang-compiler/f18@43720b5057
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
2019-10-17 10:57:01 -07:00
peter klausler ca9d6be0e4 [flang] Pad short CHARACTER actual arguments
Original-commit: flang-compiler/f18@b9c890ca9c
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
2019-10-16 15:36:54 -07:00
peter klausler 4abdc30b63 [flang] Revert to returning default INTEGER for LEN() and offset-in-CHARACTER intrinsics; further shape analysis of intrinsic results
Original-commit: flang-compiler/f18@561f5965b2
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
2019-10-16 11:53:03 -07:00
peter klausler f090eb878e [flang] Better shape analysis for CSHIFT, EOSHIFT, SPREAD
Original-commit: flang-compiler/f18@eb43df85a6
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
2019-10-16 10:35:34 -07:00
peter klausler 3a4091b5e3 [flang] Fix some bugs exposed by testing new checks
Original-commit: flang-compiler/f18@9cc70dcad6
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
2019-10-16 09:39:37 -07:00
peter klausler 4c37c06597 [flang] rebase
Original-commit: flang-compiler/f18@2691da3836
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
2019-10-11 15:41:11 -07:00
peter klausler b8d4f79d59 [flang] pass call03
Original-commit: flang-compiler/f18@8c076bd89b
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
2019-10-10 16:36:47 -07:00
peter klausler d022fc1cca [flang] definability tests
Original-commit: flang-compiler/f18@4b71f003a9
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
2019-10-10 16:33:25 -07:00
peter klausler f29394589e [flang] Move call semantic checking into lib/semantics
Original-commit: flang-compiler/f18@7996c85cf3
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
2019-10-10 16:23:07 -07:00
peter klausler b71355ca1e [flang] checkpoint
checkpoint

checkpoint

Original-commit: flang-compiler/f18@99d12a7215
Reviewed-on: https://github.com/flang-compiler/f18/pull/782
Tree-same-pre-rewrite: false
2019-10-10 16:09:57 -07:00
Tim Keith 6acae749c8 [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@50e458045a
Reviewed-on: https://github.com/flang-compiler/f18/pull/778
2019-10-10 11:46:26 -07:00
peter klausler b32a435b0b [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@3cca775da9
Reviewed-on: https://github.com/flang-compiler/f18/pull/776
2019-10-07 11:01:46 -07:00
peter klausler d6c8bd805f [flang] Import preprocessing tests
Original-commit: flang-compiler/f18@7ef7029604
Reviewed-on: https://github.com/flang-compiler/f18/pull/777
2019-10-04 15:21:31 -07:00
peter klausler 78d33b600e [flang] Fix flang-compiler/f18#773
Original-commit: flang-compiler/f18@d12d1129b7
Reviewed-on: https://github.com/flang-compiler/f18/pull/775
2019-10-02 15:42:07 -07:00
peter klausler 9b37989e05 [flang] Final tweaks
Original-commit: flang-compiler/f18@6e269b4e29
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
2019-10-02 16:52:27 -07:00
peter klausler 07d48c0a23 [flang] Extend documentation
Original-commit: flang-compiler/f18@7e11f8165f
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
Tree-same-pre-rewrite: false
2019-10-02 16:30:36 -07:00
peter klausler e88bf15d2a [flang] Dodge weird clang-format behavior
Original-commit: flang-compiler/f18@48b81a2dd9
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
Tree-same-pre-rewrite: false
2019-10-02 16:14:01 -07:00
peter klausler 4ee37ac356 [flang] Address review comments
Original-commit: flang-compiler/f18@b2a0503614
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
Tree-same-pre-rewrite: false
2019-10-02 15:48:20 -07:00
peter klausler 5c35f3288a [flang] Retain no-op default: cases when compiling with gcc
Original-commit: flang-compiler/f18@8ebfd8d2e9
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
Tree-same-pre-rewrite: false
2019-10-02 14:24:44 -07:00
peter klausler 637b933202 [flang] Enable more warnings, clean them up
Original-commit: flang-compiler/f18@c6b3420e5f
Reviewed-on: https://github.com/flang-compiler/f18/pull/774
Tree-same-pre-rewrite: false
2019-10-02 12:40:52 -07:00
David Truby e401082289 [flang] Removed stray comma in unparse for dist_schedule clause
Original-commit: flang-compiler/f18@0b61bc22c2
Reviewed-on: https://github.com/flang-compiler/f18/pull/772
2019-10-03 10:59:17 +01:00
David Truby 9aa80d3353 [flang] Make the second argument to dist_schedule optional.
Original-commit: flang-compiler/f18@7ed2d0e3ec
Reviewed-on: https://github.com/flang-compiler/f18/pull/772
Tree-same-pre-rewrite: false
2019-10-02 16:58:11 +01:00
David Truby 56efc1eca2 [flang] Added basic sema checks for distribute construct
Original-commit: flang-compiler/f18@f23059bf30
Reviewed-on: https://github.com/flang-compiler/f18/pull/771
2019-10-02 16:13:32 +01:00
David Truby 98223835c0 [flang] Added comment about gcc function cast workaround.
Original-commit: flang-compiler/f18@28bc021323
Reviewed-on: https://github.com/flang-compiler/f18/pull/767
2019-10-01 11:15:43 +01:00
David Truby c579118ce6 [flang] Replace access through union with reinterpret_cast.
This avoids undefined behaviour.

Original-commit: flang-compiler/f18@e289bbfa83
Reviewed-on: https://github.com/flang-compiler/f18/pull/767
Tree-same-pre-rewrite: false
2019-09-30 12:41:34 +01:00
Eric Schweitz 7d1696b3ad [flang] add initial Burnside bridge code
Original-commit: flang-compiler/f18@0d387d1468
Reviewed-on: https://github.com/flang-compiler/f18/pull/720
2019-10-02 10:54:12 -07:00
Pete Steinfeld 855f817d9d [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@c16b883db3
Reviewed-on: https://github.com/flang-compiler/f18/pull/769
2019-10-01 13:03:40 -07:00
David Truby e0c15c4952 [flang] Added grammar comments for enter data and exit data directives
Original-commit: flang-compiler/f18@a1e6cded2f
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
2019-09-27 13:57:51 +01:00
David Truby 5776003259 [flang] Corrected check for required OpenMP clauses
Original-commit: flang-compiler/f18@ce3ec50c3f
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
Tree-same-pre-rewrite: false
2019-09-27 13:57:51 +01:00
David Truby 7c09d48218 [flang] Corrections for map semantics to match coding style
Original-commit: flang-compiler/f18@f2d97c3a1e
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
Tree-same-pre-rewrite: false
2019-09-27 13:57:51 +01:00
David Truby d3e8c76f67 [flang] Added semantic checks for map clauses
Original-commit: flang-compiler/f18@75b6228388
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
Tree-same-pre-rewrite: false
2019-09-27 13:57:51 +01:00
Eric Schweitz 5c8c0716b4 [flang] sync latest changes to these files
Original-commit: flang-compiler/f18@97becf30fa
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
2019-09-26 13:08:27 -07:00
Eric Schweitz cca3c31176 [flang] latest changes
Original-commit: flang-compiler/f18@c4278fe1aa
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-09-17 14:23:20 -07:00
Eric Schweitz 6bff59ec6b [flang] add FIROps.h
Original-commit: flang-compiler/f18@e53fefb66c
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-09-10 08:25:34 -07:00
Eric Schweitz d6bfd9135c [flang] fix name of argument
Original-commit: flang-compiler/f18@ad50545941
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-09-09 16:05:02 -07:00
Eric Schweitz 27e80ffd73 [flang] add attributes
Original-commit: flang-compiler/f18@d35f55b0d5
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-09-06 16:15:37 -07:00
Eric Schweitz 717cdbd4ac [flang] more cleanup
Original-commit: flang-compiler/f18@23fdcf77d0
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-09-06 13:37:14 -07:00
Eric Schweitz 38301e7fa0 [flang] changes per review comments
Original-commit: flang-compiler/f18@eb34e2d47b
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-09-06 13:25:42 -07:00
Eric Schweitz deef31dc7c [flang] add fir types header
Original-commit: flang-compiler/f18@4dc278b271
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-08-28 13:53:50 -07:00
peter klausler 6e7ed4fb4d [flang] Fix flang-compiler/f18#765
Original-commit: flang-compiler/f18@bb2ffac717
Reviewed-on: https://github.com/flang-compiler/f18/pull/766
2019-09-27 14:08:09 -07:00
Pete Steinfeld c3f05ac421 [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@9cc6f5bd40
Reviewed-on: https://github.com/flang-compiler/f18/pull/764
2019-09-26 13:33:48 -07:00
Tim Keith a3d2966637 [flang] Fix clang build on MacOS
clang doesn't consider `std::strlen` of a constant to be a constexpr,
so just replace with the actual length.

Original-commit: flang-compiler/f18@738deab465
Reviewed-on: https://github.com/flang-compiler/f18/pull/761
2019-09-25 15:39:44 -07:00
David Truby 5efbea87cf [flang] Added grammar for teams directive to semantic checks
Original-commit: flang-compiler/f18@1cee26516b
Reviewed-on: https://github.com/flang-compiler/f18/pull/750
2019-09-19 10:02:35 +01:00
David Truby cad44d2e91 [flang] Semantic checks for teams directive
Original-commit: flang-compiler/f18@ec22e9c4c2
Reviewed-on: https://github.com/flang-compiler/f18/pull/750
Tree-same-pre-rewrite: false
2019-09-17 12:08:04 +01:00
Steve Scalpone fdb58597e8 [flang] Update C++style.md
Original-commit: flang-compiler/f18@d453fdda31
Reviewed-on: https://github.com/flang-compiler/f18/pull/751
2019-09-17 17:07:06 -07:00
Steve Scalpone 3a25e25bd7 [flang] Update C++style.md
Add guidelines for error messages and commas.  Add a version number for clang-format. Add spaces before ### sections to restart numbering.

Original-commit: flang-compiler/f18@3e8db49f34
Reviewed-on: https://github.com/flang-compiler/f18/pull/751
Tree-same-pre-rewrite: false
2019-09-17 12:31:37 -07:00
Tim Keith 3ef61ec226 [flang] Fix tests that use the same .mod file
The tests run by `test_any.sh` don't redirect their .mod files to
a different directory so they occasionally fail when the same file
is accessed by different tests at the same time. With locking of
module files implemented, this problem reproduces much more reliably

Work around it by changing the module names to be distinct. Also remove
some comments left over when copied from `test_symbols.sh` tests.

Original-commit: flang-compiler/f18@f7b5c5f0fc
Reviewed-on: https://github.com/flang-compiler/f18/pull/758
2019-09-25 14:55:40 -07:00
Tim Keith 73c630a4ea [flang] Improve module file reading and writing
Fix problems with writing a mod file while another compilation is
reading or writing. Write to a temp and then rename it:
- compute the new contents of the .mod file
- if it already exists, check if it is already correct
- if not, write new contents to a temp file
- rename the temp to the final destination

`mkstemps()` seems to be the best way to create the temp file.
It returns a file descriptor, so change the rest of the mod file
writing to use POSIX open/read/write/close. This seems to set
errno more reliably too.

There is some extra work around creating the temp to make it have
the same directory and suffix as the final file (so that if one gets
left behind by a crash, "rm *.mod" still cleans it up).
`mkstemps()` creates file with 0600 permissions so try to change it
to what it would have been if we just wrote the file.

Change module file reading to only read the file once; we used to
read it to verify the checksum and then again to parse it.
Instead, change `Parsing` so that we can get the file contents
after `Prescan()` and use that to verify the checksum. Also, it has
a mechanism for searching directories for files, so make use of that
instead of duplicating that functionality in `ModFileReader`.
This requires some changes to how errors are returned so they can
be reported in the right place.

Original-commit: flang-compiler/f18@d0d54971a5
Reviewed-on: https://github.com/flang-compiler/f18/pull/758
Tree-same-pre-rewrite: false
2019-09-25 14:55:40 -07:00