summaryrefslogtreecommitdiff
path: root/tools/llvm-cxxfilt
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-03-22 21:15:19 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-03-22 21:15:19 +0000
commit0010ede8d54fb84609c814a937806c6a0063c0bc (patch)
tree6e7fc64d25bf4769d1996e4184f143a6499dbb26 /tools/llvm-cxxfilt
parent5db3fb7fb6c4bddc245b83db3b509a575eca83b9 (diff)
c++filt: support COFF import thunks
The synthetic thunk for the import is prefixed with __imp_. Attempt to undecorate the names when they begin with the __imp_ prefix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298550 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-cxxfilt')
-rw-r--r--tools/llvm-cxxfilt/llvm-cxxfilt.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/llvm-cxxfilt/llvm-cxxfilt.cpp b/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
index 8be2a6d3b45..13024fbeaea 100644
--- a/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
+++ b/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
@@ -68,6 +68,12 @@ static void demangle(llvm::raw_ostream &OS, const std::string &Mangled) {
(DecoratedLength >= 4 && strncmp(Decorated, "___Z", 4) == 0)))
Undecorated = itaniumDemangle(Decorated, nullptr, nullptr, &Status);
+ if (!Undecorated &&
+ (DecoratedLength > 6 && strncmp(Decorated, "__imp_", 6) == 0)) {
+ OS << "import thunk for ";
+ Undecorated = itaniumDemangle(Decorated + 6, nullptr, nullptr, &Status);
+ }
+
OS << (Undecorated ? Undecorated : Mangled) << '\n';
free(Undecorated);