[llvm] r212280 - Add the -U flag to llvm-nm as an alias to -defined-only
Kevin Enderby
enderby at apple.com
Thu Jul 3 11:18:51 PDT 2014
Author: enderby
Date: Thu Jul 3 13:18:50 2014
New Revision: 212280
URL: http://llvm.org/viewvc/llvm-project?rev=212280&view=rev
Log:
Add the -U flag to llvm-nm as an alias to -defined-only
as darwin’s nm(1) uses -U for this functionality.
Modified:
llvm/trunk/test/Object/nm-trivial-object.test
llvm/trunk/tools/llvm-nm/llvm-nm.cpp
Modified: llvm/trunk/test/Object/nm-trivial-object.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/nm-trivial-object.test?rev=212280&r1=212279&r2=212280&view=diff
==============================================================================
--- llvm/trunk/test/Object/nm-trivial-object.test (original)
+++ llvm/trunk/test/Object/nm-trivial-object.test Thu Jul 3 13:18:50 2014
@@ -12,6 +12,8 @@ RUN: llvm-nm %p/Inputs/absolute.elf-x86-
RUN: | FileCheck %s -check-prefix ABSOLUTE-ELF64
RUN: llvm-nm %p/Inputs/trivial-object-test.macho-i386 \
RUN: | FileCheck %s -check-prefix macho
+RUN: llvm-nm -U %p/Inputs/trivial-object-test.macho-i386 \
+RUN: | FileCheck %s -check-prefix macho-U
RUN: llvm-nm %p/Inputs/trivial-object-test.macho-x86-64 \
RUN: | FileCheck %s -check-prefix macho64
RUN: llvm-nm %p/Inputs/macho-text-data-bss.macho-x86_64 \
@@ -68,6 +70,10 @@ macho: U _SomeOtherFunction
macho: 00000000 T _main
macho: U _puts
+macho-U-NOT: U _SomeOtherFunction
+macho-U: 00000000 T _main
+macho-U-NOT: U _puts
+
macho64: 0000000000000028 s L_.str
macho64: U _SomeOtherFunction
macho64: 0000000000000000 T _main
Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=212280&r1=212279&r2=212280&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Thu Jul 3 13:18:50 2014
@@ -73,6 +73,8 @@ cl::alias DynamicSyms2("D", cl::desc("Al
cl::opt<bool> DefinedOnly("defined-only",
cl::desc("Show only defined symbols"));
+cl::alias DefinedOnly2("U", cl::desc("Alias for --defined-only"),
+ cl::aliasopt(DefinedOnly));
cl::opt<bool> ExternalOnly("extern-only",
cl::desc("Show only external symbols"));
More information about the llvm-commits
mailing list