This is an archive of the discontinued LLVM Phabricator instance.

[flang] (NFC) Expose internal idiom as utility API
ClosedPublic

Authored by klausler on May 12 2021, 12:11 PM.

Details

Summary

Add overloads to AsGenericExpr() in Evaluate/tools.h to take care
of wrapping an untyped DataRef or bare Symbol in a typed Designator
wrapped up in a generic Expr<SomeType>. Use the new overloads to
replace a few instances of code that was calling TypedWrapper<>()
with a dynamic type.

This new tool will be useful in lowering to drive some code that
works with typed expressions (viz., list-directed I/O list items)
when starting with only a bare Symbol (viz., NAMELIST).

Diff Detail

Event Timeline

klausler created this revision.May 12 2021, 12:11 PM
klausler requested review of this revision.May 12 2021, 12:11 PM
PeteSteinfeld accepted this revision.May 12 2021, 12:41 PM

All builds, tests, and looks good.

I saw new diffs in check-declarations.cpp and expression.cpp, but they weren't related to your changes.

This revision is now accepted and ready to land.May 12 2021, 12:41 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2021, 11:19 AM