Commit graph

1209 commits

Author SHA1 Message Date
Tim Keith
922ae38b83 [flang] Merge pull request flang-compiler/f18#277 from flang-compiler/tsk4c
Name resolution for namelist and data statements

Original-commit: flang-compiler/f18@c6d4360f3c
Reviewed-on: https://github.com/flang-compiler/f18/pull/277
2019-02-07 12:27:25 -08:00
Tim Keith
d0d92e4eff [flang] Address review comments
Original-commit: flang-compiler/f18@9daa2351c2
Reviewed-on: https://github.com/flang-compiler/f18/pull/277
2019-02-07 12:25:59 -08:00
Tim Keith
2a43e78c17 [flang] Improvements to name resolution in data statements
Handle variables in data statements differently from implied dos:
If a variable is first mentioned in a data statement, it is implicitly
declared in the current scope (and subsequent type declarations only
confirm the type).
In the implied do case, the only variables that can be implicitly
declared are the iteration variables. They must be created in the new
ImpliedDos scope. There must be one such scope for each data-stmt-object
because the variable name can be reused.

Resolve references to named constants, e.g. in complex-literal-constant
and data-stmt-value. This requires changing the handling of
named-constant-def as that is a definition, not a reference.

Original-commit: flang-compiler/f18@9952b56af0
Reviewed-on: https://github.com/flang-compiler/f18/pull/277
Tree-same-pre-rewrite: false
2019-02-06 17:18:02 -08:00
Tim Keith
7c4e86b7e2 [flang] Add Symbol::IsArray()
Add and use IsArray for symbols, meaning: it is an object entity
with shape.

Original-commit: flang-compiler/f18@31c1a37f03
Reviewed-on: https://github.com/flang-compiler/f18/pull/277
Tree-same-pre-rewrite: false
2019-02-06 10:28:31 -08:00
Tim Keith
da46e49a01 [flang] Resolve namelist group and object names
Namelist groups are represents by symbols with `NamelistDetails`.
Those contain a list of symbols representing the objects in the group.
References to namelist groups in io-control-spec are resolved.

In `.mod` files, namelist groups are written out at the end of the
module specification section. This is so that the declarations of the
objects in the namelist group appear before they are referenced.

Original-commit: flang-compiler/f18@8b70dbcac7
Reviewed-on: https://github.com/flang-compiler/f18/pull/277
Tree-same-pre-rewrite: false
2019-02-05 14:43:00 -08:00
Tim Keith
be6e03ec90 [flang] Add SayWithDecl function for error reporting
Add `SayWithDecl` to handle the common case of reporting an error about
a symbol and referencing its original declaration.

Original-commit: flang-compiler/f18@cf4d6fbe7f
Reviewed-on: https://github.com/flang-compiler/f18/pull/277
Tree-same-pre-rewrite: false
2019-02-05 13:51:36 -08:00
Eric Schweitz
332c9a707f [flang] Merge pull request flang-compiler/f18#276 from flang-compiler/eas3
Issue flang-compiler/f18#274 - add separate scopes for each procedure in the module

Original-commit: flang-compiler/f18@64e175ceb0
Reviewed-on: https://github.com/flang-compiler/f18/pull/276
2019-02-05 16:55:22 -08:00
Eric Schweitz
a67099adbf [flang] identifier conformity
Original-commit: flang-compiler/f18@7d6e28f699
Reviewed-on: https://github.com/flang-compiler/f18/pull/276
2019-02-05 10:27:32 -08:00
Eric Schweitz
5c5fda8680 [flang] Issue flang-compiler/f18#274 - add separate scopes for each procedure in the module
Original-commit: flang-compiler/f18@d8f6b66178
Reviewed-on: https://github.com/flang-compiler/f18/pull/276
Tree-same-pre-rewrite: false
2019-02-05 09:43:51 -08:00
Peter Klausler
4faaf7a75f [flang] Merge pull request flang-compiler/f18#271 from flang-compiler/pmk-exprs
Semantic analysis & folding of array constructors

