[PATCH] D148654: Modify BoundsSan to improve debuggability
Oskar Wirga via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 13 13:10:08 PDT 2023
oskarwirga added inline comments.
================
Comment at: clang/lib/CodeGen/CGExpr.cpp:3576-3597
+ if (TrapBBs.size() <= CheckHandlerID)
+ TrapBBs.resize(CheckHandlerID + 1);
+ llvm::BasicBlock *&TrapBB = TrapBBs[CheckHandlerID];
+
+ if (!CGM.getCodeGenOpts().OptimizationLevel || !TrapBB ||
+ (CurCodeDecl && CurCodeDecl->hasAttr<OptimizeNoneAttr>())) {
+ TrapBB = createBasicBlock("trap");
----------------
vitalybuka wrote:
> looks like a lot of code duplication
Let me refactor this
================
Comment at: clang/lib/CodeGen/CGExpr.cpp:3594
+ TrapCall->addFnAttr(A);
+ }
+ TrapCall->setDoesNotReturn();
----------------
vitalybuka wrote:
> wouldn't be you issues solved with
> TrapCall->setCannotMerge() here?
ubsantrap gets lowered to an instruction in MIR which then gets merged later. This was the only way I was able to create unique instruction per check.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148654/new/
https://reviews.llvm.org/D148654
More information about the llvm-commits
mailing list