Skip to content

Commit 6d4456c

Browse files
committed
[sil][debug-info] Add 'const' to maybeScopeless 'SILInstruction &' argument.
This function only uses the reference in a const way, so nothing changes functionally, we can just pass it into contexts where we have a const reference without fighting the compiler.
1 parent 95aeaf7 commit 6d4456c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/swift/SIL/SILDebugScope.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class SILDebugScope : public SILAllocated<SILDebugScope> {
9595
};
9696

9797
/// Determine whether an instruction may not have a SILDebugScope.
98-
bool maybeScopeless(SILInstruction &I);
98+
bool maybeScopeless(const SILInstruction &inst);
9999

100100
/// Knows how to make a deep copy of a debug scope.
101101
class ScopeCloner {

lib/SIL/IR/SILDebugScope.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ SILFunction *SILDebugScope::getParentFunction() const {
5757
}
5858

5959
/// Determine whether an instruction may not have a SILDebugScope.
60-
bool swift::maybeScopeless(SILInstruction &I) {
61-
if (I.getFunction()->isBare())
60+
bool swift::maybeScopeless(const SILInstruction &inst) {
61+
if (inst.getFunction()->isBare())
6262
return true;
63-
return !isa<DebugValueInst>(I) && !isa<DebugValueAddrInst>(I);
63+
return !isa<DebugValueInst>(inst) && !isa<DebugValueAddrInst>(inst);
6464
}

0 commit comments

Comments
 (0)