[lld] r257432 - Simplify. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 11 17:33:24 PST 2016
Author: ruiu
Date: Mon Jan 11 19:33:23 2016
New Revision: 257432
URL: http://llvm.org/viewvc/llvm-project?rev=257432&view=rev
Log:
Simplify. NFC.
Modified:
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=257432&r1=257431&r2=257432&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Mon Jan 11 19:33:23 2016
@@ -177,10 +177,9 @@ void LinkerDriver::readConfigs(opt::Inpu
Config->RPath = llvm::join(RPaths.begin(), RPaths.end(), ":");
if (auto *Arg = Args.getLastArg(OPT_m)) {
+ // Parse ELF{32,64}{LE,BE} and CPU type.
StringRef S = Arg->getValue();
- std::pair<ELFKind, uint16_t> P = parseEmulation(S);
- Config->EKind = P.first;
- Config->EMachine = P.second;
+ std::tie(Config->EKind, Config->EMachine) = parseEmulation(S);
Config->Emulation = S;
}
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=257432&r1=257431&r2=257432&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Mon Jan 11 19:33:23 2016
@@ -98,10 +98,7 @@ private:
};
} // anonymous namespace
-template <class ELFT> static bool shouldUseRela() {
- ELFKind K = cast<ELFFileBase<ELFT>>(Config->FirstElf)->getELFKind();
- return K == ELF64LEKind || K == ELF64BEKind;
-}
+template <class ELFT> static bool shouldUseRela() { return ELFT::Is64Bits; }
template <class ELFT> void elf2::writeResult(SymbolTable<ELFT> *Symtab) {
// Initialize output sections that are handled by Writer specially.
More information about the llvm-commits
mailing list