[llvm] r357676 - [llvm-symbolizer] Allow more flexible usage of -e.
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 4 01:45:06 PDT 2019
Author: ikudrin
Date: Thu Apr 4 01:45:06 2019
New Revision: 357676
URL: http://llvm.org/viewvc/llvm-project?rev=357676&view=rev
Log:
[llvm-symbolizer] Allow more flexible usage of -e.
addr2line allows -e to be grouped with other options; it also allows it
to prefix the value. Thus, all the following usages are possible:
* addr2line -f -e <bin> <addr>
* addr2line -fe <bin> <addr>
* addr2line -f e<bin> <addr>
* addr2line -fe<bin> <addr>
This patch adds the same for llvm-symbolizer.
Differential Revision: https://reviews.llvm.org/D60196
Modified:
llvm/trunk/test/tools/llvm-symbolizer/basic.s
llvm/trunk/test/tools/llvm-symbolizer/flag-grouping.test
llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp
Modified: llvm/trunk/test/tools/llvm-symbolizer/basic.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-symbolizer/basic.s?rev=357676&r1=357675&r2=357676&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-symbolizer/basic.s (original)
+++ llvm/trunk/test/tools/llvm-symbolizer/basic.s Thu Apr 4 01:45:06 2019
@@ -17,7 +17,9 @@ foo:
# Check --obj aliases --exe, -e
# RUN: llvm-symbolizer 0xa 0xb --exe=%t.o | FileCheck %s
+# RUN: llvm-symbolizer 0xa 0xb -e %t.o | FileCheck %s
# RUN: llvm-symbolizer 0xa 0xb -e=%t.o | FileCheck %s
+# RUN: llvm-symbolizer 0xa 0xb -e%t.o | FileCheck %s
# CHECK: basic.s:5:0
# CHECK: basic.s:6:0
Modified: llvm/trunk/test/tools/llvm-symbolizer/flag-grouping.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-symbolizer/flag-grouping.test?rev=357676&r1=357675&r2=357676&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-symbolizer/flag-grouping.test (original)
+++ llvm/trunk/test/tools/llvm-symbolizer/flag-grouping.test Thu Apr 4 01:45:06 2019
@@ -1,4 +1,7 @@
RUN: llvm-symbolizer -apCi -obj=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s
+RUN: llvm-symbolizer -apCie %p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s
+RUN: llvm-symbolizer -apCie=%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s
+RUN: llvm-symbolizer -apCie%p/Inputs/addr.exe < %p/Inputs/addr.inp | FileCheck %s
CHECK: some text
CHECK: 0x40054d: inctwo
Modified: llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp?rev=357676&r1=357675&r2=357676&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp (original)
+++ llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp Thu Apr 4 01:45:06 2019
@@ -94,10 +94,9 @@ ClBinaryName("obj", cl::init(""),
static cl::alias
ClBinaryNameAliasExe("exe", cl::desc("Alias for -obj"),
cl::NotHidden, cl::aliasopt(ClBinaryName));
-static cl::alias
-ClBinaryNameAliasE("e", cl::desc("Alias for -obj"),
- cl::NotHidden, cl::aliasopt(ClBinaryName));
-
+static cl::alias ClBinaryNameAliasE("e", cl::desc("Alias for -obj"),
+ cl::NotHidden, cl::Grouping, cl::Prefix,
+ cl::aliasopt(ClBinaryName));
static cl::opt<std::string>
ClDwpName("dwp", cl::init(""),
More information about the llvm-commits
mailing list