[PATCH] D102514: [LLD][MinGW] Add --fatal-warnings and --no-fatal-warnings flags
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 17 00:47:26 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG84306ef9c442: [LLD][MinGW] Add --fatal-warnings and --no-fatal-warnings flags (authored by mati865, committed by mstorsjo).
Changed prior to commit:
https://reviews.llvm.org/D102514?vs=345583&id=345775#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102514/new/
https://reviews.llvm.org/D102514
Files:
lld/MinGW/Driver.cpp
lld/MinGW/Options.td
lld/test/MinGW/driver.test
Index: lld/test/MinGW/driver.test
===================================================================
--- lld/test/MinGW/driver.test
+++ lld/test/MinGW/driver.test
@@ -294,3 +294,12 @@
RUN: ld.lld -### -m i386pep foo.o -no-demangle | FileCheck -check-prefix NO-DEMANGLE %s
RUN: ld.lld -### -m i386pep foo.o --no-demangle | FileCheck -check-prefix NO-DEMANGLE %s
NO-DEMANGLE: -demangle:no
+
+RUN: ld.lld -### -m i386pep foo.o -fatal-warnings | FileCheck -check-prefix FATAL_WARNINGS %s
+RUN: ld.lld -### -m i386pep foo.o --fatal-warnings | FileCheck -check-prefix FATAL_WARNINGS %s
+FATAL_WARNINGS: -WX{{ }}
+
+RUN: ld.lld -### -m i386pep foo.o | FileCheck -check-prefix NO-FATAL_WARNINGS %s
+RUN: ld.lld -### -m i386pep foo.o -no-fatal-warnings | FileCheck -check-prefix NO-FATAL_WARNINGS %s
+RUN: ld.lld -### -m i386pep foo.o --no-fatal-warnings | FileCheck -check-prefix NO-FATAL_WARNINGS %s
+NO-FATAL_WARNINGS: -WX:no
Index: lld/MinGW/Options.td
===================================================================
--- lld/MinGW/Options.td
+++ lld/MinGW/Options.td
@@ -45,6 +45,9 @@
HelpText<"Don't automatically export any symbols">;
def export_all_symbols: F<"export-all-symbols">,
HelpText<"Export all symbols even if a def file or dllexport attributes are used">;
+defm fatal_warnings: B<"fatal-warnings",
+ "Treat warnings as errors",
+ "Do not treat warnings as errors (default)">;
defm file_alignment: Eq<"file-alignment", "Set file alignment">;
defm gc_sections: B<"gc-sections",
"Remove unused sections",
Index: lld/MinGW/Driver.cpp
===================================================================
--- lld/MinGW/Driver.cpp
+++ lld/MinGW/Driver.cpp
@@ -290,6 +290,11 @@
add("-debug:dwarf");
}
+ if (args.hasFlag(OPT_fatal_warnings, OPT_no_fatal_warnings, false))
+ add("-WX");
+ else
+ add("-WX:no");
+
if (args.hasArg(OPT_shared))
add("-dll");
if (args.hasArg(OPT_verbose))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102514.345775.patch
Type: text/x-patch
Size: 1944 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210517/23364318/attachment.bin>
More information about the llvm-commits
mailing list