[llvm] r292706 - llvm-cxxfilt: support the `-s` option

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 18:36:26 PST 2017


Author: compnerd
Date: Fri Jan 20 20:36:26 2017
New Revision: 292706

URL: http://llvm.org/viewvc/llvm-project?rev=292706&view=rev
Log:
llvm-cxxfilt: support the `-s` option

This is a stub implementation of the `-s` or `--format` option that
allows the user to specify the demangling style.  Since we only support
the Itanium (GNU) style demangling, auto is synonymous with `gnu`.
Simply swallow the option to permit some level of commandline
compatibility.

Modified:
    llvm/trunk/tools/llvm-cxxfilt/llvm-cxxfilt.cpp

Modified: llvm/trunk/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxfilt/llvm-cxxfilt.cpp?rev=292706&r1=292705&r2=292706&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cxxfilt/llvm-cxxfilt.cpp (original)
+++ llvm/trunk/tools/llvm-cxxfilt/llvm-cxxfilt.cpp Fri Jan 20 20:36:26 2017
@@ -17,6 +17,25 @@
 
 using namespace llvm;
 
+enum Style {
+  Auto,  ///< auto-detect mangling
+  GNU,   ///< GNU
+  Lucid, ///< Lucid compiler (lcc)
+  ARM,
+  HP,    ///< HP compiler (xCC)
+  EDG,   ///< EDG compiler
+  GNUv3, ///< GNU C++ v3 ABI
+  Java,  ///< Java (gcj)
+  GNAT   ///< ADA copiler (gnat)
+};
+static cl::opt<Style>
+    Format("format", cl::desc("decoration style"),
+           cl::values(clEnumValN(Auto, "auto", "auto-detect style"),
+                      clEnumValN(GNU, "gnu", "GNU (itanium) style")),
+           cl::init(Auto));
+static cl::alias FormatShort("s", cl::desc("alias for --format"),
+                             cl::aliasopt(Format));
+
 static cl::opt<bool>
     Types("types",
           cl::desc("attempt to demangle types as well as function names"),




More information about the llvm-commits mailing list