This is an archive of the discontinued LLVM Phabricator instance.

[Flang][Unit Test] Move the declaration of kindMap to the class
ClosedPublic

Authored by kiranchandramohan on Dec 13 2021, 5:52 AM.

Details

Summary

kindMap variable is declared in the Setup function but passed as
a reference to the firBuilder class. The firBuilder is declared in
the class and hence its lifetime exceeds that of kindMap. This can
lead to undefined behaviour. Move the kindMap variable into the class
to avoid this.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2021, 5:52 AM
kiranchandramohan requested review of this revision.Dec 13 2021, 5:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2021, 5:52 AM
awarzynski accepted this revision.Dec 13 2021, 7:50 AM

LGTM, thanks!

This revision is now accepted and ready to land.Dec 13 2021, 7:50 AM