================
@@ -4051,6 +4144,14 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked,
 
   llvm::BasicBlock *&TrapBB = TrapBBs[CheckHandlerID];
 
+  llvm::DILocation *TrapLocation = Builder.getCurrentDebugLocation();
+  llvm::StringRef Category = GetTrapMessageForHandler(CheckHandlerID);
+
+  if (getDebugInfo() && !Category.empty()) {
+    TrapLocation = getDebugInfo()->CreateTrapFailureMessageFor(
+        TrapLocation, Category, TrapMessage);
----------------
anthonyhatran wrote:

Yes, you are correct on that. I didn't initially intend on having the 
`TrapMessage `part there at all until I examined `CreateTrapFailureMessageFor 
`which required it, which was why I left it like so. I think a possible 
approach could be to put the `SanitizerHandler`'s name as the category, and 
have the `GetTrapMessageForHandler `deal with the `TrapMessage`, but let me 
know if it would be preferable to have it more general with "`UBSan Trap`" 
instead

https://github.com/llvm/llvm-project/pull/143758
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to