[all-commits] [llvm/llvm-project] 3ebed5: [Clang][LLDB] Refactor trap reason demangling out ...
Dan Liew via All-commits
all-commits at lists.llvm.org
Tue Nov 4 16:25:55 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 3ebed51e997b2a517eecb53a78cc0b6ffcdc00a3
https://github.com/llvm/llvm-project/commit/3ebed51e997b2a517eecb53a78cc0b6ffcdc00a3
Author: Dan Liew <dan at su-root.co.uk>
Date: 2025-11-04 (Tue, 04 Nov 2025)
Changed paths:
M clang/include/clang/CodeGen/ModuleBuilder.h
M clang/lib/CodeGen/ModuleBuilder.cpp
M clang/unittests/CodeGen/CMakeLists.txt
A clang/unittests/CodeGen/DemangleTrapReasonInDebugInfo.cpp
M lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt
M lldb/source/Plugins/LanguageRuntime/CPlusPlus/VerboseTrapFrameRecognizer.cpp
Log Message:
-----------
[Clang][LLDB] Refactor trap reason demangling out of LLDB and into Clang (#165996)
This patch refactors the trap reason demangling logic in
`lldb_private::VerboseTrapFrameRecognizer::RecognizeFrame` into a new
public function `clang::CodeGen::DemangleTrapReasonInDebugInfo`.
There are two reasons for doing this:
1. In a future patch the logic for demangling needs to be used somewhere
else in LLDB and thus the logic needs refactoring to avoid duplicating
code.
2. The logic for demangling shouldn't really be in LLDB anyway because
it's a Clang implementation detail and thus the logic really belongs
inside Clang, not LLDB.
Unit tests have been added for the new function that demonstrate how to
use the new API.
The function names recognized by VerboseTrapFrameRecognizer are
identical to before. However, this patch isn't NFC because:
* The `lldbTarget` library now links against `clangCodeGen` which it
didn't previously.
* The LLDB logging output is a little different now. The previous code
tried to log failures for an invalid regex pattern and for the
`Regex::match` API not returning the correct number of matches. These
failure conditions are unreachable via unit testing so they have been
made assertions failures inside the `DemangleTrapReasonInDebugInfo`
implementation instead of trying to log them in LLDB.
rdar://163230807
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list