[Lldb-commits] [clang] [lldb] [UBSan][BoundsSafety] Implement support for more expressive "trap reasons" (PR #154618)

via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 20 20:22:28 PDT 2025


================
@@ -1824,6 +1825,12 @@ class CodeGenModule : public CodeGenTypeCache {
     return PAlign;
   }
 
+  /// Helper function to construct a RuntimeTrapDiagnosticBuilder
+  [[nodiscard]] std::unique_ptr<RuntimeTrapDiagnosticBuilder>
+  RuntimeDiag(unsigned DiagID) {
+    return std::make_unique<RuntimeTrapDiagnosticBuilder>(&getDiags(), DiagID);
+  }
+
----------------
Sirraide wrote:

We don’t usually heap-allocate these; is there any reason to not just return a `RuntimeTrapDiagnosticBuilder` directly?

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


More information about the lldb-commits mailing list