platform/upstream/llvm.git
6 years ago[flang] Always put parens on unparsed ENTRY statement in case there is a suffix.
peter klausler [Mon, 9 Apr 2018 20:45:30 +0000 (13:45 -0700)]
[flang] Always put parens on unparsed ENTRY statement in case there is a suffix.

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

6 years ago[flang] Fix unparsing of pointer-decls with deferred shape.
peter klausler [Mon, 9 Apr 2018 20:40:20 +0000 (13:40 -0700)]
[flang] Fix unparsing of pointer-decls with deferred shape.

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

6 years ago[flang] Repair negative scale factors in formats.
peter klausler [Mon, 9 Apr 2018 20:17:31 +0000 (13:17 -0700)]
[flang] Repair negative scale factors in formats.

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

6 years ago[flang] Tweak recent disambiguations after more testing.
peter klausler [Mon, 9 Apr 2018 19:53:11 +0000 (12:53 -0700)]
[flang] Tweak recent disambiguations after more testing.

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

6 years ago[flang] Remove a needless std::move() call, and be more careful about line continuation.
peter klausler [Mon, 9 Apr 2018 19:52:52 +0000 (12:52 -0700)]
[flang] Remove a needless std::move() call, and be more careful about line continuation.

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

6 years ago[flang] Remove some needless std::move() calls for readability.
peter klausler [Mon, 9 Apr 2018 19:51:33 +0000 (12:51 -0700)]
[flang] Remove some needless std::move() calls for readability.

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

6 years ago[flang] Better solution in grammar for a data statement value parse.
peter klausler [Mon, 9 Apr 2018 18:57:53 +0000 (11:57 -0700)]
[flang] Better solution in grammar for a data statement value parse.

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

6 years ago[flang] Handle pp-directives amid continuations correctly, and fix a Hollerith ambiguity.
peter klausler [Mon, 9 Apr 2018 18:47:00 +0000 (11:47 -0700)]
[flang] Handle pp-directives amid continuations correctly, and fix a Hollerith ambiguity.

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

6 years ago[flang] Adjust TODO messages to reflect deliberate behavior.
peter klausler [Mon, 9 Apr 2018 18:43:37 +0000 (11:43 -0700)]
[flang] Adjust TODO messages to reflect deliberate behavior.

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

6 years ago[flang] Fix naming: list_type -> listType
peter klausler [Mon, 9 Apr 2018 18:42:46 +0000 (11:42 -0700)]
[flang] Fix naming: list_type -> listType

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

6 years ago[flang] Rearrange alternatives in data statement values to put longer parse earlier.
peter klausler [Mon, 9 Apr 2018 16:57:49 +0000 (09:57 -0700)]
[flang] Rearrange alternatives in data statement values to put longer parse earlier.

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

6 years ago[flang] Prevent misrecognition of a digit string that is the kind parameter of a...
peter klausler [Sat, 7 Apr 2018 00:04:18 +0000 (17:04 -0700)]
[flang] Prevent misrecognition of a digit string that is the kind parameter of a character literal from being misrecognized as an integer literal.

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

6 years ago[flang] Parse unlimited format item -- needed to adjust its precedence in grammar.
peter klausler [Fri, 6 Apr 2018 23:43:36 +0000 (16:43 -0700)]
[flang] Parse unlimited format item -- needed to adjust its precedence in grammar.

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

6 years ago[flang] Parser mistakenly attempted error recovery in specification part when it...
peter klausler [Fri, 6 Apr 2018 23:30:45 +0000 (16:30 -0700)]
[flang] Parser mistakenly attempted error recovery in specification part when it saw END statement with label.

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