Original-commit: flang-compiler/f18@00be335567
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
2019-02-04 13:38:08 -08:00
peter klausler
56bf4f8e0f [flang] fix crash found by tim
Original-commit: flang-compiler/f18@c24120d811
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
2019-02-04 13:06:21 -08:00
peter klausler
7f7c44f425 [flang] address comments
Original-commit: flang-compiler/f18@ccbb1a2036
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
2019-02-04 10:39:41 -08:00
peter klausler
fef7fcd45f [flang] More value semantics in Constant<> and GetScalarConstantValue
Original-commit: flang-compiler/f18@c7acce4685
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
2019-02-01 13:37:49 -08:00
peter klausler
6d8aecf981 [flang] Convert structs to classes, move some defs from variable.h to call.h
Original-commit: flang-compiler/f18@c877a34694
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
2019-01-31 16:04:17 -08:00
peter klausler
981921f47a [flang] fix f90_correct failure
Original-commit: flang-compiler/f18@1d9dac8ab5
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
2019-01-31 13:18:30 -08:00
peter klausler
8c5d6b99de [flang] Fix instantiation of PDT bindings
Original-commit: flang-compiler/f18@8dcfe0c70b
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
2019-01-31 11:44:13 -08:00
peter klausler
ef77d38c21 [flang] add conversions to array constructor test
Original-commit: flang-compiler/f18@881c195a26
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
2019-01-31 10:16:26 -08:00
peter klausler
140b4adcfe [flang] Address review comments, fix some f90_correct failures
Original-commit: flang-compiler/f18@e468f8cd54
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
2019-01-31 09:59:37 -08:00
peter klausler
1c95fef459 [flang] pass tests
Original-commit: flang-compiler/f18@db22dc2294
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
2019-01-31 09:59:35 -08:00
peter klausler
2a88fef290 [flang] array constructor folding with test
Original-commit: flang-compiler/f18@37e7a8e666
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
2019-01-31 09:59:34 -08:00
peter klausler
ab71bd343c [flang] folding array constructors
Original-commit: flang-compiler/f18@a4e045fc5a
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
2019-01-31 09:59:33 -08:00
peter klausler
650b32ebfe [flang] support Constant arrays
Original-commit: flang-compiler/f18@a92d8a404f
Reviewed-on: https://github.com/flang-compiler/f18/pull/271
Tree-same-pre-rewrite: false
2019-01-31 09:59:32 -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
8a3a255070 [flang] Merge pull request flang-compiler/f18#272 from flang-compiler/pmk-fix
Fix bugs flang-compiler/f18#269 & flang-compiler/f18#270

Original-commit: flang-compiler/f18@f9aecb6330
Reviewed-on: https://github.com/flang-compiler/f18/pull/272
2019-01-31 09:56:28 -08:00
peter klausler
1e706b1136 [flang] Update fix based on comment
Original-commit: flang-compiler/f18@52dfd3b5dc
Reviewed-on: https://github.com/flang-compiler/f18/pull/272
2019-01-30 10:31:26 -08:00
peter klausler
242407d853 [flang] Fix bugs flang-compiler/f18#269 & flang-compiler/f18#270
Original-commit: flang-compiler/f18@639816f3ef
Reviewed-on: https://github.com/flang-compiler/f18/pull/272
Tree-same-pre-rewrite: false
2019-01-30 09:55:42 -08:00
Peter Klausler
45a260dfb7 [flang] Merge pull request flang-compiler/f18#273 from flang-compiler/pmk-subnormal
Use IEEE-754 terminology better: subnormal, not denormal(ized)

Original-commit: flang-compiler/f18@700613d423
Reviewed-on: https://github.com/flang-compiler/f18/pull/273
2019-01-30 09:55:05 -08:00
peter klausler
74a77dd2ed [flang] Use IEEE-754 terminology better: subnormal, not denormal(ized)
Original-commit: flang-compiler/f18@57b0ebb558
Reviewed-on: https://github.com/flang-compiler/f18/pull/273
2019-01-29 16:47:41 -08:00
jeanPerier
b805175a8b [flang] Fixes issue flang-compiler/f18#267 (GetScalarConstantValue)
Merge pull request flang-compiler/f18#268 from flang-compiler/jpr0

Original-commit: flang-compiler/f18@d29624b542
2019-01-28 01:25:37 -08:00
Jean Perier
8453e1bc13 [flang] Cleaned folding test helper template
Original-commit: flang-compiler/f18@b402c0a09c
2019-01-25 03:24:31 -08:00
Jean Perier
fd8e708108 [flang] Add test related to issue flang-compiler/f18#267
Original-commit: flang-compiler/f18@a9b2a05f75
Tree-same-pre-rewrite: false
2019-01-24 09:49:00 -08:00
Jean Perier
a60121f9f3 [flang] Fix issue flang-compiler/f18#267 (GetScalarConstantValue)
Original-commit: flang-compiler/f18@9fcbd09a51
Tree-same-pre-rewrite: false
2019-01-24 09:46:35 -08:00
jeanPerier
db38488ecd [flang] Merge pull request flang-compiler/f18#227 from flang-compiler/jpr0
Implement CFI_set_pointer, CFI_section, CFI_select_part. Minor changes in other CFI funcs

