platform/upstream/llvm.git
5 years ago[flang] Use enums instead of magic int values
peter klausler [Tue, 2 Jul 2019 16:16:08 +0000 (09:16 -0700)]
[flang] Use enums instead of magic int values

Original-commit: flang-compiler/f18@238f84c2fbe65ac03efc748cf31f6f96b6fc4561
Reviewed-on: https://github.com/flang-compiler/f18/pull/538

5 years ago[flang] Use LOC() in iso_c_binding for C_LOC and C_FUNLOC
peter klausler [Mon, 1 Jul 2019 23:54:53 +0000 (16:54 -0700)]
[flang] Use LOC() in iso_c_binding for C_LOC and C_FUNLOC

Original-commit: flang-compiler/f18@da02305d1baed2e4862568e00810495e7d5dd65b
Reviewed-on: https://github.com/flang-compiler/f18/pull/538
Tree-same-pre-rewrite: false

5 years ago[flang] clean up for review
peter klausler [Mon, 1 Jul 2019 20:54:34 +0000 (13:54 -0700)]
[flang] clean up for review

Original-commit: flang-compiler/f18@9bf94ea39c33be8136ee0c0dd832e382bcd76907
Reviewed-on: https://github.com/flang-compiler/f18/pull/538
Tree-same-pre-rewrite: false

5 years ago[flang] Add LOC()/%LOC() intrinsics
peter klausler [Mon, 1 Jul 2019 20:22:22 +0000 (13:22 -0700)]
[flang] Add LOC()/%LOC() intrinsics

Original-commit: flang-compiler/f18@3a6b90c9f5c1a21a40323e56e2c26f6161d2f79c
Reviewed-on: https://github.com/flang-compiler/f18/pull/538
Tree-same-pre-rewrite: false

5 years ago[flang] Structural checks for DO construct (flang-compiler/f18#536)
Jinxin (Brian) Yang [Mon, 1 Jul 2019 20:55:06 +0000 (13:55 -0700)]
[flang] Structural checks for DO construct (flang-compiler/f18#536)

Most restrictions in 2.7.1 Loop construct, nesting checks are still on TODO list.

seenClauses (EnumSet) is dropped. A multimap clauseInfo is added to save the encountering clause and its parser tree node pointer (parser::OmpClause) and to do the checks after walking through all the clauses.

Original-commit: flang-compiler/f18@f79735768265ace3dcd2a5e1f7fbe4d770c379f6
Reviewed-on: https://github.com/flang-compiler/f18/pull/536

5 years ago[flang] Merge pull request flang-compiler/f18#537 from schweitzpgi/master
Eric Schweitz [Mon, 1 Jul 2019 16:35:03 +0000 (09:35 -0700)]
[flang] Merge pull request flang-compiler/f18#537 from schweitzpgi/master

Fix a typo in Extract_Value description.

Original-commit: flang-compiler/f18@b0b88d905c274b9d9553e59dd68666dda74f30f2
Reviewed-on: https://github.com/flang-compiler/f18/pull/537

5 years ago[flang] Fix a typo in Extract_Value description.
Eric Schweitz [Mon, 1 Jul 2019 16:10:49 +0000 (09:10 -0700)]
[flang] Fix a typo in Extract_Value description.

Original-commit: flang-compiler/f18@873a6678da233108621824fc9d354eb27cbe7982
Reviewed-on: https://github.com/flang-compiler/f18/pull/537

5 years ago[flang] Merge pull request flang-compiler/f18#535 from flang-compiler/pmk-no-nchar
Peter Klausler [Fri, 28 Jun 2019 21:02:44 +0000 (14:02 -0700)]
[flang] Merge pull request flang-compiler/f18#535 from flang-compiler/pmk-no-nchar

Extirpate NCHARACTER type, NC"" literals, and EUC-JP Hollerith

Original-commit: flang-compiler/f18@62b19842bc2352917baf71443604357e78a99b9f
Reviewed-on: https://github.com/flang-compiler/f18/pull/535

5 years ago[flang] One more
peter klausler [Fri, 28 Jun 2019 18:43:57 +0000 (11:43 -0700)]
[flang] One more

Original-commit: flang-compiler/f18@8d73b44eae3dabdc68d8df5a4a97a8808ec7db25
Reviewed-on: https://github.com/flang-compiler/f18/pull/535

5 years ago[flang] Missed one
peter klausler [Fri, 28 Jun 2019 18:34:15 +0000 (11:34 -0700)]
[flang] Missed one

Original-commit: flang-compiler/f18@e84f4b9c7a5e76c2403539ee210cca1b98873605
Reviewed-on: https://github.com/flang-compiler/f18/pull/535
Tree-same-pre-rewrite: false

5 years ago[flang] Extirpate NCHARACTER type, NC"" literals, and EUC-JP Hollerith
peter klausler [Fri, 28 Jun 2019 18:16:37 +0000 (11:16 -0700)]
[flang] Extirpate NCHARACTER type, NC"" literals, and EUC-JP Hollerith

Original-commit: flang-compiler/f18@10a592a591c8e4f66f32e586597c19dd343914b9
Reviewed-on: https://github.com/flang-compiler/f18/pull/535
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#531 from flang-compiler/pmk-more-fixes
Peter Klausler [Fri, 28 Jun 2019 17:36:47 +0000 (10:36 -0700)]
[flang] Merge pull request flang-compiler/f18#531 from flang-compiler/pmk-more-fixes

Roll up more minor features & fixes to semantics for bugs found by regression testing

Original-commit: flang-compiler/f18@96a7932dab8247099d20e5e46bf9377666e424bd
Reviewed-on: https://github.com/flang-compiler/f18/pull/531

5 years ago[flang] Better error reporting, with test
peter klausler [Fri, 28 Jun 2019 00:16:29 +0000 (17:16 -0700)]
[flang] Better error reporting, with test

Original-commit: flang-compiler/f18@85e8b64d3e86c3b8670790687ff1ea7f0857e41e
Reviewed-on: https://github.com/flang-compiler/f18/pull/531

5 years ago[flang] Formatting fix
peter klausler [Thu, 27 Jun 2019 22:58:23 +0000 (15:58 -0700)]
[flang] Formatting fix

Original-commit: flang-compiler/f18@e158e4f1c6ddf5f51d9637725bce2873d75fb25c
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Work around GCC 7.2.0 build issue
peter klausler [Thu, 27 Jun 2019 22:58:04 +0000 (15:58 -0700)]
[flang] Work around GCC 7.2.0 build issue

Original-commit: flang-compiler/f18@c68349f78fb5228c7c78e30da29de87fdbe43fb8
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] address review comments
peter klausler [Thu, 27 Jun 2019 16:57:48 +0000 (09:57 -0700)]
[flang] address review comments

Original-commit: flang-compiler/f18@f7188a7a3331cce41d3887529b5864a9aab3b190
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] delete two obsolete tests that somehow got committed
peter klausler [Wed, 26 Jun 2019 23:34:41 +0000 (16:34 -0700)]
[flang] delete two obsolete tests that somehow got committed

