mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-21 03:37:47 +00:00
Add hidden flag to exclude aliases from output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164158 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3b62b01f9a
commit
18505b3522
25
test/Other/llvm-nm-without-aliases.ll
Normal file
25
test/Other/llvm-nm-without-aliases.ll
Normal file
@ -0,0 +1,25 @@
|
||||
; RUN: llvm-as < %s > %t
|
||||
; RUN: llvm-nm -without-aliases < %t | FileCheck %s
|
||||
; RUN: llvm-nm < %t | FileCheck --check-prefix=WITH %s
|
||||
|
||||
; CHECK-NOT: T a0bar
|
||||
; CHECK-NOT: T a0foo
|
||||
; CHECK: T bar
|
||||
; CHECK: T foo
|
||||
|
||||
; WITH: T a0bar
|
||||
; WITH: T a0foo
|
||||
; WITH: T bar
|
||||
; WITH: T foo
|
||||
|
||||
@a0foo = alias void ()* @foo
|
||||
|
||||
define void @foo() {
|
||||
ret void
|
||||
}
|
||||
|
||||
@a0bar = alias void ()* @bar
|
||||
|
||||
define void @bar() {
|
||||
ret void
|
||||
}
|
@ -110,6 +110,9 @@ namespace {
|
||||
|
||||
cl::opt<bool> SizeSort("size-sort", cl::desc("Sort symbols by size"));
|
||||
|
||||
cl::opt<bool> WithoutAliases("without-aliases", cl::Hidden,
|
||||
cl::desc("Exclude aliases from output"));
|
||||
|
||||
bool PrintAddress = true;
|
||||
|
||||
bool MultipleFiles = false;
|
||||
@ -275,8 +278,9 @@ static void DumpSymbolNamesFromModule(Module *M) {
|
||||
std::for_each (M->begin(), M->end(), DumpSymbolNameForGlobalValue);
|
||||
std::for_each (M->global_begin(), M->global_end(),
|
||||
DumpSymbolNameForGlobalValue);
|
||||
std::for_each (M->alias_begin(), M->alias_end(),
|
||||
DumpSymbolNameForGlobalValue);
|
||||
if (!WithoutAliases)
|
||||
std::for_each (M->alias_begin(), M->alias_end(),
|
||||
DumpSymbolNameForGlobalValue);
|
||||
|
||||
SortAndPrintSymbolList();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user