Commit graph

148 commits

Author SHA1 Message Date
peter klausler f7057e031c [flang] Add -fxor-operator
Original-commit: flang-compiler/f18@b8365afc91
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
2019-07-10 16:42:10 -07:00
peter klausler cc2172b6f4 [flang] Fix multi-file compilations in throwaway driver
Original-commit: flang-compiler/f18@7954d0aecf
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
2019-07-08 10:43:42 -07:00
peter klausler 17fdb0a0e4 [flang] Missed one
Original-commit: flang-compiler/f18@e84f4b9c7a
Reviewed-on: https://github.com/flang-compiler/f18/pull/535
Tree-same-pre-rewrite: false
2019-06-28 11:34:15 -07:00
peter klausler dbb202c5be [flang] Extirpate NCHARACTER type, NC"" literals, and EUC-JP Hollerith
Original-commit: flang-compiler/f18@10a592a591
Reviewed-on: https://github.com/flang-compiler/f18/pull/535
Tree-same-pre-rewrite: false
2019-06-28 11:22:43 -07:00
peter klausler e012a13a0d [flang] Make unparsing of typed Exprs conditional when unparsing to pgf90
Original-commit: flang-compiler/f18@3b79c290cd
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:50 -07:00
peter klausler 00e128e42a [flang] Refactor SymbolOrComponent typedef to NamedEntity class
Original-commit: flang-compiler/f18@e8ec4b88bd
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:47 -07:00
peter klausler c4f0ea5a14 [flang] Pass PGF90 options on only if underlying compiler is PGF90
Original-commit: flang-compiler/f18@dc34f75b07
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
2019-06-28 09:16:40 -07:00
Steve Scalpone 93c63ed8c2 [flang] Compile and install the predefined module files.
Change the CMakeFile.txt in tools/f18 to build the predefined modules with the just-built compiler. The mod files are created in the new "include" subdirectory of the binary target directory.  The mod files are installed to ${CMAKE_INSTALL_PREFIX}/include.

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

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

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

Original-commit: flang-compiler/f18@7811ccecdc
Reviewed-on: https://github.com/flang-compiler/f18/pull/526
2019-06-25 09:57:38 -07:00
peter klausler 7c4b790c5e [flang] All fixed except for a few NAG differences
Original-commit: flang-compiler/f18@8dea4fb760
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
2019-06-17 16:13:09 -07:00
peter klausler 8971f7f2b3 [flang] More debugging vs. regression tests
Original-commit: flang-compiler/f18@d4fd4ad1ec
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
2019-06-17 16:13:08 -07:00
peter klausler 15af2b2f06 [flang] Character set and encoding changes
Original-commit: flang-compiler/f18@a550cbd4c0
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
2019-06-17 16:13:07 -07:00
peter klausler e7a21f763a [flang] Tests pass
Original-commit: flang-compiler/f18@ae9d07a2ab
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
2019-06-17 16:13:07 -07:00
Eric Schweitz 6bbcc8c1d8 [flang] Remove the old FIR middle end from the f18 program and speed up build time.
Original-commit: flang-compiler/f18@5b410b978c
Reviewed-on: https://github.com/flang-compiler/f18/pull/489
Tree-same-pre-rewrite: false
2019-06-07 10:19:59 -07:00
peter klausler c26b696085 [flang] Clean up subscript-sized int definitions
Original-commit: flang-compiler/f18@256fc4e3ca
Reviewed-on: https://github.com/flang-compiler/f18/pull/484
Tree-same-pre-rewrite: false
2019-06-07 09:57:49 -07:00
peter klausler 0f1fd64ae5 [flang] Other changes moved to their own branch.
Original-commit: flang-compiler/f18@6a922d085a
Reviewed-on: https://github.com/flang-compiler/f18/pull/485
2019-06-06 13:56:22 -07:00
peter klausler d8f72a3105 [flang] Placeholder for standard module iso_fortran_env
Original-commit: flang-compiler/f18@386ebb0490
Reviewed-on: https://github.com/flang-compiler/f18/pull/485
Tree-same-pre-rewrite: false
2019-06-06 13:42:33 -07:00
peter klausler f586ad5e56 [flang] Unparse the typedExpr from semantics, when present, rather than original parse tree expressions
Original-commit: flang-compiler/f18@4274cc8eaa
Reviewed-on: https://github.com/flang-compiler/f18/pull/479
2019-06-04 16:25:06 -07:00
peter klausler 0ddea8ae24 [flang] Rearrange references to AllSources singleton, fix FindScope for module files
Original-commit: flang-compiler/f18@50ccc1c819
Reviewed-on: https://github.com/flang-compiler/f18/pull/477
Tree-same-pre-rewrite: false
2019-06-04 13:37:09 -07:00
peter klausler d29530e1c4 [flang] Defer conversions to objects; fix some intrinsic table entries
more fixes

