[PATCH] D83152: llvm-nm: add flag to suppress no symbols warning
Keith Smiley via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 27 18:35:32 PST 2021
keith updated this revision to Diff 326942.
keith edited the summary of this revision.
keith added a comment.
Add flag to test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83152/new/
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
@@ -155,6 +155,9 @@
cl::aliasopt(PrintSize), cl::Grouping);
bool MachOPrintSizeWarning = false;
+cl::opt<bool> Quiet("quiet", cl::desc("Suppress 'no symbols' diagnostic"),
+ cl::cat(NMCat));
+
cl::opt<bool> SizeSort("size-sort", cl::desc("Sort symbols by size"),
cl::cat(NMCat));
@@ -1861,7 +1864,7 @@
CurrentFilename = Obj.getFileName();
- if (Symbols.empty() && SymbolList.empty()) {
+ if (Symbols.empty() && SymbolList.empty() && !Quiet) {
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 --quiet %t.o 2>&1 | FileCheck %s -DFILE=%t.o --check-prefix=NO-WARNING --allow-empty
+# NO-WARNING-NOT: {{.}}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83152.326942.patch
Type: text/x-patch
Size: 1230 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210228/48b4a0e0/attachment.bin>
More information about the llvm-commits
mailing list