summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cxxfilt
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-cxxfilt')
-rw-r--r--llvm/tools/llvm-cxxfilt/CMakeLists.txt7
-rw-r--r--llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp29
2 files changed, 36 insertions, 0 deletions
diff --git a/llvm/tools/llvm-cxxfilt/CMakeLists.txt b/llvm/tools/llvm-cxxfilt/CMakeLists.txt
new file mode 100644
index 00000000000..4d0e5b01028
--- /dev/null
+++ b/llvm/tools/llvm-cxxfilt/CMakeLists.txt
@@ -0,0 +1,7 @@
+set(LLVM_LINK_COMPONENTS
+ Demangle
+ )
+
+add_llvm_tool(llvm-cxxfilt
+ llvm-cxxfilt.cpp
+ )
diff --git a/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp b/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
new file mode 100644
index 00000000000..d2c1ba37420
--- /dev/null
+++ b/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
@@ -0,0 +1,29 @@
+//===-- llvm-c++filt.cpp --------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Demangle/Demangle.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+using namespace llvm;
+
+int main(int argc, char **argv) {
+ for (int I = 1; I < argc; ++I) {
+ const char *Mangled = argv[I];
+ int Status;
+ char *Demangled = itaniumDemangle(Mangled, nullptr, nullptr, &Status);
+ if (Demangled)
+ printf("%s\n", Demangled);
+ else
+ printf("%s\n", Mangled);
+ free(Demangled);
+ }
+ return 0;
+}
OpenPOWER on IntegriCloud