This is an archive of the discontinued LLVM Phabricator instance.

[CodeExtractor] Only rewrite scope of non-inlined variables
ClosedPublic

Authored by fdeazeve on Dec 8 2022, 12:46 PM.

Details

Summary

When a dbg.value instruction for a variable V is extracted into a new
function, the scope of the underlying variable should be set to the new
function iff V was in the scope of the old function (i.e. it hadn't been
inlined). Prior to this patch, the code extractor would always update
the scope of V.

Diff Detail

Event Timeline

fdeazeve created this revision.Dec 8 2022, 12:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2022, 12:46 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
fdeazeve requested review of this revision.Dec 8 2022, 12:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2022, 12:46 PM
fdeazeve updated this revision to Diff 481427.Dec 8 2022, 1:05 PM

Remove unnecessary scope

aprantl accepted this revision.Dec 8 2022, 1:41 PM
aprantl added inline comments.
llvm/lib/Transforms/Utils/CodeExtractor.cpp
1593
This revision is now accepted and ready to land.Dec 8 2022, 1:41 PM
fdeazeve updated this revision to Diff 481857.Dec 10 2022, 7:28 AM

Addressed review comments