Page MenuHomePhabricator

[CloneFunction][DebugInfo] Avoid cloning DILexicalBlocks of inlined subprograms
ClosedPublic

Authored by krisb on Jun 6 2022, 5:15 AM.

Details

Summary

If DISubpogram was not cloned (e.g. we are cloning a function that has other
functions inlined into it, and subprograms of the inlined functions are
not supposed to be cloned), it doesn't make sense to clone its DILexicalBlocks
as well. Otherwise we'll get duplicated DILexicalBlocks that may confuse
debug info emission in AsmPrinter.

I believe it also makes no sense cloning any DILocalVariables or maybe
other local entities, if their parent subprogram was not cloned, cause
they will be dangling and will not participate in futher emission.

Diff Detail

Event Timeline

krisb created this revision.Jun 6 2022, 5:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 5:15 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
krisb requested review of this revision.Jun 6 2022, 5:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 5:15 AM
aprantl accepted this revision.Jun 17 2022, 2:20 PM

Seems reasonable!

This revision is now accepted and ready to land.Jun 17 2022, 2:20 PM
This revision was landed with ongoing or failed builds.Jul 18 2022, 4:16 AM
This revision was automatically updated to reflect the committed changes.