Skip to content

Commit f435a7e

Browse files
author
Zachary Turner
committed
Add a Microsoft Demangler.
This adds initial support for a demangling library (LLVMDemangle) and tool (llvm-undname) for demangling Microsoft names. This doesn't cover 100% of cases and there are some known limitations which I intend to address in followup patches, at least until such time that we have (near) 100% test coverage matching up with all of the test cases in clang/test/CodeGenCXX/mangle-ms-*. Differential Revision: https://reviews.llvm.org/D49552 llvm-svn: 337584
1 parent 2628620 commit f435a7e

File tree

10 files changed

+2259
-2
lines changed

10 files changed

+2259
-2
lines changed

llvm/include/llvm/Demangle/Demangle.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace llvm {
1616
/// The mangled_name is demangled into buf and returned. If the buffer is not
1717
/// large enough, realloc is used to expand it.
1818
///
19-
/// The *status will be set to a value from the enumeration
19+
/// The *status will be set to a value from the following enumeration
2020
enum : int {
2121
demangle_unknown_error = -4,
2222
demangle_invalid_args = -3,
@@ -27,6 +27,8 @@ enum : int {
2727

2828
char *itaniumDemangle(const char *mangled_name, char *buf, size_t *n,
2929
int *status);
30+
char *microsoftDemangle(const char *mangled_name, char *buf, size_t *n,
31+
int *status);
3032

3133
/// "Partial" demangler. This supports demangling a string into an AST
3234
/// (typically an intermediate stage in itaniumDemangle) and querying certain

llvm/lib/Demangle/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
add_llvm_library(LLVMDemangle
22
ItaniumDemangle.cpp
3-
3+
MicrosoftDemangle.cpp
4+
45
ADDITIONAL_HEADER_DIRS
56
"${LLVM_MAIN_INCLUDE_DIR}/llvm/Demangle"
67
)

0 commit comments

Comments
 (0)