[lld] r274723 - Do not call warning() from ELFOptTable::parse().
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 6 18:58:04 PDT 2016
Author: ruiu
Date: Wed Jul 6 20:58:04 2016
New Revision: 274723
URL: http://llvm.org/viewvc/llvm-project?rev=274723&view=rev
Log:
Do not call warning() from ELFOptTable::parse().
warning() depends on Config->FatalWarnings, so we don't want to call
that function before we initialize that member.
Modified:
lld/trunk/ELF/Config.h
lld/trunk/ELF/DriverUtils.cpp
lld/trunk/test/ELF/driver.test
Modified: lld/trunk/ELF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Config.h?rev=274723&r1=274722&r2=274723&view=diff
==============================================================================
--- lld/trunk/ELF/Config.h (original)
+++ lld/trunk/ELF/Config.h Wed Jul 6 20:58:04 2016
@@ -81,7 +81,7 @@ struct Configuration {
bool EhFrameHdr;
bool EnableNewDtags;
bool ExportDynamic;
- bool FatalWarnings = false;
+ bool FatalWarnings;
bool GcSections;
bool GnuHash = false;
bool ICF;
Modified: lld/trunk/ELF/DriverUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/DriverUtils.cpp?rev=274723&r1=274722&r2=274723&view=diff
==============================================================================
--- lld/trunk/ELF/DriverUtils.cpp (original)
+++ lld/trunk/ELF/DriverUtils.cpp Wed Jul 6 20:58:04 2016
@@ -87,11 +87,8 @@ opt::InputArgList ELFOptTable::parse(Arr
"\", expected " + Twine(MissingCount) +
(MissingCount == 1 ? " argument.\n" : " arguments"));
- iterator_range<opt::arg_iterator> Unknowns = Args.filtered(OPT_UNKNOWN);
- for (auto *Arg : Unknowns)
- warning("warning: unknown argument: " + Arg->getSpelling());
- if (Unknowns.begin() != Unknowns.end())
- error("unknown argument(s) found");
+ for (auto *Arg : Args.filtered(OPT_UNKNOWN))
+ error("unknown argument: " + Arg->getSpelling());
return Args;
}
Modified: lld/trunk/test/ELF/driver.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/driver.test?rev=274723&r1=274722&r2=274723&view=diff
==============================================================================
--- lld/trunk/test/ELF/driver.test (original)
+++ lld/trunk/test/ELF/driver.test Wed Jul 6 20:58:04 2016
@@ -3,9 +3,8 @@
# RUN: not ld.lld --unknown1 --unknown2 -m foo /no/such/file -lnosuchlib \
# RUN: 2>&1 | FileCheck -check-prefix=UNKNOWN %s
-# UNKNOWN: warning: unknown argument: --unknown1
-# UNKNOWN: warning: unknown argument: --unknown2
-# UNKNOWN: unknown argument(s) found
+# UNKNOWN: unknown argument: --unknown1
+# UNKNOWN: unknown argument: --unknown2
# UNKNOWN: unknown emulation: foo
# UNKNOWN: cannot open /no/such/file
# UNKNOWN: unable to find library -lnosuchlib
More information about the llvm-commits
mailing list