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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 16 02:04:28 PST 2019


jhenderson added a comment.

I had a look at an option to disable demangling, as I worked on PR40054, but didn't come up with a clean way of handling both --demangle and --no-demangle, using the cl interface. There, I decided to abandon it, as demangling will be off by default, so we don't need to explicitly disable it. Here is different, because demangling is on by default (and the --demangle switch needs to exist for GNU compatibility). Using tablegen would make it possible to have both sensibly (see examples in e.g. LLD), but I don't think we should do that at this point.

Usually speaking in command-line tools, if there are both positive and negative versions of the option (e.g. --demangle and --no-demangle), the last one present on the command-line takes precedence, so I'd see if there's an API for that. If not, or it's not easy to use, you could probably just emit an error if both are specified.



================
Comment at: test/DebugInfo/llvm-symbolizer.test:215
 RUN:    | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME
+RUN: llvm-symbolizer --functions=short -no-demangle < %t.input7 \
+RUN:    | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME
----------------
Nit: use double dash to match other options in this file.


================
Comment at: tools/llvm-symbolizer/llvm-symbolizer.cpp:66
+ClNoDemangle("no-demangle", cl::desc("Alias for -demangle=false"),
+             cl::NotHidden);
 
----------------
You don't need the cl::NotHidden here, as it is not a true alias option.

This should probably have an explicit cl::init(false), to "match" the ClDemangle option.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56773/new/

https://reviews.llvm.org/D56773





More information about the llvm-commits mailing list