Commit graph

1987 commits

Author SHA1 Message Date
peter klausler
737fe29f2b [flang] Fix regressions from testing pass
Original-commit: flang-compiler/f18@70ea3b4b09
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:20:55 -07:00
peter klausler
7d33b8529a [flang] Refine implicit typing of functions and prevent invalid conversion to objects
Original-commit: flang-compiler/f18@a90f752c20
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:20:46 -07:00
peter klausler
6c5487dfca [flang] Fix bad visitor type
Original-commit: flang-compiler/f18@968b24c033
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:55 -07:00
peter klausler
ad668e1a8b [flang] Fix regression in constant array sections
Original-commit: flang-compiler/f18@595be8defa
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:52 -07:00
peter klausler
e012a13a0d [flang] Make unparsing of typed Exprs conditional when unparsing to pgf90
Original-commit: flang-compiler/f18@3b79c290cd
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:50 -07:00
peter klausler
ba780030c7 [flang] Fix function call implicit typing after recent merge
Original-commit: flang-compiler/f18@f91779c79a
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:49 -07:00
peter klausler
00e128e42a [flang] Refactor SymbolOrComponent typedef to NamedEntity class
Original-commit: flang-compiler/f18@e8ec4b88bd
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:47 -07:00
peter klausler
b5fa75763e [flang] work around bad module file output for visibility attrs on subprograms
Original-commit: flang-compiler/f18@0970cccc4e
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:47 -07:00
peter klausler
98e3113206 [flang] Better initialization support
Original-commit: flang-compiler/f18@ff2f26fe7b
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:46 -07:00
peter klausler
d7eb8c441f [flang] Support lower bounds in constants
Original-commit: flang-compiler/f18@d5269cd5a2
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:46 -07:00
peter klausler
b079ed65a3 [flang] Back out bad commit of f18 module files
Original-commit: flang-compiler/f18@230117c437
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:45 -07:00
peter klausler
f7c34914de [flang] Add LOGICAL8, &c.
Original-commit: flang-compiler/f18@fd8df8cd8f
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:44 -07:00
peter klausler
c2b743122a [flang] GetBaseObject()
Original-commit: flang-compiler/f18@38eced54de
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:44 -07:00
peter klausler
f01537b146 [flang] IsInitialDataTarget()
Original-commit: flang-compiler/f18@c005e14de9
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:43 -07:00
peter klausler
56a1941f7f [flang] More extension names
Original-commit: flang-compiler/f18@f30d4cf73d
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:43 -07:00
peter klausler
b6eb421e13 [flang] Fix pointer initializer
Original-commit: flang-compiler/f18@4b2af83a75
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:42 -07:00
peter klausler
a53b11c92d [flang] Support anonymous parent components in struct const
Original-commit: flang-compiler/f18@b28b9932b7
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:41 -07:00
peter klausler
c4f0ea5a14 [flang] Pass PGF90 options on only if underlying compiler is PGF90
Original-commit: flang-compiler/f18@dc34f75b07
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:40 -07:00
peter klausler
33c397308c [flang] Remove unused PRIVATE name
Original-commit: flang-compiler/f18@829b8ca873
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:39 -07:00
peter klausler
a0e5052d1b [flang] Add DOUBLE COMPLEX intrinsics & ASSOCIATED
Original-commit: flang-compiler/f18@fbcc2c0b5d
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:38 -07:00
psteinfeld
bd3033574f [flang] Merge pull request flang-compiler/f18#533 from flang-compiler/ps-c1124
Fixes for DO constraint C1124

Original-commit: flang-compiler/f18@00d74be74c
Reviewed-on: https://github.com/flang-compiler/f18/pull/533
2019-06-27 15:21:39 -07:00
Peter Steinfeld
ff2c862e07 [flang] Fixed the formatting of an "if" statement.
Original-commit: flang-compiler/f18@0cf7114452
Reviewed-on: https://github.com/flang-compiler/f18/pull/533
2019-06-27 15:18:36 -07:00
Peter Steinfeld
aafeb34962 [flang] Fixes for DO constraint C1124
The constraint says that a variable-name in a locality-spec shall be the name
of a variable in the innermost executable construct or scoping unit that
includes the DO CONCURRENT statement.  This check was already being made in
resolve-names.cc for LOCAL and LOCAL_INIT locality specs but not for the
SHARED locality spec.  Also, there was some code in check-do.cc that was
intended to be used to enforce this constraint at some time in the future.

