Skip to content

Commit

Permalink
Add a Microsoft Demangler.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Zachary Turner committed Jul 20, 2018
1 parent 2628620 commit f435a7e
Show file tree
Hide file tree
Showing 10 changed files with 2,259 additions and 2 deletions.
4 changes: 3 additions & 1 deletion llvm/include/llvm/Demangle/Demangle.h
Expand Up @@ -16,7 +16,7 @@ namespace llvm {
/// The mangled_name is demangled into buf and returned. If the buffer is not
/// large enough, realloc is used to expand it.
///
/// The *status will be set to a value from the enumeration
/// The *status will be set to a value from the following enumeration
enum : int {
demangle_unknown_error = -4,
demangle_invalid_args = -3,
Expand All @@ -27,6 +27,8 @@ enum : int {

char *itaniumDemangle(const char *mangled_name, char *buf, size_t *n,
int *status);
char *microsoftDemangle(const char *mangled_name, char *buf, size_t *n,
int *status);

/// "Partial" demangler. This supports demangling a string into an AST
/// (typically an intermediate stage in itaniumDemangle) and querying certain
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Demangle/CMakeLists.txt
@@ -1,6 +1,7 @@
add_llvm_library(LLVMDemangle
ItaniumDemangle.cpp

MicrosoftDemangle.cpp

ADDITIONAL_HEADER_DIRS
"${LLVM_MAIN_INCLUDE_DIR}/llvm/Demangle"
)

0 comments on commit f435a7e

Please sign in to comment.