summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/test/tools/llvm-cxxfilt/coff-import.test5
-rw-r--r--llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp6
2 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-cxxfilt/coff-import.test b/llvm/test/tools/llvm-cxxfilt/coff-import.test
new file mode 100644
index 00000000000..35494d7a832
--- /dev/null
+++ b/llvm/test/tools/llvm-cxxfilt/coff-import.test
@@ -0,0 +1,5 @@
+RUN: llvm-cxxfilt -_ ___imp__ZSt6futureIvE | FileCheck %s
+RUN: llvm-cxxfilt __imp__ZSt6futureIvE | FileCheck %s
+
+CHECK: import thunk for std::future<void>
+
diff --git a/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp b/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
index 8be2a6d3b45..13024fbeaea 100644
--- a/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud