[PATCH] D127564: [lld-macho] Add support for -w
Keith Smiley via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 11 17:39:55 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7d57c69826a6: [lld-macho] Add support for -w (authored by keith).
Changed prior to commit:
https://reviews.llvm.org/D127564?vs=436120&id=436172#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127564/new/
https://reviews.llvm.org/D127564
Files:
lld/Common/ErrorHandler.cpp
lld/MachO/DriverUtils.cpp
lld/MachO/Options.td
lld/include/lld/Common/ErrorHandler.h
lld/test/MachO/fatal-warnings.s
Index: lld/test/MachO/fatal-warnings.s
===================================================================
--- lld/test/MachO/fatal-warnings.s
+++ lld/test/MachO/fatal-warnings.s
@@ -6,6 +6,12 @@
# RUN: not %no-fatal-warnings-lld %t1.o -fatal_warnings -o /dev/null \
# RUN: -single_module 2>&1 | FileCheck -check-prefix=ERROR %s
+# RUN: %no-fatal-warnings-lld %t1.o -w -o /dev/null -single_module 2>&1 \
+# RUN: | count 0
+# RUN: not %no-fatal-warnings-lld %t1.o -fatal_warnings -w -o /dev/null \
+# RUN: -single_module 2>&1 \
+# RUN: | FileCheck --check-prefix=ERROR %s
+
# ERROR: error: Option `-single_module' is deprecated
# WARNING: warning: Option `-single_module' is deprecated
Index: lld/include/lld/Common/ErrorHandler.h
===================================================================
--- lld/include/lld/Common/ErrorHandler.h
+++ lld/include/lld/Common/ErrorHandler.h
@@ -101,6 +101,7 @@
StringRef logName = "lld";
bool exitEarly = true;
bool fatalWarnings = false;
+ bool suppressWarnings = false;
bool verbose = false;
bool vsDiagnostics = false;
bool disableOutput = false;
Index: lld/MachO/Options.td
===================================================================
--- lld/MachO/Options.td
+++ lld/MachO/Options.td
@@ -887,7 +887,6 @@
Group<grp_rare>;
def w : Flag<["-"], "w">,
HelpText<"Suppress all warnings">,
- Flags<[HelpHidden]>,
Group<grp_rare>;
def final_output : Separate<["-"], "final_output">,
MetaVarName<"<name>">,
Index: lld/MachO/DriverUtils.cpp
===================================================================
--- lld/MachO/DriverUtils.cpp
+++ lld/MachO/DriverUtils.cpp
@@ -87,6 +87,7 @@
// Handle -fatal_warnings early since it converts missing argument warnings
// to errors.
errorHandler().fatalWarnings = args.hasArg(OPT_fatal_warnings);
+ errorHandler().suppressWarnings = args.hasArg(OPT_w);
if (missingCount)
error(Twine(args.getArgString(missingIndex)) + ": missing argument");
Index: lld/Common/ErrorHandler.cpp
===================================================================
--- lld/Common/ErrorHandler.cpp
+++ lld/Common/ErrorHandler.cpp
@@ -242,6 +242,9 @@
return;
}
+ if (suppressWarnings)
+ return;
+
std::lock_guard<std::mutex> lock(mu);
reportDiagnostic(getLocation(msg), Colors::MAGENTA, "warning", msg);
sep = getSeparator(msg);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127564.436172.patch
Type: text/x-patch
Size: 2403 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220612/30da5d41/attachment.bin>
More information about the llvm-commits
mailing list