[PATCH] D83152: llvm-nm: add flag to suppress no symbols warning
Keith Smiley via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 3 21:09:23 PDT 2020
keith created this revision.
keith added a reviewer: kastiglione.
Herald added subscribers: rupprecht, MaskRay.
Herald added a reviewer: jhenderson.
Herald added a project: LLVM.
This spelling is taken from Darwin's libtool, but I'm happy to use a different spelling
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D83152
Files:
llvm/test/tools/llvm-nm/X86/nm-no-symbols.test
llvm/tools/llvm-nm/llvm-nm.cpp
Index: llvm/tools/llvm-nm/llvm-nm.cpp
===================================================================
--- llvm/tools/llvm-nm/llvm-nm.cpp
+++ llvm/tools/llvm-nm/llvm-nm.cpp
@@ -153,6 +153,11 @@
cl::aliasopt(PrintSize), cl::Grouping);
bool MachOPrintSizeWarning = false;
+cl::opt<bool> NoWarningForNoSymbols(
+ "no-warning-for-no-symbols",
+ cl::desc("Don't print a warning when an object doesn't contain symbols"),
+ cl::cat(NMCat));
+
cl::opt<bool> SizeSort("size-sort", cl::desc("Sort symbols by size"),
cl::cat(NMCat));
@@ -1749,7 +1754,7 @@
CurrentFilename = Obj.getFileName();
- if (Symbols.empty() && SymbolList.empty()) {
+ if (Symbols.empty() && SymbolList.empty() && !NoWarningForNoSymbols) {
writeFileName(errs(), ArchiveName, ArchitectureName);
errs() << "no symbols\n";
}
Index: llvm/test/tools/llvm-nm/X86/nm-no-symbols.test
===================================================================
--- llvm/test/tools/llvm-nm/X86/nm-no-symbols.test
+++ llvm/test/tools/llvm-nm/X86/nm-no-symbols.test
@@ -9,3 +9,6 @@
Machine: EM_X86_64
# CHECK: [[FILE]]: no symbols{{$}}
+
+# RUN: llvm-nm -no-warning-for-no-symbols %t.o 2>&1 | FileCheck %s -DFILE=%t.o --check-prefix NO-WARNING --allow-empty
+# NO-WARNING-NOT: no symbols
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83152.275476.patch
Type: text/x-patch
Size: 1330 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200704/3f9081e5/attachment-0001.bin>
More information about the llvm-commits
mailing list