Skip to content

Commit 5d4b915

Browse files
committed
[SIL] Marked visitTransitiveIncomingPhis const.
1 parent f89ec4b commit 5d4b915

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/swift/SIL/SILArgument.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ class SILPhiArgument : public SILArgument {
291291
///
292292
/// Returns false when called on a non-phi and when the visitor returns false.
293293
bool visitTransitiveIncomingPhiOperands(
294-
function_ref<bool(SILPhiArgument *, Operand *)> visitor);
294+
function_ref<bool(SILPhiArgument *, Operand *)> visitor) const;
295295

296296
/// Returns true if we were able to find a single terminator operand value for
297297
/// each predecessor of this arguments basic block. The found values are

lib/SIL/IR/SILArgument.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,12 @@ bool SILPhiArgument::getIncomingPhiValues(
227227
}
228228

229229
bool SILPhiArgument::visitTransitiveIncomingPhiOperands(
230-
function_ref<bool(SILPhiArgument *, Operand *)> visitor) {
230+
function_ref<bool(SILPhiArgument *, Operand *)> visitor) const {
231231
if (!isPhi())
232232
return false;
233233

234234
GraphNodeWorklist<SILPhiArgument *, 4> worklist;
235-
worklist.initialize(this);
235+
worklist.insert(const_cast<SILPhiArgument *>(this));
236236

237237
while (auto *argument = worklist.pop()) {
238238
SmallVector<Operand *> operands;

0 commit comments

Comments
 (0)