Commit graph

453 commits

Author SHA1 Message Date
peter klausler
2391eb8de9 [flang] COMPLEX
Original-commit: flang-compiler/f18@452d602fbb
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:53:00 -07:00
peter klausler
ed71134af7 [flang] LOGICAL
Original-commit: flang-compiler/f18@6ec49f6edc
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:59 -07:00
peter klausler
564292ccf7 [flang] Revamp type.h, add LOGICAL
Original-commit: flang-compiler/f18@f7d77887a2
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:58 -07:00
peter klausler
9e35c7e731 [flang] All operations now work and match x86, all modes and flags.
Original-commit: flang-compiler/f18@c69eef6524
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:57 -07:00
peter klausler
52ef92b513 [flang] More real work. All ops, rounding modes, and flags good except for division.
Original-commit: flang-compiler/f18@ea697295db
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:55 -07:00
peter klausler
fab448de59 [flang] Check flag bits.
Original-commit: flang-compiler/f18@b63e39aae7
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:54 -07:00
peter klausler
9ea409dd29 [flang] Multiplication, more tests.
Original-commit: flang-compiler/f18@e7ef16d216
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:53 -07:00
peter klausler
ae98068360 [flang] Refactor rounding code.
Original-commit: flang-compiler/f18@8ef2418791
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:53 -07:00
peter klausler
efa5de0080 [flang] Get real add/subtract working and tested.
Original-commit: flang-compiler/f18@c1b4389638
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:52 -07:00
peter klausler
518b2094b2 [flang] start negative number tests
Original-commit: flang-compiler/f18@1b52ec8d3b
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:49 -07:00
peter klausler
99c23c1a92 [flang] Get back to passing all tests.
Original-commit: flang-compiler/f18@d08dc86ede
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:47 -07:00
peter klausler
3fb4757cc7 [flang] Use EnumSet<> for real flags
Original-commit: flang-compiler/f18@a61f193036
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:46 -07:00
peter klausler
b940e3de3f [flang] some real debugging
Original-commit: flang-compiler/f18@9653814ed3
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:45 -07:00
peter klausler
eb9ad7ef07 [flang] begin testing reals
Original-commit: flang-compiler/f18@9d261b594b
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:44 -07:00
peter klausler
321056b53c [flang] Convert REAL code to use IEEE encodings.
Original-commit: flang-compiler/f18@b36e50f465
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:43 -07:00
peter klausler
e850b8d90b [flang] real work
Original-commit: flang-compiler/f18@030347a906
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:42 -07:00
peter klausler
59f16575ee [flang] More work on reals.
Original-commit: flang-compiler/f18@3ba634a214
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:40 -07:00
peter klausler
96d560b84b [flang] more work on reals
Original-commit: flang-compiler/f18@3afe85bf15
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:39 -07:00
peter klausler
0fb4b25ac8 [flang] begin real.h
Original-commit: flang-compiler/f18@b0f0cd8961
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:37 -07:00
peter klausler
5ee73b23c1 [flang] bugfixing from clang build
Original-commit: flang-compiler/f18@a05e108288
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:36 -07:00
peter klausler
0bdde28cd7 [flang] Reading numbers from strings.
Original-commit: flang-compiler/f18@8cbadfe777
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:35 -07:00
peter klausler
ce91eae382 [flang] Template specializations and more automatic configuration
Original-commit: flang-compiler/f18@a230a53907
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:33 -07:00
peter klausler
d0c120b371 [flang] Rename fixed-point to integer.
Original-commit: flang-compiler/f18@3fe9c505a5
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:31 -07:00
peter klausler
e1ff93a4d9 [flang] More tests; full build and test cycle.
Original-commit: flang-compiler/f18@ac36364304
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:30 -07:00
peter klausler
9c51fbc36e [flang] More tests
Original-commit: flang-compiler/f18@e4371fca37
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:29 -07:00
peter klausler
04711726c9 [flang] More intrinsics
Original-commit: flang-compiler/f18@55f974be59
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:28 -07:00
peter klausler
0dc145c255 [flang] Add pop count and parity code and tests.
Original-commit: flang-compiler/f18@a77f283183
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:27 -07:00
peter klausler
6a902b374e [flang] Complete conversion to value semantics
Original-commit: flang-compiler/f18@e98206ca97
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:25 -07:00
peter klausler
9858682f15 [flang] Converted multiplication
Original-commit: flang-compiler/f18@7d4c318210
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:23 -07:00
peter klausler
ba065d3c75 [flang] Converted shift intrinsics.
Original-commit: flang-compiler/f18@2e9be8ad66
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:22 -07:00
peter klausler
7b15d8054b [flang] Continue conversion to value semantics
Original-commit: flang-compiler/f18@03fe266611
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:21 -07:00
peter klausler
c3daaf8e79 [flang] Begin conversion to value semantics.
Original-commit: flang-compiler/f18@9ea9dae7e7
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:20 -07:00
peter klausler
23ab6ffa10 [flang] Reformat
Original-commit: flang-compiler/f18@104ca5f4c6
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:19 -07:00
peter klausler
66107803fd [flang] Testing framework, debugging of fixed-point code.
Original-commit: flang-compiler/f18@a8fb2d75a5
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:18 -07:00
peter klausler
5bc907602c [flang] unit testing for LZBC
Original-commit: flang-compiler/f18@c8541fb8fb
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:16 -07:00
peter klausler
330a3a135d [flang] add fixed-point.h
Original-commit: flang-compiler/f18@21c85a5c21
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:14 -07:00
peter klausler
5f276884af [flang] begin work
Original-commit: flang-compiler/f18@82e434bf59
Reviewed-on: https://github.com/flang-compiler/f18/pull/101
Tree-same-pre-rewrite: false
2018-06-14 13:52:12 -07:00
peter klausler
f100d8b192 [flang] Issue 98, better error recovery for specification-part
Original-commit: flang-compiler/f18@0b0812a82b
Reviewed-on: https://github.com/flang-compiler/f18/pull/103
2018-06-14 10:17:54 -07:00
peter klausler
efed300483 [flang] Allow tab in fixed form compiler directives. Reformat C++.
Original-commit: flang-compiler/f18@59ba17cb24
Reviewed-on: https://github.com/flang-compiler/f18/pull/102
2018-06-14 09:35:38 -07:00
Tim Keith
5fcec63769 [flang] Remove extraneous Pre/Post for ProcedureDeclarationStmt
clang give a compilation error on resolve-names.cc because there are
two overloadings of Pre(ProcedureDeclarationStmt) available in
ResolveNamesVisitor. One is defined in DeclTypeSpecVisitor and the other
in DeclarationVisitor. They are both brought in to ResolveNamesVisitor
via `using` statements.

