This is an archive of the discontinued LLVM Phabricator instance.

[flang][NFC] Simplify mapSymbolAttributes in symbol lowering
ClosedPublic

Authored by jeanPerier on Oct 17 2022, 2:41 AM.

Details

Summary

mapSymbolAttributes currently has a lot of very similar code for
each kind of explicit shape and scalar symbols.

Refactor it so that the change to lower symbols with fir.declare
can be added in centralized places instead of being scattered.
This is a preparation patch and fir.declare is not yet added.

Diff Detail

Event Timeline

jeanPerier created this revision.Oct 17 2022, 2:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 17 2022, 2:41 AM
jeanPerier requested review of this revision.Oct 17 2022, 2:41 AM
clementval accepted this revision.Oct 17 2022, 4:44 AM

LGTM. You need a clang-format on ConvertVariable.cpp

This revision is now accepted and ready to land.Oct 17 2022, 4:44 AM

Clang-format fix

PeteSteinfeld accepted this revision.Oct 17 2022, 7:31 AM

All builds and tests correctly and looks good.

Prevent re-instantiation of global symbols (instantiateVariable may be called
several times on the same symbol in some cases with namelists).