[clang] Add support for builtin_verbose_trap (PR #79230)

Adrian Prantl via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 1 12:29:34 PST 2024


================
@@ -3424,6 +3443,26 @@ llvm::DIMacroFile *CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent,
   return DBuilder.createTempMacroFile(Parent, Line, FName);
 }
 
+llvm::DILocation *
+CGDebugInfo::CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation,
+                                         StringRef FailureMsg) {
+  // Create a debug location from `TrapLocation` that adds an artificial inline
+  // frame.
+  const char *Prefix = "__llvm_verbose_trap";
+  SmallString<64> FuncName(Prefix);
+  if (!FailureMsg.empty()) {
+    // A space in the function name identifies this as not being a real function
+    // because it's not a valid symbol name.
----------------
adrian-prantl wrote:

I don't think this comment is true (or necessary). Objective-C methods have spaces in them, for example. I would just remove the comment.

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


More information about the cfe-commits mailing list