From 78c46bdf52b19b5a513e683c08178f01439c7fc5 Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Fri, 6 Jul 2018 05:50:46 +0000 Subject: [PATCH] [ELF][MIPS] Simplify `checkFlags` routine and inline `rejectMicroMips64`. NFC llvm-svn: 336414 --- lld/ELF/Arch/MipsArchTree.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lld/ELF/Arch/MipsArchTree.cpp b/lld/ELF/Arch/MipsArchTree.cpp index 09ff689..3d079ad 100644 --- a/lld/ELF/Arch/MipsArchTree.cpp +++ b/lld/ELF/Arch/MipsArchTree.cpp @@ -64,20 +64,17 @@ static StringRef getNanName(bool IsNan2008) { 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 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) -- 2.7.4