Skip to content

Commit e4f2bbf

Browse files
committed
SILDynamicCastInst: replace getAs(SILNode *) with getAs(SILInstruction *)
A small cleanup, NFC
1 parent 5dab47c commit e4f2bbf

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

include/swift/SIL/DynamicCasts.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,14 @@ struct SILDynamicCastInst {
158158
SILDynamicCastInst(ID *i) : inst(i) {}
159159
#include "swift/SIL/SILNodes.def"
160160

161-
static SILDynamicCastInst getAs(SILNode *node) {
162-
auto *i = dyn_cast<SILInstruction>(node);
163-
if (!i)
164-
return SILDynamicCastInst();
165-
auto kind = SILDynamicCastKind::fromNodeKind(i->getKind());
161+
static SILDynamicCastInst getAs(SILInstruction *inst) {
162+
auto kind = SILDynamicCastKind::fromNodeKind(inst->getKind());
166163
if (!kind)
167164
return SILDynamicCastInst();
168165
switch (kind.getValue()) {
169166
#define DYNAMICCAST_INST(ID, PARENT) \
170167
case SILDynamicCastKind::ID: \
171-
return SILDynamicCastInst(cast<ID>(node));
168+
return SILDynamicCastInst(cast<ID>(inst));
172169
#include "swift/SIL/SILNodes.def"
173170
}
174171
}

0 commit comments

Comments
 (0)