The one in DeclarationVisitor is the one that is supposed to be called.
The other should have been removed when this one was added. This is the
one that gcc chooses to call, so this doesn't change any behavior.

The same applies to the Post method as well.

Original-commit: flang-compiler/f18@872f8faf96
Reviewed-on: https://github.com/flang-compiler/f18/pull/100
2018-06-12 17:46:41 -07:00
Tim Keith
fe1691d21c [flang] Add Dump() routines for debugging.
Add Dump() routines based on operator<< for the type so that they are
easy to call from the debugger. Overload for both pointer and reference
types and for dumping to std::cerr or a specific ostream.

Original-commit: flang-compiler/f18@ec6676eff0
Reviewed-on: https://github.com/flang-compiler/f18/pull/99
2018-06-11 15:40:31 -07:00
Tim Keith
5c27c9ea3f [flang] Address review comments.
Replace operator=(Symbol) and operator=(DeclTypeSpec) with set_symbol()
and set_type() to make it clearer. Eliminate the move constructor as it
is not needed. Make all but the accessor functions out-of-line.

Change HasExplicitType() to NeedsExplicitType(), reversing its sense.
HasExplicitType() returned true for symbols that didn't have or need an
explicit type, which was confusing.

Original-commit: flang-compiler/f18@ada13ac6a3
Reviewed-on: https://github.com/flang-compiler/f18/pull/97
2018-06-06 11:41:42 -07:00
Tim Keith
348ccb784e [flang] Process procedure declarations and derived types.
Add ObjectEntityDetails and ProcEntityDetails to distinguish between an
entity from an object-decl and one from a proc-decl. When we don't know,
it stays as EntityDetails until it is resolved. DeclareEntity() in
DeclarationVisitor creates this kind of symbol.

