[AllocBoxToStack] Use SILBUilderWithScope instead of SILBuilder.

It's the correct thing to do, as we immediately switch the current
debug scope. In this case, it's NFC as the code was already doing
the right thing, but this is more concise/harder to get wrong.
This commit is contained in:
Davide Italiano
2018-01-21 13:18:34 -08:00
parent 6f25962f50
commit 3c9fa1627c

View File

@@ -470,8 +470,7 @@ static bool rewriteAllocBoxAsAllocStack(AllocBoxInst *ABI) {
// Promote this alloc_box to an alloc_stack. Insert the alloc_stack
// at the beginning of the function.
SILBuilder Builder(ABI);
Builder.setCurrentDebugScope(ABI->getDebugScope());
SILBuilderWithScope Builder(ABI);
assert(ABI->getBoxType()->getLayout()->getFields().size() == 1
&& "rewriting multi-field box not implemented");
auto *ASI = Builder.createAllocStack(