Commit graph

1423 commits

Author SHA1 Message Date
Tim Keith
3ec5e102e2 [flang] Name resolution for defined operators
Instead of tracking just genericName_ while in a generic interface
block or generic statement, now we immediately create a symbol for it.
A parser::Name isn't good enough because a defined-operator or
defined-io-generic-spec doesn't have a name.

Change the parse tree to add a source field to GenericSpec. Use these
as names for symbols for defined-operator and defined-io-generic-spec
(e.g. "operator(+)" or "read(formatted)").

Change the source for defined-op-name to include the dots so that they
can be distinguished from normal symbols with the same name (e.g. you
can have both ".foo." and "foo"). These symbols have names in the symbol
table like ".foo.", not "operator(.foo.)", because references to them
have that form.

Add GenericKind enum to GenericDetails and GenericBindingDetails.
This allows us to know a symbol is "assignment(=)", for example,
without having to do a string comparison.

Add GenericSpecInfo to handle analyzing the various kinds of
generic-spec and generating symbol names and GenericKind for them.

Add reference to LanguageFeatureControl to SemanticsContext so that
they can be checked during semantics. For this change, if
LogicalAbbreviations is enabled, report an error if the user tries
to define an operator named ".T." or ".F.".

Add resolve-name-utils.cc to hold utility functions and classes that
don't have to be in the ResolveNamesVisitor class hierarchy. The goal
is to reduce the size of resolve-names.cc where possible.

Original-commit: flang-compiler/f18@3081f694e2
Reviewed-on: https://github.com/flang-compiler/f18/pull/338
2019-03-18 11:48:02 -07:00
Peter Klausler
6092f4c7b1 [flang] Merge pull request flang-compiler/f18#339 from flang-compiler/pmk-spaces
Squash free-form white space in prescanner around parentheses.

Original-commit: flang-compiler/f18@11eb9c8949
Reviewed-on: https://github.com/flang-compiler/f18/pull/339
2019-03-18 13:46:22 -07:00
peter klausler
19c91ea9e1 [flang] Improve comment
Original-commit: flang-compiler/f18@140ebe060e
Reviewed-on: https://github.com/flang-compiler/f18/pull/339
2019-03-18 13:43:03 -07:00
peter klausler
cf8f173512 [flang] Final tweak before review
Original-commit: flang-compiler/f18@5dda7b2f65
Reviewed-on: https://github.com/flang-compiler/f18/pull/339
Tree-same-pre-rewrite: false
2019-03-18 13:05:21 -07:00
peter klausler
f8c80f90ee [flang] Simplify
Original-commit: flang-compiler/f18@42bee00a45
Reviewed-on: https://github.com/flang-compiler/f18/pull/339
Tree-same-pre-rewrite: false
2019-03-18 12:24:44 -07:00
peter klausler
81a35e3b2f [flang] Squash spaces in generic specs.
Original-commit: flang-compiler/f18@bd5e29f5f8
Reviewed-on: https://github.com/flang-compiler/f18/pull/339
Tree-same-pre-rewrite: false
2019-03-18 12:19:35 -07:00
Peter Klausler
cae3ab0985 [flang] Merge pull request flang-compiler/f18#336 from flang-compiler/pmk-fixes
Fix parse of .TRUE._8

Original-commit: flang-compiler/f18@5e44e67f78
Reviewed-on: https://github.com/flang-compiler/f18/pull/336
2019-03-17 16:16:19 -07:00
peter klausler
7c71e2f288 [flang] Fix parse of .TRUE._8
Original-commit: flang-compiler/f18@b03e7a691d
Reviewed-on: https://github.com/flang-compiler/f18/pull/336
2019-03-17 15:51:02 -07:00
Eric Schweitz
14b4489390 [flang] Merge pull request flang-compiler/f18#334 from flang-compiler/eas0
FIR sync: replace the stubs for translating terminal symbols to expressions; st…