Original-commit: flang-compiler/f18@8b6a49416ce5557863035fd3eddfb27bb8b0e6e9
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Fix regressions from testing pass
peter klausler [Wed, 26 Jun 2019 22:30:53 +0000 (15:30 -0700)]
[flang] Fix regressions from testing pass

Original-commit: flang-compiler/f18@70ea3b4b09c25be45a41326c78d412dd5eb69d43
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Refine implicit typing of functions and prevent invalid conversion to objects
peter klausler [Wed, 26 Jun 2019 21:51:58 +0000 (14:51 -0700)]
[flang] Refine implicit typing of functions and prevent invalid conversion to objects

Original-commit: flang-compiler/f18@a90f752c2075586f405803ea02877781890d3bde
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Fix bad visitor type
peter klausler [Tue, 25 Jun 2019 23:21:47 +0000 (16:21 -0700)]
[flang] Fix bad visitor type

Original-commit: flang-compiler/f18@968b24c033f625713ee0f8297284a5eaec4cc32e
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Fix regression in constant array sections
peter klausler [Tue, 25 Jun 2019 23:02:36 +0000 (16:02 -0700)]
[flang] Fix regression in constant array sections

Original-commit: flang-compiler/f18@595be8defae9f6dd52811a21f33c4475c65aaed8
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Make unparsing of typed Exprs conditional when unparsing to pgf90
peter klausler [Tue, 25 Jun 2019 22:16:21 +0000 (15:16 -0700)]
[flang] Make unparsing of typed Exprs conditional when unparsing to pgf90

Original-commit: flang-compiler/f18@3b79c290cd4cb5299b931d4b6e051cb677cffab4
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Fix function call implicit typing after recent merge
peter klausler [Tue, 25 Jun 2019 21:46:02 +0000 (14:46 -0700)]
[flang] Fix function call implicit typing after recent merge

Original-commit: flang-compiler/f18@f91779c79a7224da0cc547b33afed19ddfb786f8
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Refactor SymbolOrComponent typedef to NamedEntity class
peter klausler [Tue, 25 Jun 2019 20:07:32 +0000 (13:07 -0700)]
[flang] Refactor SymbolOrComponent typedef to NamedEntity class

Original-commit: flang-compiler/f18@e8ec4b88bd6084beeae6a0d3037e019bc1d24c6b
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] work around bad module file output for visibility attrs on subprograms
peter klausler [Mon, 24 Jun 2019 17:25:37 +0000 (10:25 -0700)]
[flang] work around bad module file output for visibility attrs on subprograms

Original-commit: flang-compiler/f18@0970cccc4e05f62d2560f2c0f618839734422c82
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Better initialization support
peter klausler [Fri, 21 Jun 2019 23:13:56 +0000 (16:13 -0700)]
[flang] Better initialization support

Original-commit: flang-compiler/f18@ff2f26fe7b708b4ff63a358c079b103a8682dcd6
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Support lower bounds in constants
peter klausler [Fri, 21 Jun 2019 23:13:34 +0000 (16:13 -0700)]
[flang] Support lower bounds in constants

