llvm-project/flang/tools
peter klausler 803f1e4653 [flang] Fix spurious errors from runtime derived type table construction
Andrezj W. @ Arm discovered that the runtime derived type table
building code in semantics was detecting fatal errors in the tests
that the f18 driver wasn't printing.  This patch fixes f18 so that
these messages are printed; however, the messages were not valid user
errors, and the rest of this patch fixes them up.

There were two sources of the bogus errors.  One was that the runtime
derived type information table builder was calculating the shapes of
allocatable and pointer array components in derived types, and then
complaining that they weren't constant or LEN parameter values, which
of course they couldn't be since they have to have deferred shapes
and those bounds were expressions like LBOUND(component,dim=1).

The second was that f18 was forwarding the actual LEN type parameter
expressions of a type instantiation too far into the uses of those
parameters in various expressions in the declarations of components;
when an actual LEN type parameter is not a constant value, it needs
to remain a "bare" type parameter inquiry so that it will be lowered
to a descriptor inquiry and acquire a captured expression value.

Fixing this up properly involved: moving some code into new utility
function templates in Evaluate/tools.h, tweaking the rewriting of
conversions in expression folding to elide needless integer kind
conversions of type parameter inquiries, making type parameter
inquiry folding *not* replace bare LEN type parameters with
non-constant actual parameter values, and cleaning up some
altered test results.

Differential Revision: https://reviews.llvm.org/D101001
2021-04-22 09:43:51 -07:00
..
bbc [flang] Add clang-format files for FIR source (LLVM style) 2020-02-17 02:37:49 -08:00
f18 [flang] Fix spurious errors from runtime derived type table construction 2021-04-22 09:43:51 -07:00
f18-parse-demo [flang] Add -fsyntax-only to f18; retain -fparse-only synonym 2021-02-03 09:01:39 -08:00
fir-opt [flang][fir] Add the pre-code gen rewrite pass and codegen ops. 2021-03-24 19:27:10 -07:00
flang-driver [clang][flang] Improve the consistency of the code-base 2021-02-25 21:25:43 +08:00
tco [flang][fir] Add the pre-code gen rewrite pass and codegen ops. 2021-03-24 19:27:10 -07:00
CMakeLists.txt [flang][fir] Add fir-opt tool 2021-02-16 11:48:40 -05:00