[lld] r329155 - [ELF] - Revert r329060 "Simplify createFiles. NFCI."
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 4 01:13:29 PDT 2018
Author: grimar
Date: Wed Apr 4 01:13:28 2018
New Revision: 329155
URL: http://llvm.org/viewvc/llvm-project?rev=329155&view=rev
Log:
[ELF] - Revert r329060 "Simplify createFiles. NFCI."
Was requested during post commit review.
Modified:
lld/trunk/ELF/Driver.cpp
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=329155&r1=329154&r2=329155&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Wed Apr 4 01:13:28 2018
@@ -879,8 +879,7 @@ static bool getBinaryOption(StringRef S)
void LinkerDriver::createFiles(opt::InputArgList &Args) {
for (auto *Arg : Args) {
- unsigned ID = Arg->getOption().getUnaliasedOption().getID();
- switch (ID) {
+ switch (Arg->getOption().getUnaliasedOption().getID()) {
case OPT_library:
addLibrary(Arg->getValue());
break;
@@ -903,19 +902,25 @@ void LinkerDriver::createFiles(opt::Inpu
error(Twine("cannot find linker script ") + Arg->getValue());
break;
case OPT_as_needed:
- case OPT_no_as_needed:
- Config->AsNeeded = (ID == OPT_as_needed);
+ Config->AsNeeded = true;
break;
case OPT_format:
InBinary = getBinaryOption(Arg->getValue());
break;
+ case OPT_no_as_needed:
+ Config->AsNeeded = false;
+ break;
case OPT_Bstatic:
+ Config->Static = true;
+ break;
case OPT_Bdynamic:
- Config->Static = (ID == OPT_Bstatic);
+ Config->Static = false;
break;
case OPT_whole_archive:
+ InWholeArchive = true;
+ break;
case OPT_no_whole_archive:
- InWholeArchive = (ID == OPT_whole_archive);
+ InWholeArchive = false;
break;
case OPT_just_symbols:
if (Optional<MemoryBufferRef> MB = readFile(Arg->getValue())) {
@@ -924,8 +929,10 @@ void LinkerDriver::createFiles(opt::Inpu
}
break;
case OPT_start_lib:
+ InLib = true;
+ break;
case OPT_end_lib:
- InLib = (ID == OPT_start_lib);
+ InLib = false;
break;
}
}
More information about the llvm-commits
mailing list