Skip to content

Commit 2472f2b

Browse files
authored
Merge pull request #21584 from dcci/setdebug2
[SILInstruction] Remove unused arg in setDebugScope()
2 parents 0d4a585 + d3d7342 commit 2472f2b

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

include/swift/SIL/SILInstruction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class SILInstruction
326326
/// Update this instruction's SILDebugScope. This function should
327327
/// never be called directly. Use SILBuilder, SILBuilderWithScope or
328328
/// SILClonerWithScope instead.
329-
void setDebugScope(SILBuilder &B, const SILDebugScope *DS);
329+
void setDebugScope(const SILDebugScope *DS);
330330

331331
/// Total number of created and deleted SILInstructions.
332332
/// It is used only for collecting the compiler statistics.

lib/SIL/SILBasicBlock.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,7 @@ void SILBasicBlock::moveTo(SILBasicBlock::iterator To, SILInstruction *I) {
260260
assert(I->getParent() != this && "Must move from different basic block");
261261
InstList.splice(To, I->getParent()->InstList, I);
262262
ScopeCloner ScopeCloner(*Parent);
263-
SILBuilder B(*Parent);
264-
I->setDebugScope(B, ScopeCloner.getOrCreateClonedScope(I->getDebugScope()));
263+
I->setDebugScope(ScopeCloner.getOrCreateClonedScope(I->getDebugScope()));
265264
}
266265

267266
void
@@ -277,14 +276,12 @@ transferNodesFromList(llvm::ilist_traits<SILBasicBlock> &SrcTraits,
277276
return;
278277

279278
ScopeCloner ScopeCloner(*Parent);
280-
SILBuilder B(*Parent);
281279

282280
// If splicing blocks not in the same function, update the parent pointers.
283281
for (; First != Last; ++First) {
284282
First->Parent = Parent;
285283
for (auto &II : *First)
286-
II.setDebugScope(B,
287-
ScopeCloner.getOrCreateClonedScope(II.getDebugScope()));
284+
II.setDebugScope(ScopeCloner.getOrCreateClonedScope(II.getDebugScope()));
288285
}
289286
}
290287

lib/SIL/SILInstruction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const SILDebugScope *SILInstruction::getDebugScope() const {
4141
return Location.getScope();
4242
}
4343

44-
void SILInstruction::setDebugScope(SILBuilder &B, const SILDebugScope *DS) {
44+
void SILInstruction::setDebugScope(const SILDebugScope *DS) {
4545
if (getDebugScope() && getDebugScope()->InlinedCallSite)
4646
assert(DS->InlinedCallSite && "throwing away inlined scope info");
4747

0 commit comments

Comments
 (0)