[lld] r336414 - [ELF][MIPS] Simplify `checkFlags` routine and inline `rejectMicroMips64`. NFC
Simon Atanasyan via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 5 22:50:46 PDT 2018
Author: atanasyan
Date: Thu Jul 5 22:50:46 2018
New Revision: 336414
URL: http://llvm.org/viewvc/llvm-project?rev=336414&view=rev
Log:
[ELF][MIPS] Simplify `checkFlags` routine and inline `rejectMicroMips64`. NFC
Modified:
lld/trunk/ELF/Arch/MipsArchTree.cpp
Modified: lld/trunk/ELF/Arch/MipsArchTree.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/MipsArchTree.cpp?rev=336414&r1=336413&r2=336414&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/MipsArchTree.cpp (original)
+++ lld/trunk/ELF/Arch/MipsArchTree.cpp Thu Jul 5 22:50:46 2018
@@ -64,20 +64,17 @@ static StringRef getNanName(bool IsNan20
static StringRef getFpName(bool IsFp64) { return IsFp64 ? "64" : "32"; }
-static void rejectMicroMips64(const FileFlags &F) {
- if (Config->Is64 && F.Flags & EF_MIPS_MICROMIPS)
- error("linking microMIPS 64-bit files is unsupported: " + toString(F.File));
-}
-
static void checkFlags(ArrayRef<FileFlags> Files) {
+ assert(!Files.empty() && "expected non-empty file list");
+
uint32_t ABI = Files[0].Flags & (EF_MIPS_ABI | EF_MIPS_ABI2);
bool Nan = Files[0].Flags & EF_MIPS_NAN2008;
bool Fp = Files[0].Flags & EF_MIPS_FP64;
- rejectMicroMips64(Files[0]);
-
- for (const FileFlags &F : Files.slice(1)) {
- rejectMicroMips64(F);
+ for (const FileFlags &F : Files) {
+ if (Config->Is64 && F.Flags & EF_MIPS_MICROMIPS)
+ error("linking microMIPS 64-bit files is unsupported: " +
+ toString(F.File));
uint32_t ABI2 = F.Flags & (EF_MIPS_ABI | EF_MIPS_ABI2);
if (ABI != ABI2)
More information about the llvm-commits
mailing list