[func-sig-opts] When splicing BB from one function to another, change

the debug scope of each instruction to be the debug scope of the new
function.

This will be tested by the functionality in function signature opts.

Swift SVN r22553
This commit is contained in:
Michael Gottesman
2014-10-06 23:16:52 +00:00
parent 2bb3269869
commit c97ab1f11f
2 changed files with 11 additions and 3 deletions

View File

@@ -116,6 +116,10 @@ transferNodesFromList(llvm::ilist_traits<SILBasicBlock> &SrcTraits,
if (Parent == SrcTraits.Parent) return;
// If splicing blocks not in the same function, update the parent pointers.
for (; First != Last; ++First)
for (; First != Last; ++First) {
First->Parent = Parent;
for (auto &II : *First) {
II.setDebugScope(Parent->getDebugScope());
}
}
}