Original-commit: flang-compiler/f18@0a93e2c393
Reviewed-on: https://github.com/flang-compiler/f18/pull/334
2019-03-16 09:56:33 -07:00
Eric
6b09d21b13 [flang] more compiler warnings
Original-commit: flang-compiler/f18@df8c83c106
Reviewed-on: https://github.com/flang-compiler/f18/pull/334
2019-03-15 18:57:52 -07:00
Eric Schweitz
862ff5bf80 [flang] review comments
Original-commit: flang-compiler/f18@1ba1c0268f
Reviewed-on: https://github.com/flang-compiler/f18/pull/334
Tree-same-pre-rewrite: false
2019-03-15 16:23:10 -07:00
Eric Schweitz
0e96269737 [flang] muzzle clang++ warnings
Original-commit: flang-compiler/f18@02decb4040
Reviewed-on: https://github.com/flang-compiler/f18/pull/334
Tree-same-pre-rewrite: false
2019-03-15 11:35:18 -07:00
Eric Schweitz
327fa06a6b [flang] replace the stubs for translating terminal symbols to expressions; start pushing Value type into FIR; cleanup terminator succ_blocks; remove parser element from disassociate; run clang-format; etc.
Original-commit: flang-compiler/f18@c5561646ea
Reviewed-on: https://github.com/flang-compiler/f18/pull/334
Tree-same-pre-rewrite: false
2019-03-15 10:03:06 -07:00
Peter Klausler
87e96e93b8 [flang] Merge pull request flang-compiler/f18#335 from flang-compiler/pmk-spec
Some tweaks to preprocess & parse all Fortran in SPEC CPUv6

Original-commit: flang-compiler/f18@b2828f1318
Reviewed-on: https://github.com/flang-compiler/f18/pull/335
2019-03-15 15:59:25 -07:00
peter klausler
a4d44a8528 [flang] Document extension
Original-commit: flang-compiler/f18@ca2a7dc5a8
Reviewed-on: https://github.com/flang-compiler/f18/pull/335
2019-03-15 15:19:27 -07:00
peter klausler
713cd91a34 [flang] Final tweaks, can now parse all SPEC CPUv6
Original-commit: flang-compiler/f18@015152f1ba
Reviewed-on: https://github.com/flang-compiler/f18/pull/335
Tree-same-pre-rewrite: false
2019-03-15 15:01:54 -07:00
peter klausler
827407a86a [flang] more spec work, handle classic C comments
Original-commit: flang-compiler/f18@d901ee7f50
Reviewed-on: https://github.com/flang-compiler/f18/pull/335
Tree-same-pre-rewrite: false
2019-03-15 13:57:41 -07:00
peter klausler
4b26466375 [flang] Accomodate missing clock_gettime(); remove f18-parse-demo dependence on lib/evaluate; allow #ifdef with no name
Original-commit: flang-compiler/f18@330fd8116f
Reviewed-on: https://github.com/flang-compiler/f18/pull/335
Tree-same-pre-rewrite: false
2019-03-15 10:50:15 -07:00
Peter Klausler
7b77100155 [flang] Merge pull request flang-compiler/f18#330 from flang-compiler/pmk-parse-demo
f18-parse-demo

Original-commit: flang-compiler/f18@ec7b68f596
Reviewed-on: https://github.com/flang-compiler/f18/pull/330
2019-03-14 17:28:35 -07:00
peter klausler
d08de1a094 [flang] Add reference to libFortranEvaluate for destructor
Original-commit: flang-compiler/f18@db6fb0f8cd
Reviewed-on: https://github.com/flang-compiler/f18/pull/330
2019-03-14 16:40:55 -07:00
peter klausler
615ba7754b [flang] Move dump-parse-tree.h from semantics into parser.
Original-commit: flang-compiler/f18@9075adfcdf
Reviewed-on: https://github.com/flang-compiler/f18/pull/330
Tree-same-pre-rewrite: false
2019-03-14 16:28:06 -07:00
peter klausler
ac55c6e4d2 [flang] address review comments
Original-commit: flang-compiler/f18@be7dbdab0a
Reviewed-on: https://github.com/flang-compiler/f18/pull/330
Tree-same-pre-rewrite: false
2019-03-14 16:18:20 -07:00
peter klausler
8492b7f2b9 [flang] f18-parse-demo
Original-commit: flang-compiler/f18@96d9aefc4f
Reviewed-on: https://github.com/flang-compiler/f18/pull/330
Tree-same-pre-rewrite: false
2019-03-14 16:18:20 -07:00
Peter Klausler
4b6ccbdd2c [flang] Merge pull request flang-compiler/f18#333 from flang-compiler/pmk-include-in-continuation
Fixes and extensions to get WRF to parse

