This is an archive of the discontinued LLVM Phabricator instance.

[flang] Support PDT declaration with initial comp value in internal procedure
ClosedPublic

Authored by jeanPerier on Jun 14 2022, 3:35 AM.

Details

Summary

Lowering was crashing with "fatal internal error: node has not been analyzed"
if a PDT with initial component value was defined inside an internal
procedure. This is because the related expression cannot be analyzed
without the component values (which happens at the instatiation).
These expression do not need to be visited (the instantiations, if any
will be). Use the form of GetExpr that tolerates the parse tree expression
to not be analyzed into an evaluate::Expr when looking through the
symbols used in an internal procedure.

Note that the PDTs TODO will then fire (it happens after the PFT
analysis) as expected if the derived type is used.

Diff Detail