[llvm] [BoundsChecking] Update ubsantrap to use GuardKind (PR #124613)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 12:43:33 PST 2025


================
@@ -108,14 +108,17 @@ static Value *getBoundsCheckCond(Value *Ptr, Value *InstVal,
   return Or;
 }
 
-static CallInst *InsertTrap(BuilderTy &IRB, bool DebugTrapBB) {
+static CallInst *InsertTrap(BuilderTy &IRB, bool DebugTrapBB,
+                            std::optional<int8_t> GuardKind) {
   if (!DebugTrapBB)
----------------
thurstond wrote:

There is no precedent in CGExpr.cpp on adding the GuardKind to `Intrinsic::trap` for UBSan, hence this patch only applies to `DebugTrapBB` / `Intrinsic::ubsantrap`.

https://github.com/llvm/llvm-project/pull/124613


More information about the llvm-commits mailing list