Original-commit: flang-compiler/f18@d5269cd5a2742887788736093c148d8866f7a93e
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Back out bad commit of f18 module files
peter klausler [Fri, 21 Jun 2019 21:11:35 +0000 (14:11 -0700)]
[flang] Back out bad commit of f18 module files

Original-commit: flang-compiler/f18@230117c4376661b3ea44227a4f279dd66eeda894
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Add LOGICAL8, &c.
peter klausler [Fri, 21 Jun 2019 21:10:42 +0000 (14:10 -0700)]
[flang] Add LOGICAL8, &c.

Original-commit: flang-compiler/f18@fd8df8cd8f7503310103bd1d99efea92a41dc053
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] GetBaseObject()
peter klausler [Fri, 21 Jun 2019 21:10:19 +0000 (14:10 -0700)]
[flang] GetBaseObject()

Original-commit: flang-compiler/f18@38eced54de5c5c801004748aeaffe116eb1834e9
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] IsInitialDataTarget()
peter klausler [Fri, 21 Jun 2019 21:09:51 +0000 (14:09 -0700)]
[flang] IsInitialDataTarget()

Original-commit: flang-compiler/f18@c005e14de930b0ca19bb53a61c9a535c5b1abf1a
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] More extension names
peter klausler [Fri, 21 Jun 2019 21:08:52 +0000 (14:08 -0700)]
[flang] More extension names

Original-commit: flang-compiler/f18@f30d4cf73d29d910c13911be7be958ac7a026945
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Fix pointer initializer
peter klausler [Fri, 21 Jun 2019 21:08:07 +0000 (14:08 -0700)]
[flang] Fix pointer initializer

Original-commit: flang-compiler/f18@4b2af83a75ab86c570fa8732dd705a8400fce30a
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Support anonymous parent components in struct const
peter klausler [Fri, 21 Jun 2019 21:07:39 +0000 (14:07 -0700)]
[flang] Support anonymous parent components in struct const

Original-commit: flang-compiler/f18@b28b9932b7704de8e112b6b5ddf76611b2f075f6
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Pass PGF90 options on only if underlying compiler is PGF90
peter klausler [Fri, 21 Jun 2019 21:06:17 +0000 (14:06 -0700)]
[flang] Pass PGF90 options on only if underlying compiler is PGF90

Original-commit: flang-compiler/f18@dc34f75b07cf96bd48d4c6116f9a55b47b5b1079
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Remove unused PRIVATE name
peter klausler [Fri, 21 Jun 2019 21:05:29 +0000 (14:05 -0700)]
[flang] Remove unused PRIVATE name

Original-commit: flang-compiler/f18@829b8ca873c7d372e6e1cf6315249d4a010bdee1
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Add DOUBLE COMPLEX intrinsics & ASSOCIATED
peter klausler [Fri, 21 Jun 2019 21:04:40 +0000 (14:04 -0700)]
[flang] Add DOUBLE COMPLEX intrinsics & ASSOCIATED

Original-commit: flang-compiler/f18@fbcc2c0b5daf10010e2917c27e4ac5be1d470a12
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#533 from flang-compiler/ps-c1124
psteinfeld [Thu, 27 Jun 2019 22:21:39 +0000 (15:21 -0700)]
[flang] Merge pull request flang-compiler/f18#533 from flang-compiler/ps-c1124

Fixes for DO constraint C1124

Original-commit: flang-compiler/f18@00d74be74c7a822f53abe21e2bac89075af325de
Reviewed-on: https://github.com/flang-compiler/f18/pull/533

5 years ago[flang] Fixed the formatting of an "if" statement.
Peter Steinfeld [Thu, 27 Jun 2019 22:18:36 +0000 (15:18 -0700)]
[flang] Fixed the formatting of an "if" statement.

Original-commit: flang-compiler/f18@0cf71144529e9ebd625acc9a64b9318c890b669d
Reviewed-on: https://github.com/flang-compiler/f18/pull/533