Add flags to Symbol as a convenient place for boolean flags common to
many kinds of symbols. Use it to mark symbols known to be functions or
subroutines so that we can report errors when they are used incorrectly.
Improve handling of EXTERNAL statement.

Handle ProcDecl nodes and add symbols for them.

Partial processing of derived types. Data component declarations are
processed and added to the derived type. Define TypeBoundProc and
TypeBoundGeneric in type.h. Procedure components, type-bound procedures,
etc. are not handled yet and nothing is done with the derived type once
it is created. Eliminate DerivedTypeDefBuilder in favor of just setting
fields in derivedTypeData_.

Add GetDeclTypeSpec to go with BeginDeclTypeSpec and EndDeclTypeSpec, to
avoid directly access the private variable.

Add tests in resolve20.f90 for errors related to procedure declarations.
Add missing copyrights to other tests.

Original-commit: flang-compiler/f18@40e65c1465
Reviewed-on: https://github.com/flang-compiler/f18/pull/97
Tree-same-pre-rewrite: false
2018-06-05 12:18:35 -07:00
Tim Keith
e820c545d7 [flang] Add MessageHandler::Say2.
This handles the common case of an error message referring to
a name, and an attached message referring to another name.
For example, reporting an error where a name is already declared
and mentioning the previous declaration.

Original-commit: flang-compiler/f18@901b50dcf2
Reviewed-on: https://github.com/flang-compiler/f18/pull/97
Tree-same-pre-rewrite: false
2018-05-30 14:49:40 -07:00
Tim Keith
06440bc34d [flang] Extract DeclarationVisitor from ResolveNamesVisitor
The is a refactoring to move all handling of declarations from
ResolveNamesVisitor to a new class. No function change.

Original-commit: flang-compiler/f18@2a5589ab96
Reviewed-on: https://github.com/flang-compiler/f18/pull/97
Tree-same-pre-rewrite: false
2018-05-30 14:11:45 -07:00
Hongyon Suauthai
90aca33d88 [flang] Fix comment in openmp-grammar.h. Fix unparse of reduction operator.
Original-commit: flang-compiler/f18@f6a7a03492
Reviewed-on: https://github.com/flang-compiler/f18/pull/96
2018-06-01 14:36:51 -07:00
Hongyon Suauthai
ed465b9918 [flang] Remove unintended change.
Original-commit: flang-compiler/f18@a545cd5de4
Reviewed-on: https://github.com/flang-compiler/f18/pull/96
Tree-same-pre-rewrite: false
2018-06-01 11:54:43 -07:00
Hongyon Suauthai
e2c8c21390 [flang] Fix space in issue unparse.cc between directive and its first clause.
Original-commit: flang-compiler/f18@d9478c1a59
Reviewed-on: https://github.com/flang-compiler/f18/pull/96
Tree-same-pre-rewrite: false
2018-06-01 11:47:24 -07:00
Hongyon Suauthai
9914f221bd [flang] update unparsing openmp directives and clauses.
Original-commit: flang-compiler/f18@76121cda6c
Reviewed-on: https://github.com/flang-compiler/f18/pull/96
Tree-same-pre-rewrite: false
2018-06-01 11:15:32 -07:00
Hongyon Suauthai
1bfb843a29 [flang] Update unparse.cc and move declarative directives for now.
Original-commit: flang-compiler/f18@d79503f98f
Reviewed-on: https://github.com/flang-compiler/f18/pull/96
Tree-same-pre-rewrite: false
2018-06-01 10:40:13 -07:00