Original-commit: flang-compiler/f18@338a857856
Reviewed-on: https://github.com/flang-compiler/f18/pull/333
2019-03-14 16:17:30 -07:00
peter klausler
df2a910639 [flang] Get clean -fparse-only pass over WRF
Original-commit: flang-compiler/f18@ffe517abc6
Reviewed-on: https://github.com/flang-compiler/f18/pull/333
2019-03-14 14:53:29 -07:00
peter klausler
3348b1691d [flang] WRF preprocessing tweaks
Original-commit: flang-compiler/f18@53f76e1c93
Reviewed-on: https://github.com/flang-compiler/f18/pull/333
Tree-same-pre-rewrite: false
2019-03-14 14:53:25 -07:00
peter klausler
3204a1c1b9 [flang] checkpoint
Original-commit: flang-compiler/f18@0c9bdc7032
Reviewed-on: https://github.com/flang-compiler/f18/pull/333
Tree-same-pre-rewrite: false
2019-03-14 14:52:44 -07:00
Eric Schweitz
a3bd008757 [flang] Merge pull request flang-compiler/f18#332 from flang-compiler/eas1
fix typo

Original-commit: flang-compiler/f18@4097d8a890
Reviewed-on: https://github.com/flang-compiler/f18/pull/332
2019-03-14 12:26:25 -07:00
Eric Schweitz
3a0ccc1c0c [flang] fix typo
Original-commit: flang-compiler/f18@fc88b92af0
Reviewed-on: https://github.com/flang-compiler/f18/pull/332
2019-03-14 12:12:34 -07:00
Tim Keith
1b36254fae [flang] Merge pull request flang-compiler/f18#331 from flang-compiler/tsk10
Change default for LINK_WITH_FIR to ON.

Original-commit: flang-compiler/f18@ea89449089
Reviewed-on: https://github.com/flang-compiler/f18/pull/331
2019-03-14 10:09:28 -07:00
Tim Keith
9a6823bf4e [flang] Change default for LINK_WITH_FIR to ON.
Original-commit: flang-compiler/f18@b13f994463
Reviewed-on: https://github.com/flang-compiler/f18/pull/331
2019-03-14 09:08:27 -07:00
Tim Keith
488029bd80 [flang] Merge pull request flang-compiler/f18#329 from flang-compiler/tsk10
Add cmake option to link with FIR and LLVM

Original-commit: flang-compiler/f18@ddb43b33cc
Reviewed-on: https://github.com/flang-compiler/f18/pull/329
2019-03-14 07:23:03 -07:00
Tim Keith
1c9f8d408e [flang] Add cmake option to link with FIR and LLVM
The cmake option -DLINK_WITH_FIR=ON causes the f18 driver to be linked
against FIR and LLVM. When it is set to OFF (the default), the call into
FIR is #ifdef'd out.

The source in lib/FIR is always built; this option only affects linking.

Original-commit: flang-compiler/f18@69569edd4c
Reviewed-on: https://github.com/flang-compiler/f18/pull/329
2019-03-13 12:41:15 -07:00
Eric Schweitz
3946e1faf1 [flang] Merge pull request flang-compiler/f18#328 from flang-compiler/eas0
remove unused files and clean up unused warnings

Original-commit: flang-compiler/f18@67ef747557
Reviewed-on: https://github.com/flang-compiler/f18/pull/328
2019-03-12 07:36:01 -07:00
Eric Schweitz
388ce79539 [flang] Move virtual dtor to Terminator
Original-commit: flang-compiler/f18@68853d602a
Reviewed-on: https://github.com/flang-compiler/f18/pull/328
2019-03-11 18:37:30 -07:00
Eric Schweitz
311c9b5a89 [flang] remove unused files
Cleanup some warnings when building with clang.

