Skip to content

Commit dd0685f

Browse files
committed
Remove BoundsChecking change (moved to
llvm#124613)
1 parent fe5e30d commit dd0685f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,14 @@ static Value *getBoundsCheckCond(Value *Ptr, Value *InstVal,
108108
return Or;
109109
}
110110

111-
static CallInst *InsertTrap(BuilderTy &IRB, bool DebugTrapBB,
112-
std::optional<int8_t> GuardKind) {
111+
static CallInst *InsertTrap(BuilderTy &IRB, bool DebugTrapBB) {
113112
if (!DebugTrapBB)
114113
return IRB.CreateIntrinsic(Intrinsic::trap, {}, {});
115-
114+
// FIXME: Ideally we would use the SanitizerHandler::OutOfBounds constant.
116115
return IRB.CreateIntrinsic(
117116
Intrinsic::ubsantrap, {},
118117
ConstantInt::get(IRB.getInt8Ty(),
119-
GuardKind.has_value()
120-
? GuardKind.value()
121-
: IRB.GetInsertBlock()->getParent()->size()));
118+
IRB.GetInsertBlock()->getParent()->size()));
122119
}
123120

124121
static CallInst *InsertCall(BuilderTy &IRB, bool MayReturn, StringRef Name) {
@@ -253,7 +250,7 @@ static bool addBoundsChecking(Function &F, TargetLibraryInfo &TLI,
253250

254251
bool DebugTrapBB = !Opts.Merge;
255252
CallInst *TrapCall = Opts.Rt ? InsertCall(IRB, Opts.Rt->MayReturn, Name)
256-
: InsertTrap(IRB, DebugTrapBB, Opts.GuardKind);
253+
: InsertTrap(IRB, DebugTrapBB);
257254
if (DebugTrapBB)
258255
TrapCall->addFnAttr(llvm::Attribute::NoMerge);
259256

0 commit comments

Comments
 (0)