Skip to content
Commit 90955485 authored by Tim Keith's avatar Tim Keith
Browse files

[flang] Resolve expressions in symbols

Add `LazyExpr` class to represent expressions in the symbol table.
Initially they contain a pointer to an expression in the parse tree.
After name resolution is complete and symbols are filled in in the parse
tree, `LazyExpr`s are resolved to `evaluate::Expr<evaluate::SomeType>`.
This is done by `ResolveSymbolExprs()`.

Change `Bound` and `ParamValue` to save their value as a `LazyExpr`.
Change `ObjectEntityDetails` and `TypeParamDetails` to save the initial
value as a `LazyExpr`.

Eliminate `IntExpr` and `IntConst` classes, which were just place-holders.

Add `Clone()` to `ShapeSpec`, `Bound`, `LazyExpr`. Normally they should
be moved but in `ObjectEntityDetails::set_shape()` we need to make copies.

Save type parameter values in `derivedTypeSpec_`. `typeParamValue_` is
not needed.

Write out initial values, type parameter values, and bounds to .mod files.

Evaluate parameter values in expressions.

Make some errors non-fatal so that tests can continue to pass.

Original-commit: flang-compiler/f18@b90cadfc53c6e31c5f289eadc382bc3908811b86
Reviewed-on: https://github.com/flang-compiler/f18/pull/223
Tree-same-pre-rewrite: false
parent 1466eb25
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment