[PATCH] D56063: [llvm-nm] Allow --size-sort to print symbols with only Symbol size

Saurabh Badhwar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 16 06:42:13 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL351347: [llvm-nm] Allow --size-sort to print symbols with only Symbol size (authored by h4xr, committed by ).

Repository:
  rL LLVM

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

https://reviews.llvm.org/D56063

Files:
  llvm/trunk/test/tools/llvm-nm/X86/size-sort.test
  llvm/trunk/tools/llvm-nm/llvm-nm.cpp


Index: llvm/trunk/test/tools/llvm-nm/X86/size-sort.test
===================================================================
--- llvm/trunk/test/tools/llvm-nm/X86/size-sort.test
+++ llvm/trunk/test/tools/llvm-nm/X86/size-sort.test
@@ -0,0 +1,12 @@
+# RUN: llvm-nm --size-sort %p/Inputs/hello.obj.elf-x86_64 | FileCheck --check-prefix=SIZE-SORT-NO-ADDR %s
+# RUN: llvm-nm --size-sort -S %p/Inputs/hello.obj.elf-x86_64 | FileCheck --check-prefix=SIZE-SORT-PRINT-ADDR %s
+# RUN: llvm-nm -S %p/Inputs/hello.obj.elf-x86_64 | FileCheck --check-prefix=NO-SIZE-SORT-PRINT-ADDR %s
+
+# SIZE-SORT-NO-ADDR:                  U puts
+# SIZE-SORT-NO-ADDR: 0000000000000015 T main
+
+# SIZE-SORT-PRINT-ADDR:                                   U puts
+# SIZE-SORT-PRINT-ADDR: 0000000000000000 0000000000000015 T main
+
+# NO-SIZE-SORT-PRINT-ADDR: 0000000000000000 0000000000000015 T main
+# NO-SIZE-SORT-PRINT-ADDR:                                   U puts
Index: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
===================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp
@@ -798,8 +798,7 @@
     bool Global = SymFlags & SymbolRef::SF_Global;
     bool Weak = SymFlags & SymbolRef::SF_Weak;
     if ((!Undefined && UndefinedOnly) || (Undefined && DefinedOnly) ||
-        (!Global && ExternalOnly) || (SizeSort && !PrintAddress) ||
-        (Weak && NoWeakSymbols))
+        (!Global && ExternalOnly) || (Weak && NoWeakSymbols))
       continue;
     if (PrintFileName)
       writeFileName(outs());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56063.182033.patch
Type: text/x-patch
Size: 1562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190116/5da3116d/attachment.bin>


More information about the llvm-commits mailing list