[PATCH] D56773: [llvm-symbolizer] Add -no-demangle as alias for -demangle=false
Dmitry Venikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 21 02:01:06 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL351735: [llvm-symbolizer] Add -no-demangle as alias for -demangle=false (authored by Quolyk, committed by ).
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56773/new/
https://reviews.llvm.org/D56773
Files:
llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst
llvm/trunk/test/DebugInfo/llvm-symbolizer.test
llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp
Index: llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp
===================================================================
--- llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp
+++ llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp
@@ -54,12 +54,15 @@
ClPrintInlining("inlining", cl::init(true),
cl::desc("Print all inlined frames for a given address"));
-// -demangle, -C
+// -demangle, -C, -no-demangle
static cl::opt<bool>
ClDemangle("demangle", cl::init(true), cl::desc("Demangle function names"));
static cl::alias
ClDemangleShort("C", cl::desc("Alias for -demangle"),
cl::NotHidden, cl::aliasopt(ClDemangle));
+static cl::opt<bool>
+ClNoDemangle("no-demangle", cl::init(false),
+ cl::desc("Don't demangle function names"));
static cl::opt<std::string> ClDefaultArch("default-arch", cl::init(""),
cl::desc("Default architecture "
@@ -200,8 +203,12 @@
InitLLVM X(argc, argv);
llvm::sys::InitializeCOMRAII COM(llvm::sys::COMThreadingMode::MultiThreaded);
-
cl::ParseCommandLineOptions(argc, argv, "llvm-symbolizer\n");
+
+ // If both --demangle and --no-demangle are specified then pick the last one.
+ if (ClNoDemangle.getPosition() > ClDemangle.getPosition())
+ ClDemangle = !ClNoDemangle;
+
LLVMSymbolizer::Options Opts(ClPrintFunctions, ClUseSymbolTable, ClDemangle,
ClUseRelativeAddress, ClDefaultArch);
Index: llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst
===================================================================
--- llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst
+++ llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst
@@ -87,6 +87,10 @@
Print demangled function names. Defaults to true.
+.. option:: -no-demangle
+
+ Don't print demangled function names.
+
.. option:: -inlining
If a source code location is in an inlined function, prints all the
Index: llvm/trunk/test/DebugInfo/llvm-symbolizer.test
===================================================================
--- llvm/trunk/test/DebugInfo/llvm-symbolizer.test
+++ llvm/trunk/test/DebugInfo/llvm-symbolizer.test
@@ -214,3 +214,16 @@
RUN: | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME
SHORT_FUNCTION_NAME-NOT: _Z1cv
+
+; Check that the last of --demangle and --no-demangle wins.
+RUN: llvm-symbolizer --demangle < %t.input7 \
+RUN: | FileCheck %s --check-prefix=DEMANGLED_FUNCTION_NAME
+RUN: llvm-symbolizer --no-demangle < %t.input7 \
+RUN: | FileCheck %s --check-prefix=MANGLED_FUNCTION_NAME
+RUN: llvm-symbolizer --demangle --no-demangle < %t.input7 \
+RUN: | FileCheck %s --check-prefix=MANGLED_FUNCTION_NAME
+RUN: llvm-symbolizer --no-demangle --demangle < %t.input7 \
+RUN: | FileCheck %s --check-prefix=DEMANGLED_FUNCTION_NAME
+
+MANGLED_FUNCTION_NAME: _Z1cv
+DEMANGLED_FUNCTION_NAME: c()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56773.182757.patch
Type: text/x-patch
Size: 2883 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190121/37037caa/attachment.bin>
More information about the llvm-commits
mailing list