From: Kevin Enderby Date: Thu, 3 Jul 2014 18:18:50 +0000 (+0000) Subject: Add the -U flag to llvm-nm as an alias to -defined-only X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=acaaf903e85238f06d48569c8de6f99343398b21;p=platform%2Fupstream%2Fllvm.git Add the -U flag to llvm-nm as an alias to -defined-only as darwin’s nm(1) uses -U for this functionality. llvm-svn: 212280 --- diff --git a/llvm/test/Object/nm-trivial-object.test b/llvm/test/Object/nm-trivial-object.test index a1b8a30..09642e1 100644 --- a/llvm/test/Object/nm-trivial-object.test +++ b/llvm/test/Object/nm-trivial-object.test @@ -12,6 +12,8 @@ RUN: llvm-nm %p/Inputs/absolute.elf-x86-64 \ 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 diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index 64aae5e..0264b70 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -73,6 +73,8 @@ cl::alias DynamicSyms2("D", cl::desc("Alias for --dynamic"), cl::opt DefinedOnly("defined-only", cl::desc("Show only defined symbols")); +cl::alias DefinedOnly2("U", cl::desc("Alias for --defined-only"), + cl::aliasopt(DefinedOnly)); cl::opt ExternalOnly("extern-only", cl::desc("Show only external symbols"));