I added code to resolve-names.cc to extend the checking to the SHARED locality
spec and removed the unused code from check-do.cc.  I also extended the
existing tests in resolve35.f90 to exercise the new code.

Original-commit: flang-compiler/f18@b421923d94
Reviewed-on: https://github.com/flang-compiler/f18/pull/533
Tree-same-pre-rewrite: false
2019-06-27 12:33:36 -07:00
Peter Klausler
4711129fcc [flang] Merge pull request flang-compiler/f18#532 from peterwaller-arm/fix-gcc-7-build
Revert "Remove needless braces"

Original-commit: flang-compiler/f18@c1c0a64582
Reviewed-on: https://github.com/flang-compiler/f18/pull/532
2019-06-27 09:56:58 -07:00
Peter Waller
c9944df916 [flang] Revert "Remove needless braces"
This reverts commit edd18355be574122aaa9abf58c15d8c50fb085a1.

Original-commit: flang-compiler/f18@e5d164fd11
Reviewed-on: https://github.com/flang-compiler/f18/pull/532
2019-06-26 09:44:08 +00:00
vdonaldson
6b688f9473 [flang] Remove unnecessary semicolons to avoid gcc warnings. (flang-compiler/f18#529)
Original-commit: flang-compiler/f18@bdba836254
Reviewed-on: https://github.com/flang-compiler/f18/pull/529
2019-06-26 15:50:10 -07:00
vdonaldson
3b14129337 [flang] Initialize PRINT semantics. Fixes flang-compiler/f18#516 (flang-compiler/f18#528)
There are no Clause 12 constraints to check for PRINT, but PRINT does share
FMT specifier processing with READ and WRITE.  To avoid interactions between
these I/O statements, reset IoChecker values for PRINT.

Original-commit: flang-compiler/f18@6a54766718
Reviewed-on: https://github.com/flang-compiler/f18/pull/528
2019-06-26 15:46:48 -07:00
Steve Scalpone
6e9658daab [flang] Merge pull request flang-compiler/f18#526 from flang-compiler/sjs-build-predef-modfiles
Compile and install the predefined module files.

Original-commit: flang-compiler/f18@c9b23dc706
Reviewed-on: https://github.com/flang-compiler/f18/pull/526
2019-06-26 15:46:04 -07:00
Steve Scalpone
93c63ed8c2 [flang] Compile and install the predefined module files.
Change the CMakeFile.txt in tools/f18 to build the predefined modules with the just-built compiler. The mod files are created in the new "include" subdirectory of the binary target directory.  The mod files are installed to ${CMAKE_INSTALL_PREFIX}/include.

The f18 driver is already installed in ${CMAKE_INSTALL_PREFIX}/bin.  This change change the location of the f18 binary build to a sibling directory of "include" called "bin" instead of at the top level of the binary destination directory. This change is in anticipation of changing the driver to find the include directory using a path relative to the location of f18.

Update the test scripts to find f18 in the bin subdirectory.

Remove the simple predefined module tests from test/semantics because they are compiled as part of the build and don't need to be recompiled as part of a test.

Original-commit: flang-compiler/f18@7811ccecdc
Reviewed-on: https://github.com/flang-compiler/f18/pull/526
2019-06-25 09:57:38 -07:00
Jinxin (Brian) Yang
125f295353 [flang] OpenMP structural check framework (PARALLEL as example) (flang-compiler/f18#493)
This patch is to show the framework to do OpenMP structure related check and you may find missing/incomplete implementation, which will be added in the future.

1. Each encountering construct has its own context and the context info will be filled while walking the directive/clause nodes. In the `Leave`, the current OpenMP context will be popped out.

2. When entering the construct, necessary nesting check will be performed. Use std::vector to implement the context stack because certain nesting restrictions may need to trace back more than one level.

3. PARALLEL construct is used as an example for clause validity check.

4. `EnumSet` is used to represent the directive/clause sets and to show the error msg. All the error msgs are quoted from the specification.

5. Necessary `CharBlock` is added for error msgs.

Original-commit: flang-compiler/f18@620441c03e
Reviewed-on: https://github.com/flang-compiler/f18/pull/493
2019-06-25 16:18:51 -07:00
vdonaldson
69f5f13738 [flang] Clause 13 (Input/output editing) syntax and semantic checking (flang-compiler/f18#498)
* Clause 13 (Input/output editing) syntax and semantic checking

Diagnose:
 - all clause syntax errors (independent of normal parsing)
 - all clause constraints
 - use of non-standard extensions under -Mstandard
 - obvious program requirement violations

The code:
 - is invoked for both format statement and I/O statement constant formats
 - should be useable by the runtime I/O library for runtime formats
 - is able to recover from errors
 - is able to diagnose multiple errors in a single format
 - has accurate markers for errors
 - can process (fixed character size) Hollerith strings
 - generates reasonable error messages for known error scenarios
 - should not require C++ run-time library support

The code is templatized for use with fixed size character kind={1,2,4} input,
but only the kind=1 variant is actually exercised.

* Review update.

* Review update.

* Review update.

* Improve error processing of unterminated formats.

Original-commit: flang-compiler/f18@c04b7518df
Reviewed-on: https://github.com/flang-compiler/f18/pull/498
2019-06-25 15:59:30 -07:00
Tim Keith
a0b0bb43ed [flang] Merge pull request flang-compiler/f18#521 from flang-compiler/tsk2
Check constraints on passed-object dummy argument

Original-commit: flang-compiler/f18@d1d9f6eb78
Reviewed-on: https://github.com/flang-compiler/f18/pull/521
2019-06-25 14:41:53 -07:00
Tim Keith
fe899298d0 [flang] Check constraints on passed-object dummy argument
The passed-object dummy argument cannot be checked until the
interfaces of contained subprograms are known. To accomplish this,
add `FinishSpecificationPart` pass to run after all specification
parts have been analyzed but before any of the execution parts.
This visits all derived types defined in each scope and performs
the checks on each procedure component and procedure binding.

Add a flag to `ParamValue` to distinguish kind from len parameters.

Fix some tests that had errors we now detect.

Original-commit: flang-compiler/f18@4789643c5b
Reviewed-on: https://github.com/flang-compiler/f18/pull/521
2019-06-23 10:59:32 -07:00
Tim Keith
432e62b417 [flang] Add passArg to ProcEntityDetails and ProcBindingDetails
Add `passArg` to `ProcEntityDetails` and `ProcBindingDetails`.
The is the symbols that represents the passed-object dummy argument,
or nullptr if none.

As both of these classes need `passName` and `passArg`, create a mixin
class, `WithPassArg` for the shared content.

Change passName_ from optional to pointer because that makes it a little
easier to work with and there is no need to have a copy of the name.

Original-commit: flang-compiler/f18@1cdd1a5b87
Reviewed-on: https://github.com/flang-compiler/f18/pull/521
Tree-same-pre-rewrite: false
2019-06-22 18:53:16 -07:00
Tim Keith
9a98616dbb [flang] Add AsFortran() for types
Add an `AsFortran()` member function to `DeclTypeSpec` and related
classes to convert types to a Fortran representation. This allows
error messages to mention types. It also fixes `.mod` file writing
where it previous used `operator<<` to convert types to Fortran.

Original-commit: flang-compiler/f18@eb16f8b5dd
Reviewed-on: https://github.com/flang-compiler/f18/pull/521
Tree-same-pre-rewrite: false
2019-06-22 18:14:14 -07:00
Tim Keith
377914d8b3 [flang] Add IsIsoCType()
It identifies the types `C_PTR` and `C_FUNPTR` from predefined
module `ISO_C_BINDING`.

Original-commit: flang-compiler/f18@fcbef2e18b
Reviewed-on: https://github.com/flang-compiler/f18/pull/521
Tree-same-pre-rewrite: false
2019-06-21 17:32:11 -07:00
psteinfeld
83fa5b0532 [flang] Merge pull request flang-compiler/f18#513 from flang-compiler/ps-c1127
Test for constraint C1127

Original-commit: flang-compiler/f18@fbde2dd26d
Reviewed-on: https://github.com/flang-compiler/f18/pull/513
2019-06-25 09:45:07 -07:00
Peter Steinfeld
21d1e7131d [flang] Downgrading the semantics check for C1127 to a warning.
This check to see if there are two DEFAULT (NONE) clauses in a DO CONCURRENT
header.

Original-commit: flang-compiler/f18@9b234125fa
Reviewed-on: https://github.com/flang-compiler/f18/pull/513
2019-06-24 13:09:21 -07:00
Peter Steinfeld
db1ba910c5 [flang] Test for constraint C1127
The DEFAULT ( NONE ) locality-spec shall not appear more than once in a given
concurrent-locality.

Original-commit: flang-compiler/f18@fcca28ef3c
Reviewed-on: https://github.com/flang-compiler/f18/pull/513
Tree-same-pre-rewrite: false
2019-06-24 13:09:21 -07:00
Tim Keith
cf1789e602 [flang] Merge pull request flang-compiler/f18#524 from flang-compiler/tsk1
Fix internal error due to missing type

Original-commit: flang-compiler/f18@72f88d1729
Reviewed-on: https://github.com/flang-compiler/f18/pull/524
2019-06-24 16:34:28 -07:00
Tim Keith
facd7147f4 [flang] Fix internal error due to missing type
If a name is declared in a module with just `private :: x`,
we don't know if `x` is supposed to be an object or procedure,
so it ends up not getting an implicit type. This leads to an
internal error when writing the `.mod` file.

The fix requires two changes:
1. Cause all `EntityDetails` to be converted to `ObjectEntityDetails`
   in `ResolveSpecificationParts`. This is done by calling `PopScope()`.
   The reason for not calling it there no longer applies since the
   addition of the `ExecutionPartSkimmer` pass.
2. In the same place, apply the implicit typing rules to every entity
   in the scope.

Fixes flang-compiler/f18#514, fixes flang-compiler/f18#520.

Original-commit: flang-compiler/f18@7e4185e9ff
Reviewed-on: https://github.com/flang-compiler/f18/pull/524
2019-06-24 15:22:57 -07:00
Eric Schweitz
acd1cab2d4 [flang] Merge pull request flang-compiler/f18#507 from schweitzpgi/master
Add the FIR dialect of MLIR document

Original-commit: flang-compiler/f18@49d09f84ed
Reviewed-on: https://github.com/flang-compiler/f18/pull/507
2019-06-24 13:18:27 -07:00
Eric Schweitz
1a66379de4 [flang] address review comments
add words on what is meant by meta information

Original-commit: flang-compiler/f18@ee2f3acf3c
Reviewed-on: https://github.com/flang-compiler/f18/pull/507
2019-06-20 10:58:08 -07:00
Eric Schweitz
20984efc71 [flang] Add the FIR dialect of MLIR document
Original-commit: flang-compiler/f18@10ab8b42b3
Reviewed-on: https://github.com/flang-compiler/f18/pull/507
Tree-same-pre-rewrite: false
2019-06-19 14:11:32 -07:00
Tim Keith
9e58499492 [flang] Merge pull request flang-compiler/f18#523 from flang-compiler/tsk0
Fix bug in writing PRIVATE subprograms to .mod file

Original-commit: flang-compiler/f18@ad443e2439
Reviewed-on: https://github.com/flang-compiler/f18/pull/523
2019-06-24 13:08:24 -07:00
Tim Keith
86132a15dc [flang] Fix bug in writing PRIVATE subprograms to .mod file
Subprograms can't have the PRIVATE prefix on them when they are defined.
So if they are private, add a private-stmt for them.

Fixes flang-compiler/f18#519

Original-commit: flang-compiler/f18@d3670aa176
Reviewed-on: https://github.com/flang-compiler/f18/pull/523
2019-06-24 12:35:17 -07:00
Steve Scalpone
ba7731ec6b [flang] Merge pull request flang-compiler/f18#522 from flang-compiler/sjs-predef-mod-test
Add a set of tests which compile the predefined module files.

Original-commit: flang-compiler/f18@e50fb71914
Reviewed-on: https://github.com/flang-compiler/f18/pull/522
2019-06-24 09:58:11 -07:00
Steve Scalpone
e73c886bdf [flang] Port to macOS, where mktemp doesn't have -p.
Original-commit: flang-compiler/f18@bd698aee68
Reviewed-on: https://github.com/flang-compiler/f18/pull/522
2019-06-23 17:14:19 -07:00
Steve Scalpone
10ad02ff2d [flang] Add a set of tests which compile the predefined module files. Each test simply tries to compile the module source file. Modify the script test_errors.sh to work with a source file that is specified as a full path. Also, change how the test temp directory is created to use a random name in case any of the source file base names are duplicated.
Original-commit: flang-compiler/f18@ec048ab1d5
Reviewed-on: https://github.com/flang-compiler/f18/pull/522
Tree-same-pre-rewrite: false
2019-06-23 13:30:23 -07:00
psteinfeld
11493f3123 [flang] Merge pull request flang-compiler/f18#510 from flang-compiler/ps-do-msg
Changes to improve messages for DO semantics

Original-commit: flang-compiler/f18@b89993ac7d
Reviewed-on: https://github.com/flang-compiler/f18/pull/510
2019-06-20 20:07:58 -07:00