[lld] r372747 - [LLD][ELF][MIPS] - Inline the short helper function. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 05:53:53 PDT 2019


Author: grimar
Date: Tue Sep 24 05:53:53 2019
New Revision: 372747

URL: http://llvm.org/viewvc/llvm-project?rev=372747&view=rev
Log:
[LLD][ELF][MIPS] - Inline the short helper function. NFC.

It was requested in a post-commit comment for r372570.

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=372747&r1=372746&r2=372747&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/MipsArchTree.cpp (original)
+++ lld/trunk/ELF/Arch/MipsArchTree.cpp Tue Sep 24 05:53:53 2019
@@ -294,20 +294,18 @@ static uint32_t getArchFlags(ArrayRef<Fi
   return ret;
 }
 
-// If we don't have any input files, we'll have to rely on the information we
-// can derive from emulation information, since this at least gets us ABI.
-static uint32_t getFlagsFromEmulation() {
-  if (config->emulation.empty() || config->is64)
-    return 0;
-  return config->mipsN32Abi ? EF_MIPS_ABI2 : EF_MIPS_ABI_O32;
-}
-
 template <class ELFT> uint32_t elf::calcMipsEFlags() {
   std::vector<FileFlags> v;
   for (InputFile *f : objectFiles)
     v.push_back({f, cast<ObjFile<ELFT>>(f)->getObj().getHeader()->e_flags});
-  if (v.empty())
-    return getFlagsFromEmulation();
+  if (v.empty()) {
+    // If we don't have any input files, we'll have to rely on the information
+    // we can derive from emulation information, since this at least gets us
+    // ABI.
+    if (config->emulation.empty() || config->is64)
+      return 0;
+    return config->mipsN32Abi ? EF_MIPS_ABI2 : EF_MIPS_ABI_O32;
+  }
   checkFlags(v);
   return getMiscFlags(v) | getPicFlags(v) | getArchFlags(v);
 }




More information about the llvm-commits mailing list