Original-commit: flang-compiler/f18@357f3d67da
Reviewed-on: https://github.com/flang-compiler/f18/pull/227
2019-01-24 09:33:12 -08:00
Jean Perier
1131551d0a [flang] Removed unnecessary reinterpret_cast.
Original-commit: flang-compiler/f18@dd08a7fd3c
Reviewed-on: https://github.com/flang-compiler/f18/pull/227
2018-11-29 13:17:53 -08:00
Jean Perier
8e76e8727b [flang] Fix: CFI_type_char is now considered Fortran CHARACTER
Original-commit: flang-compiler/f18@7c23573bd9
Reviewed-on: https://github.com/flang-compiler/f18/pull/227
Tree-same-pre-rewrite: false
2018-11-28 12:17:34 -08:00
Jean Perier
9b3d9e52f2 [flang] Added nullptr check in CFI functions returning error codes
Original-commit: flang-compiler/f18@5213d3a921
Reviewed-on: https://github.com/flang-compiler/f18/pull/227
Tree-same-pre-rewrite: false
2018-11-27 16:07:21 -08:00
Jean Perier
a4e942aedf [flang] Changed CFI_CDESC_T c++ macro and various other comment fixes
-  CFI_CDESC_T can now be cast to CFI_cdesc_t without using
    reinterpret_cast.
 -  Use {} initialization everywhere according to style guideline
 -  Avoid useless parentheses
 -  Do not use static storage when useless in tests.
 -  Reodered some loops that were confusing in tests

Original-commit: flang-compiler/f18@d0ed631dfd
Reviewed-on: https://github.com/flang-compiler/f18/pull/227
Tree-same-pre-rewrite: false
2018-11-27 14:13:21 -08:00
Jean Perier
2d7b243369 [flang] editorial change after review
Original-commit: flang-compiler/f18@92339ea11a
Reviewed-on: https://github.com/flang-compiler/f18/pull/227
Tree-same-pre-rewrite: false
2018-11-26 15:31:07 -08:00
Jean Perier
2b634a6f45 [flang] fix review comments
Original-commit: flang-compiler/f18@5d9ef043a6
Reviewed-on: https://github.com/flang-compiler/f18/pull/227
Tree-same-pre-rewrite: false
2018-11-19 09:10:08 -08:00
Jean Perier
4a4ca14cb2 [flang] Comment typos correction
Original-commit: flang-compiler/f18@107c105636
Reviewed-on: https://github.com/flang-compiler/f18/pull/227
Tree-same-pre-rewrite: false
2018-11-19 08:59:07 -08:00
Jean Perier
218a5aa56a [flang] Set lower bounds to 0 in CFI_establish, CFI_select_part and CFI_setpointer
Original-commit: flang-compiler/f18@65c67347d9
Reviewed-on: https://github.com/flang-compiler/f18/pull/227
Tree-same-pre-rewrite: false
2018-11-19 07:50:30 -08:00
Jean Perier
0562341063 [flang] CFI_allocate: fixed CFI_type_char/cptr
Original-commit: flang-compiler/f18@ba9274d3ee
Reviewed-on: https://github.com/flang-compiler/f18/pull/227
Tree-same-pre-rewrite: false
2018-11-16 08:00:41 -08:00
Jean Perier
cc436e74df [flang] CFI_set_pointer, CFI_section, CFI_select_part and tests
Original-commit: flang-compiler/f18@e3830c5878
Reviewed-on: https://github.com/flang-compiler/f18/pull/227
Tree-same-pre-rewrite: false
2018-11-16 07:10:04 -08:00
Peter Klausler
8f49363a8c [flang] Merge pull request flang-compiler/f18#265 from flang-compiler/pmk0
Enable shared library build without dependence cycle between binaries

Original-commit: flang-compiler/f18@bcd1a5f38b
Reviewed-on: https://github.com/flang-compiler/f18/pull/265
2019-01-23 16:32:04 -08:00
peter klausler
7f4fb7f89f [flang] update copyright date
Original-commit: flang-compiler/f18@c9dbc96042
Reviewed-on: https://github.com/flang-compiler/f18/pull/265
2019-01-23 16:31:17 -08:00
peter klausler
85ea49eaba [flang] tweak CMakeLists.txt options
Original-commit: flang-compiler/f18@64ba0c0d6e
Reviewed-on: https://github.com/flang-compiler/f18/pull/265
Tree-same-pre-rewrite: false
2019-01-22 16:31:21 -08:00
peter klausler
9d63306d76 [flang] Remove SHARED from add_library(), use cmake command line option instead
Original-commit: flang-compiler/f18@6644c799a7
Reviewed-on: https://github.com/flang-compiler/f18/pull/265
Tree-same-pre-rewrite: false
2019-01-22 16:31:20 -08:00
peter klausler
f47c0bdaba [flang] Add SHARED to add_library() invocations so f18 libraries are always built shared.
Original-commit: flang-compiler/f18@060ced04c7
Reviewed-on: https://github.com/flang-compiler/f18/pull/265
Tree-same-pre-rewrite: false
2019-01-22 16:31:20 -08:00
peter klausler
db5b3fbd89 [flang] Enable building f18 as shared libraries
Original-commit: flang-compiler/f18@4544d75af1
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
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