Skip to content

Commit c1da456

Browse files
committed
fixup! [SandboxIR] Implement AllocaInst
Remove redundant cast<AllocaInst>(this).
1 parent f5b9bb3 commit c1da456

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

llvm/lib/SandboxIR/SandboxIR.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,32 +1241,28 @@ AllocaInst *AllocaInst::create(Type *Ty, unsigned AddrSpace,
12411241
void AllocaInst::setAllocatedType(Type *Ty) {
12421242
auto &Tracker = Ctx.getTracker();
12431243
if (Tracker.isTracking())
1244-
Tracker.track(std::make_unique<AllocaSetAllocatedType>(
1245-
cast<AllocaInst>(this), Tracker));
1244+
Tracker.track(std::make_unique<AllocaSetAllocatedType>(this, Tracker));
12461245
cast<llvm::AllocaInst>(Val)->setAllocatedType(Ty);
12471246
}
12481247

12491248
void AllocaInst::setAlignment(Align Align) {
12501249
auto &Tracker = Ctx.getTracker();
12511250
if (Tracker.isTracking())
1252-
Tracker.track(
1253-
std::make_unique<AllocaSetAlignment>(cast<AllocaInst>(this), Tracker));
1251+
Tracker.track(std::make_unique<AllocaSetAlignment>(this, Tracker));
12541252
cast<llvm::AllocaInst>(Val)->setAlignment(Align);
12551253
}
12561254

12571255
void AllocaInst::setUsedWithInAlloca(bool V) {
12581256
auto &Tracker = Ctx.getTracker();
12591257
if (Tracker.isTracking())
1260-
Tracker.track(std::make_unique<AllocaSetUsedWithInAlloca>(
1261-
cast<AllocaInst>(this), Tracker));
1258+
Tracker.track(std::make_unique<AllocaSetUsedWithInAlloca>(this, Tracker));
12621259
cast<llvm::AllocaInst>(Val)->setUsedWithInAlloca(V);
12631260
}
12641261

12651262
void AllocaInst::setSwiftError(bool V) {
12661263
auto &Tracker = Ctx.getTracker();
12671264
if (Tracker.isTracking())
1268-
Tracker.track(
1269-
std::make_unique<AllocaSetSwiftError>(cast<AllocaInst>(this), Tracker));
1265+
Tracker.track(std::make_unique<AllocaSetSwiftError>(this, Tracker));
12701266
cast<llvm::AllocaInst>(Val)->setSwiftError(V);
12711267
}
12721268

0 commit comments

Comments
 (0)