Original-commit: flang-compiler/f18@33cf6255d1
Reviewed-on: https://github.com/flang-compiler/f18/pull/328
Tree-same-pre-rewrite: false
2019-03-11 12:24:16 -07:00
jeanPerier
01e48292e2 [flang] Silence clang warning related to ISO_Fortran_binding.h usage in C++
Original-commit: flang-compiler/f18@85b7f370b4
2019-03-12 01:27:00 -07:00
Jean Perier
74ca600dc0 [flang] address comments
Original-commit: flang-compiler/f18@7b1fc24265
2019-03-11 11:33:54 -07:00
Jean Perier
bfb6ba3ca2 [flang] remove unused CFI_ISO_FORTRAN_BINDING_FLEXIBLE_ARRAY
Original-commit: flang-compiler/f18@3cf9a625bf
Tree-same-pre-rewrite: false
2019-03-11 10:34:35 -07:00
Jean Perier
68da865a84 [flang] Silence clang warning from ISO_Fortran_binding.h usage in C++
Original-commit: flang-compiler/f18@88eb833b14
Tree-same-pre-rewrite: false
2019-03-11 10:21:16 -07:00
Steve Scalpone
eaf9c91ba6 [flang] Merge pull request flang-compiler/f18#326 from flang-compiler/BUILD_WITH_CLANG_LIBRARIES
Update CMakeList.txt to allow linking with LLVM libc++

Original-commit: flang-compiler/f18@866e188de6
Reviewed-on: https://github.com/flang-compiler/f18/pull/326
2019-03-11 20:23:18 -07:00
Steve Scalpone
8fedd37b38 [flang] To use LLVM's libc++ instead of GCC's libstdc++, define
BUILD_WITH_CLANG_LIBRARIES on the cmake command line to
be the path to a clang installation with bin, lib, etc.
For this to work, BUILD_WITH_CLANG must be defined too.

Original-commit: flang-compiler/f18@a36d5fee42
Reviewed-on: https://github.com/flang-compiler/f18/pull/326
2019-03-11 10:49:46 -07:00
Peter Klausler
716505e599 [flang] Merge pull request flang-compiler/f18#327 from flang-compiler/pmk-nofir
Emergency temporary patch to fix build

Original-commit: flang-compiler/f18@06d71f72a5
Reviewed-on: https://github.com/flang-compiler/f18/pull/327
2019-03-11 15:38:28 -07:00
peter klausler
d1c2c7b4b1 [flang] Temporarily disconnect FIR from f18.cc build
Original-commit: flang-compiler/f18@c610bc2744
Reviewed-on: https://github.com/flang-compiler/f18/pull/327
2019-03-11 15:01:27 -07:00
Eric Schweitz
741ded1135 [flang] Merge pull request flang-compiler/f18#324 from flang-compiler/eas0
Revisions for review comments.

Original-commit: flang-compiler/f18@5b066774b0
Reviewed-on: https://github.com/flang-compiler/f18/pull/324
2019-03-11 11:02:32 -07:00
Eric Schweitz
dfa5010e47 [flang] Revisions for review comments.
Original-commit: flang-compiler/f18@1a03f7d5bb
Reviewed-on: https://github.com/flang-compiler/f18/pull/324
2019-03-11 09:38:45 -07:00
Eric Schweitz
bdb94d41ca [flang] Merge pull request flang-compiler/f18#323 from flang-compiler/eas0
Fix build breakage

Original-commit: flang-compiler/f18@46e416acc7
Reviewed-on: https://github.com/flang-compiler/f18/pull/323
2019-03-11 09:37:31 -07:00
Eric Schweitz
cf18b7a6bd [flang] Fix build breakage
Original-commit: flang-compiler/f18@72d003f89d
Reviewed-on: https://github.com/flang-compiler/f18/pull/323
2019-03-11 09:16:01 -07:00
Eric Schweitz
70d55c0ce2 [flang] Merge pull request flang-compiler/f18#319 from flang-compiler/eas0
FIR update

Original-commit: flang-compiler/f18@3f6f710889
Reviewed-on: https://github.com/flang-compiler/f18/pull/319
2019-03-11 09:01:14 -07:00
Eric Schweitz
4fd1e5d795 [flang] Address review comments; merge with latest breaking changes on master
Original-commit: flang-compiler/f18@ffde96d486
Reviewed-on: https://github.com/flang-compiler/f18/pull/319
2019-03-11 08:59:33 -07:00