Access components of constant structures

Apply implicit typing to dummy args used in automatic array dimensions

SELECTED_INT_KIND and SELECTED_REAL_KIND

Finish SELECTED_{INT,REAL}_KIND and common cases of ALL()/ANY()

Original-commit: flang-compiler/f18@e9f8e53e55
Reviewed-on: https://github.com/flang-compiler/f18/pull/472
Tree-same-pre-rewrite: false
2019-05-28 13:29:29 -07:00
Jinxin Yang 80ccd20f3b [flang] Add -mp option for pgf90 in the presence of -fopenmp
Original-commit: flang-compiler/f18@a9d7287420
Reviewed-on: https://github.com/flang-compiler/f18/pull/450
2019-05-08 08:43:20 -07:00
Tim Keith 79826a73b2 [flang] Dump parse tree even if semantic error occurs
When -fdebug-dump-parse-tree is specified, dump the parse tree even
if semantic errors have occurred. This is necessary to see the parse
tree after it has been transformed.

Original-commit: flang-compiler/f18@bbdb0717da
Reviewed-on: https://github.com/flang-compiler/f18/pull/417
2019-04-17 07:44:58 -07:00
Steve Scalpone 1de9ecd251 [flang] Add CMake rules to install static and shared libraries in
the default install directory or in the directory specified
with CMAKE_INSTALL_PREFIX.  Fixes flang-compiler/f18#359.

Original-commit: flang-compiler/f18@35ce1628e2
Reviewed-on: https://github.com/flang-compiler/f18/pull/364
2019-03-28 09:55:56 -07:00
peter klausler ad057a42fa [flang] Remove OwningPointer, use unique_ptr better instead.
Original-commit: flang-compiler/f18@89aff868aa
Reviewed-on: https://github.com/flang-compiler/f18/pull/346
Tree-same-pre-rewrite: false
2019-03-20 11:38:45 -07:00
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 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 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 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
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
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 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 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 a981cd5b9e [flang] Move over build recipes and rename the library
Original-commit: flang-compiler/f18@51476aa178
Reviewed-on: https://github.com/flang-compiler/f18/pull/319
Tree-same-pre-rewrite: false
2019-03-11 08:56:36 -07:00
Eric Schweitz 35cf9e4c40 [flang] Fortran Intermediate Representation: initial draft based on "CFG" note.
Original-commit: flang-compiler/f18@b7a7595394
Reviewed-on: https://github.com/flang-compiler/f18/pull/319
Tree-same-pre-rewrite: false
2019-03-11 08:56:12 -07:00
Tim Keith f8995fcefa [flang] Remove build dependency on clang
For now all we need to depend on is LLVM.
Use llvm_map_components_to_libnames to find libraries to link against.

