1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[llvm-symbolizer] Add -no-demangle as alias for -demangle=false

Summary: Provides -no-demangle as alias for -demangle=false. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40075

Reviewers: jhenderson, ruiu

Reviewed By: jhenderson

Subscribers: erik.pilkington, rupprecht, llvm-commits

Differential Revision: https://reviews.llvm.org/D56773

llvm-svn: 351735
This commit is contained in:
Dmitry Venikov 2019-01-21 10:00:57 +00:00
parent d4f3796eeb
commit df9b821340
3 changed files with 26 additions and 2 deletions

View File

@ -87,6 +87,10 @@ OPTIONS
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

View File

@ -214,3 +214,16 @@ RUN: llvm-symbolizer --functions=short -C=false < %t.input7 \
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()

View File

@ -54,12 +54,15 @@ static cl::opt<bool>
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 @@ int main(int argc, char **argv) {
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);