6 years ago[flang] Fix two errors in the grammar (array constructors with type but no values...
peter klausler [Fri, 6 Apr 2018 23:15:55 +0000 (16:15 -0700)]
[flang] Fix two errors in the grammar (array constructors with type but no values did not consume the ::, and ERR= was omitted from CLOSE().  Add CONVERT= extension to OPEN().

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

6 years ago[flang] Crash more gracefully when files include themselves.
peter klausler [Fri, 6 Apr 2018 21:20:29 +0000 (14:20 -0700)]
[flang] Crash more gracefully when files include themselves.

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

6 years ago[flang] Merge pull request flang-compiler/f18#43 from ThePortlandGroup/pmk2
Peter Klausler [Mon, 9 Apr 2018 20:48:44 +0000 (13:48 -0700)]
[flang] Merge pull request flang-compiler/f18#43 from ThePortlandGroup/pmk2

Avoid most uses of Boolean-valued Pre() callbacks in unparse.cc.

Original-commit: flang-compiler/f18@1b8ff5f07de4a7c7d70454aeaf708407d1be8edc
Reviewed-on: https://github.com/flang-compiler/f18/pull/43

6 years ago[flang] Avoid most uses of Boolean-valued Pre() callbacks in unparse.cc.
peter klausler [Fri, 6 Apr 2018 20:13:20 +0000 (13:13 -0700)]
[flang] Avoid most uses of Boolean-valued Pre() callbacks in unparse.cc.

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

6 years ago[flang] Merge pull request flang-compiler/f18#46 from ThePortlandGroup/tsk8
Tim Keith [Mon, 9 Apr 2018 18:55:25 +0000 (11:55 -0700)]
[flang] Merge pull request flang-compiler/f18#46 from ThePortlandGroup/tsk8

Change API of Scope to match std::map

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

6 years ago[flang] Address review comments.
Tim Keith [Mon, 9 Apr 2018 18:53:20 +0000 (11:53 -0700)]
[flang] Address review comments.

Make map_type private -- it is not part of the API.

Add cbegin() and cend().

Original-commit: flang-compiler/f18@1ad699dbfdcab2c3960b1dda438572d23dcffbb4
Reviewed-on: https://github.com/flang-compiler/f18/pull/46

6 years ago[flang] Change API of Scope to match std::map
Tim Keith [Mon, 9 Apr 2018 17:07:36 +0000 (10:07 -0700)]
[flang] Change API of Scope to match std::map

The Scope can be thought of as (among other things) a mapping of Name to
Symbol. This change reflects that by changing the API to match std::map.

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

6 years ago[flang] Merge pull request flang-compiler/f18#45 from ThePortlandGroup/sjs-doc
Steve Scalpone [Mon, 9 Apr 2018 16:40:20 +0000 (09:40 -0700)]
[flang] Merge pull request flang-compiler/f18#45 from ThePortlandGroup/sjs-doc

Add snippet about trigraphs

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

6 years ago[flang] Add snippet about trigraphs
Steve Scalpone [Mon, 9 Apr 2018 04:31:49 +0000 (21:31 -0700)]
[flang] Add snippet about trigraphs

Original-commit: flang-compiler/f18@551f2ccd06861f317bfb6fe092c2274af3fc96c1
Reviewed-on: https://github.com/flang-compiler/f18/pull/45

6 years ago[flang] Merge pull request flang-compiler/f18#41 from ThePortlandGroup/tsk6
Tim Keith [Fri, 6 Apr 2018 21:09:49 +0000 (14:09 -0700)]
[flang] Merge pull request flang-compiler/f18#41 from ThePortlandGroup/tsk6

 Collect implicit type rules and report related errors.

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

6 years ago[flang] Address review comments.
Tim Keith [Fri, 6 Apr 2018 17:46:30 +0000 (10:46 -0700)]
[flang] Address review comments.

Maintain stack of ImplicitRules in parallel with the scope stack.
I doesn't have to live as long as the scopes.

Allow for '_', '$', and '@' in ImplicitRules if they come through from
the parser.

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

6 years ago[flang] Address code review comments.
Tim Keith [Fri, 6 Apr 2018 00:02:31 +0000 (17:02 -0700)]
[flang] Address code review comments.

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

6 years ago[flang] Collect implicit type rules and report related errors.
Tim Keith [Wed, 4 Apr 2018 16:03:51 +0000 (09:03 -0700)]
[flang] Collect implicit type rules and report related errors.

ImplicitRules maintains a mapping of initial character of an identifier
to its implicit type.

ImplicitRulesVisitor visits the ImplicitStmt and related parse tree
nodes and updates the rules.

Emit errors messages in these cases:
- implicit type specified more than once for a letter
- IMPLICIT statement and IMPLICIT NONE in same scope
- IMPLICIT statement and IMPLICIT NONE(TYPE) in same scope
- more than one IMPLICIT NONE in a scope
- IMPLICIT statement with empty range of letters
- IMPLICIT NONE statement after PARAMETER statement
- TYPE or EXTERNAL repeated in an IMPLICIT NONE statement

Also start emitting error messages through the parser::Messages
interface. An instance of Messages is created from the cooked source and
saved in the MessageHandler class. It tracks the source location of the
current statement and provides a way to emit messages associated with
that statement.

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

6 years ago[flang] Merge pull request flang-compiler/f18#42 from ThePortlandGroup/pmk1
Peter Klausler [Fri, 6 Apr 2018 18:21:28 +0000 (11:21 -0700)]
[flang] Merge pull request flang-compiler/f18#42 from ThePortlandGroup/pmk1

Generalize Attrs for arbitrary enums, implement with std::bitset<>.

Original-commit: flang-compiler/f18@28a9fc0b9e4a387678eb05395ed6d888e1b88912
Reviewed-on: https://github.com/flang-compiler/f18/pull/42

6 years ago[flang] Address review comments.
peter klausler [Fri, 6 Apr 2018 17:34:59 +0000 (10:34 -0700)]
[flang] Address review comments.

Original-commit: flang-compiler/f18@66ecc10722135e5f9f3f8d68ac6795a4ba5e0727
Reviewed-on: https://github.com/flang-compiler/f18/pull/42

6 years ago[flang] Generalize semantics/attr.h into enum-set.h, implementing it atop std::bitset.
peter klausler [Thu, 5 Apr 2018 23:49:48 +0000 (16:49 -0700)]
[flang] Generalize semantics/attr.h into enum-set.h, implementing it atop std::bitset.

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

6 years ago[flang] Improvements to memory-mapped source files.
peter klausler [Thu, 5 Apr 2018 21:39:55 +0000 (14:39 -0700)]
[flang] Improvements to memory-mapped source files.

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

6 years ago[flang] Avoid having too many file descriptors open or using mmap() for small files.
peter klausler [Thu, 5 Apr 2018 20:06:36 +0000 (13:06 -0700)]
[flang] Avoid having too many file descriptors open or using mmap() for small files.

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

6 years ago[flang] Correct order of steps in idealized preprocessor description.
peter klausler [Wed, 4 Apr 2018 21:32:17 +0000 (14:32 -0700)]
[flang] Correct order of steps in idealized preprocessor description.

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

6 years ago[flang] Do not allow "-" to denote standard input on INCLUDE/#include.
peter klausler [Wed, 4 Apr 2018 15:06:15 +0000 (08:06 -0700)]
[flang] Do not allow "-" to denote standard input on INCLUDE/#include.

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

6 years ago[flang] Fix __VA_ARGS__, was broken due to typo.
peter klausler [Tue, 3 Apr 2018 22:50:25 +0000 (15:50 -0700)]
[flang] Fix __VA_ARGS__, was broken due to typo.

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

6 years ago[flang] Merge pull request flang-compiler/f18#39 from ThePortlandGroup/pmk-recovery2
Peter Klausler [Tue, 3 Apr 2018 21:34:58 +0000 (14:34 -0700)]
[flang] Merge pull request flang-compiler/f18#39 from ThePortlandGroup/pmk-recovery2

Error recovery in specification parts

Original-commit: flang-compiler/f18@074ce568ff43038568418b299b1027471620e338
Reviewed-on: https://github.com/flang-compiler/f18/pull/39

6 years ago[flang] Resolve some TODOs in the grammar.
peter klausler [Tue, 3 Apr 2018 21:14:39 +0000 (14:14 -0700)]
[flang] Resolve some TODOs in the grammar.

Original-commit: flang-compiler/f18@6ef9e2388bfc7f9b7ac5966196d9e1918220d797
Reviewed-on: https://github.com/flang-compiler/f18/pull/39

6 years ago[flang] Error recovery for specification part.
peter klausler [Tue, 3 Apr 2018 20:02:40 +0000 (13:02 -0700)]
[flang] Error recovery for specification part.

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

6 years ago[flang] Merge pull request flang-compiler/f18#38 from ThePortlandGroup/pmk-recovery
Peter Klausler [Tue, 3 Apr 2018 17:30:16 +0000 (10:30 -0700)]
[flang] Merge pull request flang-compiler/f18#38 from ThePortlandGroup/pmk-recovery

Messaging and error recovery work

Original-commit: flang-compiler/f18@073210bf91ddc91e7f2e773861d9a40a2fd34de4
Reviewed-on: https://github.com/flang-compiler/f18/pull/38

6 years ago[flang] Address review comments (thanks!).
peter klausler [Tue, 3 Apr 2018 17:29:04 +0000 (10:29 -0700)]
[flang] Address review comments (thanks!).

Original-commit: flang-compiler/f18@1e61fbaeae5402fcd0c732de244bfe02aadfe6ff
Reviewed-on: https://github.com/flang-compiler/f18/pull/38

6 years ago[flang] Add documentation.
peter klausler [Tue, 3 Apr 2018 00:00:28 +0000 (17:00 -0700)]
[flang] Add documentation.

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

6 years ago[flang] More clean-up in token-parsers.h.
peter klausler [Mon, 2 Apr 2018 23:44:34 +0000 (16:44 -0700)]
[flang] More clean-up in token-parsers.h.

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

6 years ago[flang] Debugging and a TODO.
peter klausler [Mon, 2 Apr 2018 23:33:10 +0000 (16:33 -0700)]
[flang] Debugging and a TODO.

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

6 years ago[flang] Better error recovery, some debugging.
peter klausler [Mon, 2 Apr 2018 23:06:18 +0000 (16:06 -0700)]
[flang] Better error recovery, some debugging.

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

6 years ago[flang] Revamp messaging. Add ""_err_en_US to denote fatal error messages.
peter klausler [Mon, 2 Apr 2018 22:51:04 +0000 (15:51 -0700)]
[flang] Revamp messaging.  Add ""_err_en_US to denote fatal error messages.

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

6 years ago[flang] Fix debug-parser.h after recent merge.
peter klausler [Mon, 2 Apr 2018 18:52:53 +0000 (11:52 -0700)]
[flang] Fix debug-parser.h after recent merge.

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

6 years ago[flang] Fix indentation bug in unparsed output that I introduced in last merge.
peter klausler [Mon, 2 Apr 2018 18:05:07 +0000 (11:05 -0700)]
[flang] Fix indentation bug in unparsed output that I introduced in last merge.

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

6 years ago[flang] Work around clang-format issue by using "auto" where type is obvious.
peter klausler [Mon, 2 Apr 2018 17:59:42 +0000 (10:59 -0700)]
[flang] Work around clang-format issue by using "auto" where type is obvious.

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

6 years ago[flang] Merge pull request flang-compiler/f18#36 from ThePortlandGroup/tsk6
Tim Keith [Mon, 2 Apr 2018 17:49:22 +0000 (10:49 -0700)]
[flang] Merge pull request flang-compiler/f18#36 from ThePortlandGroup/tsk6

Continue work on name resolution

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

6 years ago[flang] Fix bug parsing "implicit none(type)"
Tim Keith [Mon, 2 Apr 2018 17:36:51 +0000 (10:36 -0700)]
[flang] Fix bug parsing "implicit none(type)"

"implicit none(type)" was being recognized as "implicit none(external)".

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

6 years ago[flang] Respond to review comments.
Tim Keith [Sat, 31 Mar 2018 02:49:00 +0000 (19:49 -0700)]
[flang] Respond to review comments.

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

6 years ago[flang] Continue work on name resolution
Tim Keith [Fri, 30 Mar 2018 20:57:23 +0000 (13:57 -0700)]
[flang] Continue work on name resolution

Enhance DeclTypeSpecVisitor to find derived-type-specs, including with
type parameter values.

Change DerivedTypeSpec so it only needs the name of the derived type,
not the definition, as that isn't necessarily known when we encounter
it.

Fix how memory is managed in DeclTypeSpec: Intrinsic type specs aren't a
problem -- they are one of a few types that live throughout the program.
Derived type specs are dynamically allocated and the memory is owned by
the DeclTypeSpec -- it allocates it when a DeclTypeSpec for a derived
type is created and deletes it when it is destroyed. Pass around
references to TypeSpecs rather than pointers as they can never be null.

In AttrsVisitor, DeclTypeSpecVisitor, ResolveNamesVisitor: make most
functions out-of-line to clean up the class declaration.

In AttrsVisitor, use preprocessor to simplify the simple case of
encountering a parse-tree class causing an attribute to be set.
Handle all such attributes.

Remove old testing code from type.cc.

Remove some of the declarations for IntExpr and IntConst -- they are
only placeholder classes anyway. Don't distinguish kind and length
parameter values.

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

6 years ago[flang] Merge pull request flang-compiler/f18#37 from ThePortlandGroup/pmk-minor
Peter Klausler [Mon, 2 Apr 2018 16:46:19 +0000 (09:46 -0700)]
[flang] Merge pull request flang-compiler/f18#37 from ThePortlandGroup/pmk-minor

Roll up some small changes to resolve TODOs

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

6 years ago[flang] Elide a useless local variable that used to be a formal argument.
peter klausler [Sat, 31 Mar 2018 00:03:02 +0000 (17:03 -0700)]
[flang] Elide a useless local variable that used to be a formal argument.

Original-commit: flang-compiler/f18@419b5d07eeccda8bf2320b2adce0bb5adb55b0fd
Reviewed-on: https://github.com/flang-compiler/f18/pull/37

6 years ago[flang] Debugging after testing. Take care of a TODO in the prescanner.
peter klausler [Fri, 30 Mar 2018 23:21:12 +0000 (16:21 -0700)]
[flang] Debugging after testing.  Take care of a TODO in the prescanner.

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

6 years ago[flang] Debugging, and resolve another TODO in unparse.cc.
peter klausler [Fri, 30 Mar 2018 22:23:37 +0000 (15:23 -0700)]
[flang] Debugging, and resolve another TODO in unparse.cc.

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

6 years ago[flang] Look for declared STRUCTURE component names after a . rather than defined...
peter klausler [Fri, 30 Mar 2018 21:10:00 +0000 (14:10 -0700)]
[flang] Look for declared STRUCTURE component names after a . rather than defined operator names.

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

6 years ago[flang] Merge pull request flang-compiler/f18#35 from ThePortlandGroup/pmk-spaces
Peter Klausler [Fri, 30 Mar 2018 18:33:24 +0000 (11:33 -0700)]
[flang] Merge pull request flang-compiler/f18#35 from ThePortlandGroup/pmk-spaces

Warn about missing spaces in free form

Original-commit: flang-compiler/f18@2cf8391737e2e4254ce4a48152b468e99c1f0d12
Reviewed-on: https://github.com/flang-compiler/f18/pull/35

6 years ago[flang] Remove some needless checks for mandatory spaces before keywords and names...
peter klausler [Fri, 30 Mar 2018 18:32:37 +0000 (11:32 -0700)]
[flang] Remove some needless checks for mandatory spaces before keywords and names that could not be present anyway, they were slowing things down.

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

6 years ago[flang] Use "..."_sptok rather than ~ in tokens to denote mandatory spaces.
peter klausler [Fri, 30 Mar 2018 18:11:48 +0000 (11:11 -0700)]
[flang] Use "..."_sptok rather than ~ in tokens to denote mandatory spaces.

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

6 years ago[flang] "free from" -> "free form" in comment.
peter klausler [Fri, 30 Mar 2018 00:07:19 +0000 (17:07 -0700)]
[flang] "free from" -> "free form" in comment.

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

6 years ago[flang] Update documentation.
peter klausler [Thu, 29 Mar 2018 23:53:10 +0000 (16:53 -0700)]
[flang] Update documentation.

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

6 years ago[flang] Make functions inline to recoup performance.
peter klausler [Thu, 29 Mar 2018 23:49:25 +0000 (16:49 -0700)]
[flang] Make functions inline to recoup performance.

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

6 years ago[flang] Debugging.
peter klausler [Thu, 29 Mar 2018 23:34:03 +0000 (16:34 -0700)]
[flang] Debugging.

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

6 years ago[flang] Emit warnings in free form when a required space is missing.
peter klausler [Thu, 29 Mar 2018 23:06:31 +0000 (16:06 -0700)]
[flang] Emit warnings in free form when a required space is missing.

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

6 years ago[flang] Merge pull request flang-compiler/f18#34 from ThePortlandGroup/pmk-cdir
Peter Klausler [Thu, 29 Mar 2018 19:18:54 +0000 (12:18 -0700)]
[flang] Merge pull request flang-compiler/f18#34 from ThePortlandGroup/pmk-cdir

Support compiler directives in the prescanner and parser.

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

6 years ago[flang] Begin work on missing space warnings in free form. Reformat C++.
peter klausler [Thu, 29 Mar 2018 19:16:10 +0000 (12:16 -0700)]
[flang] Begin work on missing space warnings in free form.  Reformat C++.

Original-commit: flang-compiler/f18@1bcbf0eb7bb216e14076cc1b83f1f7a2c3f75340
Reviewed-on: https://github.com/flang-compiler/f18/pull/34

6 years ago[flang] Add MinSizeRel to .gitignore.
peter klausler [Thu, 29 Mar 2018 18:19:37 +0000 (11:19 -0700)]
[flang] Add MinSizeRel to .gitignore.

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

6 years ago[flang] Simplify test-type and test-sema to use parser::Parsing wrapper class.
peter klausler [Thu, 29 Mar 2018 00:15:00 +0000 (17:15 -0700)]
[flang] Simplify test-type and test-sema to use parser::Parsing wrapper class.

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

6 years ago[flang] Resolve merge with code pushed to master.
peter klausler [Wed, 28 Mar 2018 22:11:12 +0000 (15:11 -0700)]
[flang] Resolve merge with code pushed to master.

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

6 years ago[flang] Clean out obsolete parsing code. Handle !cdir$ fixed and free in parser.
peter klausler [Fri, 23 Mar 2018 22:14:52 +0000 (15:14 -0700)]
[flang] Clean out obsolete parsing code.  Handle !cdir$ fixed and free in parser.

Work on scanning compiler directive lines.

Fix glitch in earlier change to parse-state.h.

Add ClassifyLine(), simplify some token sequence data lifetimes and interfaces.

Handle continued directives.  Obey !DIR$ FIXED and FREE in prescanner.

Some refactoring of TokenSequence API, then support initial directives (FIXED, FREE, IGNORE_TKR).

Fix !DIR$ IGNORE_TKR syntax, manual was wrong.

Debugging directive scanning & parsing.

Profiling-directed speed-up - do not map cooked source locations to Provenance until a Message is emitted.  Turn some non-nullable pointers into references.

Debugging.

Handle !DIR$ IVDEP too, it is in a test.

Accept directives in the execution part.

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

6 years ago[flang] Merge pull request flang-compiler/f18#24 from ThePortlandGroup/sch_sema
Stephane Chauveau [Mon, 26 Mar 2018 14:35:34 +0000 (16:35 +0200)]
[flang] Merge pull request flang-compiler/f18#24 from ThePortlandGroup/sch_sema

Add initial semantic analysis on statements

Original-commit: flang-compiler/f18@68bb9f670ddbaf71ca735d4d7241ef4f67720e22
Reviewed-on: https://github.com/flang-compiler/f18/pull/24

6 years ago[flang] Merge branch 'sch_sema' of https://github.com/ThePortlandGroup/f18 into sch_sema
Stephane Chauveau [Mon, 26 Mar 2018 14:04:37 +0000 (16:04 +0200)]
[flang] Merge branch 'sch_sema' of https://github.com/ThePortlandGroup/f18 into sch_sema

Conflicts:
lib/parser/parse-tree.h
lib/semantics/CMakeLists.txt
tools/f18/CMakeLists.txt
tools/f18/test-sema.cc

Original-commit: flang-compiler/f18@2282b5759ba6fa9d8f8003d499fa114b869723b6
Reviewed-on: https://github.com/flang-compiler/f18/pull/24

6 years ago[flang] Remove files in include/flang/Sema/
Stephane Chauveau [Mon, 26 Mar 2018 13:50:54 +0000 (15:50 +0200)]
[flang] Remove files in include/flang/Sema/

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

6 years ago[flang] Merge with current master and move code to lib/semantics/
Stephane Chauveau [Mon, 26 Mar 2018 13:49:04 +0000 (15:49 +0200)]
[flang] Merge with current master and move code to lib/semantics/

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

6 years ago[flang] commit before rebase master
Stephane Chauveau [Mon, 26 Mar 2018 08:16:26 +0000 (10:16 +0200)]
[flang] commit before rebase master

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

6 years ago[flang] Commit changes made while at Portland. Some of them will disapear
Stephane Chauveau [Mon, 26 Mar 2018 08:04:40 +0000 (01:04 -0700)]
[flang] Commit changes made while at Portland. Some of them will disapear

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

6 years ago[flang] Provide an emacs style for editing Flang C++ sources
Stephane Chauveau [Mon, 12 Mar 2018 18:36:43 +0000 (11:36 -0700)]
[flang] Provide an emacs style for editing Flang C++ sources

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

6 years ago[flang] remove long comment
Stephane Chauveau [Fri, 9 Mar 2018 16:02:20 +0000 (17:02 +0100)]
[flang] remove long comment

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

6 years ago[flang] several changes following pull comments
Stephane Chauveau [Fri, 9 Mar 2018 15:48:12 +0000 (16:48 +0100)]
[flang] several changes following pull comments

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

6 years ago[flang] Implement dump of parse-tree
Stephane Chauveau [Thu, 8 Mar 2018 20:54:17 +0000 (21:54 +0100)]
[flang] Implement dump of parse-tree

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

6 years ago[flang] remove unused member
Stephane Chauveau [Thu, 8 Mar 2018 10:23:19 +0000 (11:23 +0100)]
[flang] remove unused member

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

6 years ago[flang] Mostly code cleanup
Stephane Chauveau [Thu, 8 Mar 2018 10:21:04 +0000 (11:21 +0100)]
[flang] Mostly code cleanup

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

6 years ago[flang] Fix misc issues with closing of LabelDo
Stephane Chauveau [Wed, 7 Mar 2018 13:21:01 +0000 (14:21 +0100)]
[flang] Fix misc issues with closing of LabelDo

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

6 years ago[flang] add resolution of CYCLE target construct
Stephane Chauveau [Tue, 6 Mar 2018 16:47:22 +0000 (17:47 +0100)]
[flang] add resolution of CYCLE target construct

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

6 years ago[flang] Target construct of EXIT statements are now identified
Stephane Chauveau [Tue, 6 Mar 2018 16:29:22 +0000 (17:29 +0100)]
[flang] Target construct of EXIT statements are now identified

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

6 years ago[flang] fix incorrect handling of select rank and select type
Stephane Chauveau [Tue, 6 Mar 2018 15:14:26 +0000 (16:14 +0100)]
[flang] fix incorrect handling of select rank and select type

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

6 years ago[flang] LabelDo are now properly handled (for cases supported by parser)
Stephane Chauveau [Tue, 6 Mar 2018 14:46:22 +0000 (15:46 +0100)]
[flang] LabelDo are now properly handled (for cases supported by parser)
Also, construct names are now matched

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

6 years ago[flang] Very early semantic analysis.
Stephane Chauveau [Fri, 2 Mar 2018 15:16:36 +0000 (16:16 +0100)]
[flang] Very early semantic analysis.

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

6 years ago[flang] add fummy cc file for experiment
Stephane Chauveau [Thu, 1 Mar 2018 11:32:36 +0000 (12:32 +0100)]
[flang] add fummy cc file for experiment

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

6 years ago[flang] commit before rebase
Stephane Chauveau [Wed, 28 Feb 2018 11:47:31 +0000 (12:47 +0100)]
[flang] commit before rebase

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

6 years ago[flang] Merge pull request flang-compiler/f18#31 from ThePortlandGroup/tsk7
Tim Keith [Fri, 23 Mar 2018 22:33:50 +0000 (15:33 -0700)]
[flang] Merge pull request flang-compiler/f18#31 from ThePortlandGroup/tsk7

Add ENUM_CLASS to define enum class with ToString function.

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

6 years ago[flang] Add ENUM_CLASS to define enum class with ToString function.
Tim Keith [Fri, 23 Mar 2018 21:31:14 +0000 (14:31 -0700)]
[flang] Add ENUM_CLASS to define enum class with ToString function.

This replaces DEFINE_NESTED_ENUM_CLASS in parse-tree.h but works
similarly. "ENUM_CLASS(Foo, A, B, C)" defined enum class Foo with
enumerators A, B, C. It also defines an overloading of EnumToString
that converts enumerators to their string representation.

Change unparse.cc to adapt to this change.

Make use of ENUM_CLASS in attr.h and attr.cc.

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

6 years ago[flang] Merge pull request flang-compiler/f18#29 from ThePortlandGroup/pmk-prov
Peter Klausler [Fri, 23 Mar 2018 21:19:27 +0000 (14:19 -0700)]
[flang] Merge pull request flang-compiler/f18#29 from ThePortlandGroup/pmk-prov

Source provenance ranges for statements and names, plus clean-up.

Original-commit: flang-compiler/f18@13d976bb0f0e7161a376cd9e867f4555d3900276
Reviewed-on: https://github.com/flang-compiler/f18/pull/29

6 years ago[flang] Disable code in development before merging into master.
peter klausler [Fri, 23 Mar 2018 21:18:59 +0000 (14:18 -0700)]
[flang] Disable code in development before merging into 

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

6 years ago[flang] Rebase and merge with current master branch.
peter klausler [Fri, 23 Mar 2018 21:02:11 +0000 (14:02 -0700)]
[flang] Rebase and merge with current master branch.

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

6 years ago[flang] Handle empty files gracefully.
peter klausler [Tue, 20 Mar 2018 17:59:07 +0000 (10:59 -0700)]
[flang] Handle empty files gracefully.

Create interval.h.  Use std::size_t instead of bare size_t.  Redefine parser::Name to not be just a bare string.

Break out and rename CharBlock from token-sequence.h for use in the parse tree.

Incremental replacement of name strings with pointers to cooked characters.

Fix case sensitivity problem.

Use new CharBlock encoding to replace strings for real literal constants.

Normalized cooked character stream to lower case.

Simplify parsing now that cooked stream is lower case.  Replace Keyword in parse tree.

Add static_asserts to || and recovery parsers to enforce same result types.

Remove needless TODO comment inserted earlier.

Fix case conversion on prefixed character literals (f90_correct/dc04.f90).

Use CharBlock in user-state.h.

Complete transition from nextChar to nextCh (i.e., always use pointers).

Document extensions.  Begin work on compiler directive lines.

More documentation work.

Reformat prescan.cc.

More work on compiler directive scanning.

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

6 years ago[flang] Merge pull request flang-compiler/f18#30 from ThePortlandGroup/tsk6
Tim Keith [Fri, 23 Mar 2018 19:27:57 +0000 (12:27 -0700)]
[flang] Merge pull request flang-compiler/f18#30 from ThePortlandGroup/tsk6

Partial implementation of Symbols and Scopes.

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

6 years ago[flang] Address review comments.
Tim Keith [Fri, 23 Mar 2018 19:24:29 +0000 (12:24 -0700)]
[flang] Address review comments.

Use "namespace Fortran::semantics".

Add helper MakeSymbol() functions to ResolveNameVisitor to make a symbol
in the current scope.

Start work on subroutines, similar to what's been done for functions.

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

6 years ago[flang] Partial implementation of Symbols and Scopes.
Tim Keith [Fri, 23 Mar 2018 00:08:20 +0000 (17:08 -0700)]
[flang] Partial implementation of Symbols and Scopes.

A Symbol consists of a common part (in class Symbol) containing name,
owner, attributes. Information for a specific kind of symbol is in a
variant containing one of the *Details classes. So the kind of symbol is
determined by the type of details class stored in the details_ variant.

For scopes there is a single Scope class with an enum indicating the
kind. So far there isn't a need for extra kind-specific details as with
Symbols but that could change. Symbols defined in a Scope are stored
there in a simple map.

resolve-names.cc is a partial implementation of a parse-tree walker that
resolves names to Symbols. Currently is only handles functions (which
introduce a new Scope) and entity-decls. The test-type executable was
reused as a driver for this to avoid the need for a new one.

Sample output is below. When each "end function" is encountered the
scope is dumped, which shows the symbols defined in it.

$ cat a.f90
pure integer(8) function foo(arg1, arg2) result(res)
  integer :: arg1
  real :: arg2
contains
  function bar(arg1)
    real :: bar
    real :: arg1
  end function
end function

$ Debug/tools/f18/test-type a.f90
Subprogram scope: 0 children
  arg1:  Entity type: REAL
  bar:  Entity type: REAL
Subprogram scope: 1 children
  arg1:  Entity type: INTEGER
  arg2:  Entity type: REAL
  bar:  Subprogram (arg1)
  foo:  Subprogram (arg1, arg2) result(res)
  res:  Entity type: INTEGER(8)

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