Original-commit: flang-compiler/f18@dff1402c2a
Reviewed-on: https://github.com/flang-compiler/f18/pull/321
2019-03-08 15:16:58 -08:00
peter klausler 4417443be9 [flang] Fix CHECK() on wa22 by implementing PGI language extension
Original-commit: flang-compiler/f18@03fcb58977
Reviewed-on: https://github.com/flang-compiler/f18/pull/287
Tree-same-pre-rewrite: false
2019-02-15 12:29:10 -08:00
peter klausler 0ae3d43d76 [flang] Run expression semantic analysis with rest of semantics.
checkpoint array constructor semantics work

checkpoint

array constructors of lengthless intrinsic types

checkpoint

Correct ambiguous substring refs misparsed as array elements

Original-commit: flang-compiler/f18@2232549efe
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
2019-01-31 09:59:28 -08:00
peter klausler e7b93436c3 [flang] Rearrange code to eliminate dependence cycles between f18 library binaries
Original-commit: flang-compiler/f18@88651eecae
Reviewed-on: https://github.com/flang-compiler/f18/pull/265
Tree-same-pre-rewrite: false
2019-01-22 16:31:19 -08:00
peter klausler f9d6c0a338 [flang] Move default intrinsic type kinds from lib/semantics to lib/common
Original-commit: flang-compiler/f18@887e72dd61
Reviewed-on: https://github.com/flang-compiler/f18/pull/265
Tree-same-pre-rewrite: false
2019-01-22 16:31:18 -08:00
peter klausler 972d2d52c5 [flang] bugfixing from regression testing
Original-commit: flang-compiler/f18@f1bcaa0292
Reviewed-on: https://github.com/flang-compiler/f18/pull/225
Tree-same-pre-rewrite: false
2018-11-14 11:12:09 -08:00
peter klausler f50047f45c [flang] merge with master
Original-commit: flang-compiler/f18@53f15da06a
Reviewed-on: https://github.com/flang-compiler/f18/pull/219
Tree-same-pre-rewrite: false
2018-10-26 15:19:10 -07:00
Jean Perier f7e7cb349b [flang] Changed .clang-format so that it will not add a comment after the closing brace of each namespace. Removed all such previous comments from all .cc and .h files
Original-commit: flang-compiler/f18@aa7f55e15f
Reviewed-on: https://github.com/flang-compiler/f18/pull/217
2018-10-25 05:55:23 -07:00
Tim Keith 16980c718a [flang] Refactoring: add SemanticsContext class
The new SemanticsContext holds the state of semantics whose lifetime
spans all of the compilations. It contains the scope tree (and so all
symbols), the intrinsics table, messages, and the state of options that
affect semantics (default kinds, search directories, etc.)

Original-commit: flang-compiler/f18@f04ceab81f
Reviewed-on: https://github.com/flang-compiler/f18/pull/215
Tree-same-pre-rewrite: false
2018-10-22 07:37:38 -07:00
peter klausler 7c402d9c50 [flang] Add -i8, -r8, &c. options to f18 development driver
Original-commit: flang-compiler/f18@ff7f338126
Reviewed-on: https://github.com/flang-compiler/f18/pull/213
2018-10-16 14:42:22 -07:00
peter klausler d2f36b9d76 [flang] Eliminating old default type declarations
Original-commit: flang-compiler/f18@10e4a3385a
Reviewed-on: https://github.com/flang-compiler/f18/pull/213
Tree-same-pre-rewrite: false
2018-10-15 17:11:24 -07:00
peter klausler bf339f8d47 [flang] Extract IntrinsicTypeDefaultKinds, move it into semantics
Original-commit: flang-compiler/f18@dd819b4727
Reviewed-on: https://github.com/flang-compiler/f18/pull/213
Tree-same-pre-rewrite: false
2018-10-15 15:28:47 -07:00
peter klausler a62636f634 [flang] debug initial intrinsic table probes
Original-commit: flang-compiler/f18@dce9a1e173
Reviewed-on: https://github.com/flang-compiler/f18/pull/212
Tree-same-pre-rewrite: false
2018-10-12 16:02:34 -07:00