5 years ago[flang] Fixes for DO constraint C1124
Peter Steinfeld [Thu, 27 Jun 2019 19:33:36 +0000 (12:33 -0700)]
[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@b421923d9403c3efe320e5ec2b722b88d1fdbd73
Reviewed-on: https://github.com/flang-compiler/f18/pull/533
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#532 from peterwaller-arm/fix-gcc-7...
Peter Klausler [Thu, 27 Jun 2019 16:56:58 +0000 (09:56 -0700)]
[flang] Merge pull request flang-compiler/f18#532 from peterwaller-arm/fix-gcc-7-build

Revert "Remove needless braces"

Original-commit: flang-compiler/f18@c1c0a64582729e9ae1b5a8bb7ca26becdd522eac
Reviewed-on: https://github.com/flang-compiler/f18/pull/532

5 years ago[flang] Revert "Remove needless braces"
Peter Waller [Wed, 26 Jun 2019 09:44:08 +0000 (09:44 +0000)]
[flang] Revert "Remove needless braces"

This reverts commit edd18355be574122aaa9abf58c15d8c50fb085a1.

Original-commit: flang-compiler/f18@e5d164fd112d4f0585d2bbbf5c3d455f688c27e1
Reviewed-on: https://github.com/flang-compiler/f18/pull/532

5 years ago[flang] Remove unnecessary semicolons to avoid gcc warnings. (flang-compiler/f18...
vdonaldson [Wed, 26 Jun 2019 22:50:10 +0000 (15:50 -0700)]
[flang] Remove unnecessary semicolons to avoid gcc warnings. (flang-compiler/f18#529)

Original-commit: flang-compiler/f18@bdba83625417157c6f29605ade74ecbdb6ebff2a
Reviewed-on: https://github.com/flang-compiler/f18/pull/529

5 years ago[flang] Initialize PRINT semantics. Fixes flang-compiler/f18#516 (flang-compiler...
vdonaldson [Wed, 26 Jun 2019 22:46:48 +0000 (15:46 -0700)]
[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@6a547667187e2832c8c162d4ee02835ff4c190b4
Reviewed-on: https://github.com/flang-compiler/f18/pull/528

5 years ago[flang] Merge pull request flang-compiler/f18#526 from flang-compiler/sjs-build-prede...
Steve Scalpone [Wed, 26 Jun 2019 22:46:04 +0000 (15:46 -0700)]
[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@c9b23dc706d6e75a2cb63215cfc72f68d842ddf6
Reviewed-on: https://github.com/flang-compiler/f18/pull/526

5 years ago[flang] Compile and install the predefined module files.
Steve Scalpone [Tue, 25 Jun 2019 16:57:38 +0000 (09:57 -0700)]
[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@7811ccecdc065e7e6eb004c8eaefc245f642aea3
Reviewed-on: https://github.com/flang-compiler/f18/pull/526

5 years ago[flang] OpenMP structural check framework (PARALLEL as example) (flang-compiler/f18...
Jinxin (Brian) Yang [Tue, 25 Jun 2019 23:18:51 +0000 (16:18 -0700)]
[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@620441c03e21ae28aed3864b9581cd6cc1705c65
Reviewed-on: https://github.com/flang-compiler/f18/pull/493

5 years ago[flang] Clause 13 (Input/output editing) syntax and semantic checking (flang-compiler...
vdonaldson [Tue, 25 Jun 2019 22:59:30 +0000 (15:59 -0700)]
[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@c04b7518df75bb516f039065d4edcba87dae8210
Reviewed-on: https://github.com/flang-compiler/f18/pull/498

5 years ago[flang] Merge pull request flang-compiler/f18#521 from flang-compiler/tsk2
Tim Keith [Tue, 25 Jun 2019 21:41:53 +0000 (14:41 -0700)]
[flang] Merge pull request flang-compiler/f18#521 from flang-compiler/tsk2

Check constraints on passed-object dummy argument

Original-commit: flang-compiler/f18@d1d9f6eb78f1776e04d2bcd9027efac9170bde01
Reviewed-on: https://github.com/flang-compiler/f18/pull/521

5 years ago[flang] Check constraints on passed-object dummy argument
Tim Keith [Sun, 23 Jun 2019 17:59:32 +0000 (10:59 -0700)]
[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@4789643c5bdbda8206cc1873bc56735b11953227
Reviewed-on: https://github.com/flang-compiler/f18/pull/521

5 years ago[flang] Add passArg to ProcEntityDetails and ProcBindingDetails
Tim Keith [Sat, 22 Jun 2019 17:00:18 +0000 (10:00 -0700)]
[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@1cdd1a5b87016c5aff0fdc571532c25253b91938
Reviewed-on: https://github.com/flang-compiler/f18/pull/521
Tree-same-pre-rewrite: false

5 years ago[flang] Add AsFortran() for types
Tim Keith [Sat, 22 Jun 2019 17:16:13 +0000 (10:16 -0700)]
[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@eb16f8b5dd1b8c3631690afce03c3b26b26d0f6f
Reviewed-on: https://github.com/flang-compiler/f18/pull/521
Tree-same-pre-rewrite: false

5 years ago[flang] Add IsIsoCType()
Tim Keith [Sat, 22 Jun 2019 00:32:11 +0000 (17:32 -0700)]
[flang] Add IsIsoCType()

It identifies the types `C_PTR` and `C_FUNPTR` from predefined
module `ISO_C_BINDING`.

Original-commit: flang-compiler/f18@fcbef2e18b1b035429cb5b9e5d765bc89c2412ca
Reviewed-on: https://github.com/flang-compiler/f18/pull/521
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#513 from flang-compiler/ps-c1127
psteinfeld [Tue, 25 Jun 2019 16:45:07 +0000 (09:45 -0700)]
[flang] Merge pull request flang-compiler/f18#513 from flang-compiler/ps-c1127

Test for constraint C1127

Original-commit: flang-compiler/f18@fbde2dd26d7f238d2b646c8e1060526c546300b8
Reviewed-on: https://github.com/flang-compiler/f18/pull/513

5 years ago[flang] Downgrading the semantics check for C1127 to a warning.
Peter Steinfeld [Mon, 24 Jun 2019 20:07:00 +0000 (13:07 -0700)]
[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@9b234125fa89b4d0fb6718a81215f04d696bfece
Reviewed-on: https://github.com/flang-compiler/f18/pull/513

5 years ago[flang] Test for constraint C1127
Peter Steinfeld [Fri, 21 Jun 2019 19:41:12 +0000 (12:41 -0700)]
[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@fcca28ef3c842aacd20d994f9fac9574234c19b9
Reviewed-on: https://github.com/flang-compiler/f18/pull/513
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#524 from flang-compiler/tsk1
Tim Keith [Mon, 24 Jun 2019 23:34:28 +0000 (16:34 -0700)]
[flang] Merge pull request flang-compiler/f18#524 from flang-compiler/tsk1

Fix internal error due to missing type

Original-commit: flang-compiler/f18@72f88d17298956e0470f0a4797b5bee43fa84ea7
Reviewed-on: https://github.com/flang-compiler/f18/pull/524

5 years ago[flang] Fix internal error due to missing type
Tim Keith [Mon, 24 Jun 2019 22:22:57 +0000 (15:22 -0700)]
[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@7e4185e9ff34dc02f6299aa16236f3b932b16652
Reviewed-on: https://github.com/flang-compiler/f18/pull/524

5 years ago[flang] Merge pull request flang-compiler/f18#507 from schweitzpgi/master
Eric Schweitz [Mon, 24 Jun 2019 20:18:27 +0000 (13:18 -0700)]
[flang] Merge pull request flang-compiler/f18#507 from schweitzpgi/master

Add the FIR dialect of MLIR document

Original-commit: flang-compiler/f18@49d09f84edd5f3c371888c0a9dcf5433a63364c9
Reviewed-on: https://github.com/flang-compiler/f18/pull/507

5 years ago[flang] address review comments
Eric Schweitz [Thu, 20 Jun 2019 00:37:33 +0000 (17:37 -0700)]
[flang] address review comments
add words on what is meant by meta information

Original-commit: flang-compiler/f18@ee2f3acf3c6ebaa27d8ebb57193ebcb7b8d0130a
Reviewed-on: https://github.com/flang-compiler/f18/pull/507

5 years ago[flang] Add the FIR dialect of MLIR document
Eric Schweitz [Wed, 19 Jun 2019 21:11:32 +0000 (14:11 -0700)]
[flang] Add the FIR dialect of MLIR document

Original-commit: flang-compiler/f18@10ab8b42b3ca76bdae4d5a77884ab58b64af8645
Reviewed-on: https://github.com/flang-compiler/f18/pull/507
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#523 from flang-compiler/tsk0
Tim Keith [Mon, 24 Jun 2019 20:08:24 +0000 (13:08 -0700)]
[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@ad443e243902acb048f728768492cfbdf9034025
Reviewed-on: https://github.com/flang-compiler/f18/pull/523

5 years ago[flang] Fix bug in writing PRIVATE subprograms to .mod file
Tim Keith [Mon, 24 Jun 2019 19:35:17 +0000 (12:35 -0700)]
[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@d3670aa176cbc79a7d26fc927e9d1e1349900756
Reviewed-on: https://github.com/flang-compiler/f18/pull/523

5 years ago[flang] Merge pull request flang-compiler/f18#522 from flang-compiler/sjs-predef...
Steve Scalpone [Mon, 24 Jun 2019 16:58:11 +0000 (09:58 -0700)]
[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@e50fb71914c4e2c3915da7dfa7b1cdfccea1f03f
Reviewed-on: https://github.com/flang-compiler/f18/pull/522

5 years ago[flang] Port to macOS, where mktemp doesn't have -p.
Steve Scalpone [Mon, 24 Jun 2019 00:14:19 +0000 (17:14 -0700)]
[flang] Port to macOS, where mktemp doesn't have -p.

Original-commit: flang-compiler/f18@bd698aee686b2698691d4184daa2d1e28e401c97
Reviewed-on: https://github.com/flang-compiler/f18/pull/522

5 years ago[flang] Add a set of tests which compile the predefined module files. Each test simpl...
Steve Scalpone [Sun, 23 Jun 2019 20:30:23 +0000 (13:30 -0700)]
[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@ec048ab1d528cf6ebc1d45767544201064b8fbe8
Reviewed-on: https://github.com/flang-compiler/f18/pull/522
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#510 from flang-compiler/ps-do-msg
psteinfeld [Fri, 21 Jun 2019 03:07:58 +0000 (20:07 -0700)]
[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@b89993ac7d6a1b2136fdb15bf79fb363376ea8a1
Reviewed-on: https://github.com/flang-compiler/f18/pull/510

5 years ago[flang] Changes to improve messages for DO semantics
Peter Steinfeld [Fri, 21 Jun 2019 00:02:32 +0000 (17:02 -0700)]
[flang] Changes to improve messages for DO semantics

I changed two things in the messages produced for DO semantic checks --
 - I changed the source location to be specific to where conflicting names are
 declared.
 - I added the conflicting names to the message.

Original-commit: flang-compiler/f18@f39f9ceeae3a6471eae2a4e651d39a0921416b1b
Reviewed-on: https://github.com/flang-compiler/f18/pull/510

5 years ago[flang] Merge pull request flang-compiler/f18#509 from flang-compiler/tsk1
Tim Keith [Thu, 20 Jun 2019 23:13:38 +0000 (16:13 -0700)]
[flang] Merge pull request flang-compiler/f18#509 from flang-compiler/tsk1

Fix CHECK failure on undeclared type parameter

Original-commit: flang-compiler/f18@de95ab7ebe5524536fd7430b01916f67dd8b9788
Reviewed-on: https://github.com/flang-compiler/f18/pull/509

5 years ago[flang] Fix CHECK failure on undeclared type parameter
Tim Keith [Thu, 20 Jun 2019 21:23:21 +0000 (14:23 -0700)]
[flang] Fix CHECK failure on undeclared type parameter

In the example below, the compiler gets an internal error when
processing the derived-type-spec for the declaration of `x`.
When the search for type parameter `k` fails it means an error
has already occurred and we should skip that parameter.

```
type :: t(k)
end type
type(t):: x
end
```

Original-commit: flang-compiler/f18@a4bf1922e5f2e4bc4d16a940bbb2367e171eb271
Reviewed-on: https://github.com/flang-compiler/f18/pull/509

5 years ago[flang] Merge pull request flang-compiler/f18#504 from flang-compiler/ps-c1123
psteinfeld [Thu, 20 Jun 2019 19:45:27 +0000 (12:45 -0700)]
[flang] Merge pull request flang-compiler/f18#504 from flang-compiler/ps-c1123

Expressions in a DO CONCURRENT header should not reference names declared in the header

Original-commit: flang-compiler/f18@8587141832ac60b5d54a01d776a6d61eacd6735f
Reviewed-on: https://github.com/flang-compiler/f18/pull/504

5 years ago[flang] Added "const" to a few declarations in response to review comments.
Peter Steinfeld [Thu, 20 Jun 2019 18:45:17 +0000 (11:45 -0700)]
[flang] Added "const" to a few declarations in response to review comments.

Original-commit: flang-compiler/f18@f93045c5237adaea10f597b44a93d6c7b8e4c179
Reviewed-on: https://github.com/flang-compiler/f18/pull/504

5 years ago[flang] These changes are in response to comments on my pull request for C1123.
Peter Steinfeld [Thu, 20 Jun 2019 16:56:59 +0000 (09:56 -0700)]
[flang] These changes are in response to comments on my pull request for C1123.

Here's a summary of the changes:
 - I renamed a function to ResolveControlExpressions for clarity.
 - I changed the interface to the function to ResolveIndexName for clarity.
 - I simplified the code for walking the "step" and scalar mask expressions in
   a DO CONCURRENT control statements to not check for the presence of optional
   expressions.
 - I added "const" to the declaration of a local variable.
 - I removed some spurious comments from the test dosemantics04.f90.
 - I added two new tests to dosemantics04.f90 to verify cases that were not
   covered in my original test implementation.

Original-commit: flang-compiler/f18@fa5827061a4cfdf6a0f8db389202d7657dffdddd
Reviewed-on: https://github.com/flang-compiler/f18/pull/504
Tree-same-pre-rewrite: false

5 years ago[flang] I fixed a problem in C1123. This constraint requires that expressions in...
Peter Steinfeld [Tue, 18 Jun 2019 22:46:51 +0000 (15:46 -0700)]
[flang] I fixed a problem in C1123.  This constraint requires that expressions in a DO
CONCURRENT header not reference names declared in the same header.  To
implement this, I changed the "Pre" function for ConcurrentHeader to walk the
subtree in an order that caused the variables associated with the declared
names to be created before any of the expressions were walked.

I added the test dosemantics04.f90 to test this.

Original-commit: flang-compiler/f18@9f3b55241407649fc848d83c9415fd7d91e3056b
Reviewed-on: https://github.com/flang-compiler/f18/pull/504
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#508 from flang-compiler/pmk-fixes
Peter Klausler [Wed, 19 Jun 2019 23:56:31 +0000 (16:56 -0700)]
[flang] Merge pull request flang-compiler/f18#508 from flang-compiler/pmk-fixes

Fix a couple bugs with SELECT TYPE(p) from regression tests

Original-commit: flang-compiler/f18@0b25c908da5ae194918cc16334338e485bf92946
Reviewed-on: https://github.com/flang-compiler/f18/pull/508

5 years ago[flang] back out -Mstandard
peter klausler [Wed, 19 Jun 2019 23:44:36 +0000 (16:44 -0700)]
[flang] back out -Mstandard

Original-commit: flang-compiler/f18@a040c4bdef1adf0f26be2628865c2b6c2d7a0fb9
Reviewed-on: https://github.com/flang-compiler/f18/pull/508

5 years ago[flang] EQUIVALENCE numeric/character as extension with warning
peter klausler [Wed, 19 Jun 2019 23:34:22 +0000 (16:34 -0700)]
[flang] EQUIVALENCE numeric/character as extension with warning

Original-commit: flang-compiler/f18@0182efb7596614451d581f42ae2683cf9ecd8d77
Reviewed-on: https://github.com/flang-compiler/f18/pull/508
Tree-same-pre-rewrite: false

5 years ago[flang] Fix a couple bugs with SELECT TYPE(p) from regression tests
peter klausler [Wed, 19 Jun 2019 22:04:57 +0000 (15:04 -0700)]
[flang] Fix a couple bugs with SELECT TYPE(p) from regression tests

Original-commit: flang-compiler/f18@7539a01ecd7b73650436b82faa2482b3432327b9
Reviewed-on: https://github.com/flang-compiler/f18/pull/508
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#506 from flang-compiler/tsk2
Tim Keith [Wed, 19 Jun 2019 22:01:14 +0000 (15:01 -0700)]
[flang] Merge pull request flang-compiler/f18#506 from flang-compiler/tsk2

Prevent .mod files from being left by tests

Original-commit: flang-compiler/f18@7810c034c87027a6cdae2b679405c2d462229774
Reviewed-on: https://github.com/flang-compiler/f18/pull/506

5 years ago[flang] Prevent .mod files from being left by tests
Tim Keith [Wed, 19 Jun 2019 20:18:17 +0000 (13:18 -0700)]
[flang] Prevent .mod files from being left by tests

test_symbols.sh and test_folding.sh were running the compiler in the
test directory (e.g. `<build>/test/semantics`). This meant that .mod
files were being left there because they weren't cleaned up.

Change to run the compiler in the temp directory created for each test.
It is deleted at the end so files aren't left behind.

Original-commit: flang-compiler/f18@4f9735ada7b142e7a013bede4a3d258b6620a573
Reviewed-on: https://github.com/flang-compiler/f18/pull/506

5 years ago[flang] Merge pull request flang-compiler/f18#505 from flang-compiler/pmk-not
Peter Klausler [Wed, 19 Jun 2019 20:26:28 +0000 (13:26 -0700)]
[flang] Merge pull request flang-compiler/f18#505 from flang-compiler/pmk-not

Fix a couple things, support ALLOCATED

Original-commit: flang-compiler/f18@175cc5f8f527f3a699fa5a27ee9e896eeb29d7f3
Reviewed-on: https://github.com/flang-compiler/f18/pull/505

5 years ago[flang] Remove extra semicolon
peter klausler [Wed, 19 Jun 2019 19:37:49 +0000 (12:37 -0700)]
[flang] Remove extra semicolon

Original-commit: flang-compiler/f18@c94327b56b311de059d7cdcf26e59eaaec9117c4
Reviewed-on: https://github.com/flang-compiler/f18/pull/505

5 years ago[flang] Fix source provenance of .NOT., add ALLOCATED intrinsic
peter klausler [Wed, 19 Jun 2019 18:50:07 +0000 (11:50 -0700)]
[flang] Fix source provenance of .NOT., add ALLOCATED intrinsic

Original-commit: flang-compiler/f18@e7e0de9e0df189f803d609d123b54d3a65182890
Reviewed-on: https://github.com/flang-compiler/f18/pull/505
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#503 from flang-compiler/pmk-fixes
Peter Klausler [Tue, 18 Jun 2019 23:22:31 +0000 (16:22 -0700)]
[flang] Merge pull request flang-compiler/f18#503 from flang-compiler/pmk-fixes

Fix flang-compiler/f18#499 and flang-compiler/f18#500, enable -fno-exceptions

Original-commit: flang-compiler/f18@7cb2a0af5617f87f97aa5dee5c44616bb503856f
Reviewed-on: https://github.com/flang-compiler/f18/pull/503

5 years ago[flang] Force -fexceptions for real arithmetic tests
peter klausler [Tue, 18 Jun 2019 22:32:20 +0000 (15:32 -0700)]
[flang] Force -fexceptions for real arithmetic tests

Original-commit: flang-compiler/f18@532dd3b6df55af2df334203b3e18e6d9310b821e
Reviewed-on: https://github.com/flang-compiler/f18/pull/503

5 years ago[flang] Rearrange some move(get<>()) calls into get<>(move()) to dodge GCC possibly...
peter klausler [Tue, 18 Jun 2019 22:15:22 +0000 (15:15 -0700)]
[flang] Rearrange some move(get<>()) calls into get<>(move()) to dodge GCC possibly-uninit warnings (bogus)

Original-commit: flang-compiler/f18@f369c6025c593f8a8b2426f2ce03c7ddec9a4ff9
Reviewed-on: https://github.com/flang-compiler/f18/pull/503
Tree-same-pre-rewrite: false

5 years ago[flang] -fno-exceptions
peter klausler [Tue, 18 Jun 2019 21:10:47 +0000 (14:10 -0700)]
[flang] -fno-exceptions

Original-commit: flang-compiler/f18@81d09c2053671b438fdc64b4fe30b6263c6cc5b9
Reviewed-on: https://github.com/flang-compiler/f18/pull/503
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#496 from flang-compiler/pmk-ascii
Peter Klausler [Tue, 18 Jun 2019 21:01:11 +0000 (14:01 -0700)]
[flang] Merge pull request flang-compiler/f18#496 from flang-compiler/pmk-ascii

Support Latin-1 source encodings, generally clean up source character processing

Original-commit: flang-compiler/f18@7a68cf07062c54d2ce8f7f6a15f2dec912b69247
Reviewed-on: https://github.com/flang-compiler/f18/pull/496

5 years ago[flang] Review comments and last (?) bugs
peter klausler [Tue, 18 Jun 2019 20:46:54 +0000 (13:46 -0700)]
[flang] Review comments and last (?) bugs

Original-commit: flang-compiler/f18@db8302e3ab0b837d968e82dc9ac7d6a329c784c2
Reviewed-on: https://github.com/flang-compiler/f18/pull/496

5 years ago[flang] more fixes from tests
peter klausler [Tue, 18 Jun 2019 19:34:23 +0000 (12:34 -0700)]
[flang] more fixes from tests

Original-commit: flang-compiler/f18@bb8df72635beeea3b017ee476a009411a8c59f53
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false

5 years ago[flang] nag debugged
peter klausler [Mon, 17 Jun 2019 23:12:28 +0000 (16:12 -0700)]
[flang] nag debugged

Original-commit: flang-compiler/f18@ab91b7c19156156103b3111393882b4a709295eb
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false

5 years ago[flang] fixes
peter klausler [Mon, 17 Jun 2019 19:29:20 +0000 (12:29 -0700)]
[flang] fixes

Original-commit: flang-compiler/f18@f504e6a938012a9593b434aa63c4c7752a36f2cc
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false

5 years ago[flang] All fixed except for a few NAG differences
peter klausler [Mon, 17 Jun 2019 17:35:34 +0000 (10:35 -0700)]
[flang] All fixed except for a few NAG differences

Original-commit: flang-compiler/f18@8dea4fb7609f09e195e8d70d8351e81ca070d414
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false

5 years ago[flang] More debugging vs. regression tests
peter klausler [Fri, 14 Jun 2019 22:44:32 +0000 (15:44 -0700)]
[flang] More debugging vs. regression tests

Original-commit: flang-compiler/f18@d4fd4ad1eca91336cdd2fb1add93d97ecb303720
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false

5 years ago[flang] Fixes
peter klausler [Thu, 13 Jun 2019 21:16:04 +0000 (14:16 -0700)]
[flang] Fixes

Original-commit: flang-compiler/f18@73edc5bf2ba0b342ec1f4e496faae0eeba6475c0
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false

5 years ago[flang] Character set and encoding changes
peter klausler [Wed, 12 Jun 2019 22:26:37 +0000 (15:26 -0700)]
[flang] Character set and encoding changes

Original-commit: flang-compiler/f18@a550cbd4c0f92a3f88ed230a3bd809dd77ca4b12
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false

5 years ago[flang] Tests pass
peter klausler [Tue, 11 Jun 2019 17:34:58 +0000 (10:34 -0700)]
[flang] Tests pass

Original-commit: flang-compiler/f18@ae9d07a2ab3fa5c59480ed869a9cceacaf90f8af
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false

5 years ago[flang] Merge pull request flang-compiler/f18#502 from flang-compiler/tsk3
Tim Keith [Mon, 17 Jun 2019 20:12:10 +0000 (13:12 -0700)]
[flang] Merge pull request flang-compiler/f18#502 from flang-compiler/tsk3

Handle nested interface blocks

Original-commit: flang-compiler/f18@a3c6c70b990bd52bad4df4a3d3480c85a4e48780
Reviewed-on: https://github.com/flang-compiler/f18/pull/502

5 years ago[flang] Handle nested interface blocks
Tim Keith [Fri, 14 Jun 2019 22:04:13 +0000 (15:04 -0700)]
[flang] Handle nested interface blocks

Interface blocks can be nested if one of the interface bodies
declares a subprogram with a dummy procedure that is specified
by an interface block. See the addition to `modfile07.f90` for
and example.

This didn't work because there was only one copy of each of
`inInterfaceBlock_`, `isAbstract_`, and `genericSymbol_`.
We need these for each active interface block, so replace these
with a stack. A new entry is pushed on the stack when we enter
an `InterfaceStmt` or `GenericStmt` and popped when we leave.

Also in the same example, when declaring the dummy procedure, the
dummy argument is initially an `EntityDetails` but it is replaced
by a `SubprogramDetails` when it is specified by the interface.

Original-commit: flang-compiler/f18@0c468b60b119e132d47803ec8e17b231474ac55c
Reviewed-on: https://github.com/flang-compiler/f18/pull/502

5 years ago[flang] Merge pull request flang-compiler/f18#501 from flang-compiler/by-mp-isdeviceptr
Jinxin (Brian) Yang [Fri, 14 Jun 2019 16:00:02 +0000 (09:00 -0700)]
[flang] Merge pull request flang-compiler/f18#501 from flang-compiler/by-mp-isdeviceptr

Add missing IS_DEVICE_PTR and LINK clauses for OpenMP parsing

Original-commit: flang-compiler/f18@76947faa462b2e0e92404c3027eed6459e1fc867
Reviewed-on: https://github.com/flang-compiler/f18/pull/501