[LLD][ELF] - Simplify getFlagsFromEmulation(). NFCI.
authorGeorge Rimar <grimar@accesssoftek.com>
Mon, 23 Sep 2019 09:55:10 +0000 (09:55 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Mon, 23 Sep 2019 09:55:10 +0000 (09:55 +0000)
A straightforward simplification.

llvm-svn: 372570

lld/ELF/Arch/MipsArchTree.cpp

index 5de85e2..ebc917c 100644 (file)
@@ -297,19 +297,9 @@ static uint32_t getArchFlags(ArrayRef<FileFlags> files) {
 // 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() {
-  uint32_t ret = 0;
-
-  if (config->emulation.empty())
+  if (config->emulation.empty() || config->is64)
     return 0;
-
-  if (config->ekind == ELF32BEKind || config->ekind == ELF32LEKind) {
-    if (config->mipsN32Abi)
-      ret |= EF_MIPS_ABI2;
-    else
-      ret |= EF_MIPS_ABI_O32;
-  }
-
-  return ret;
+  return config->mipsN32Abi ? EF_MIPS_ABI2 : EF_MIPS_ABI_O32;
 }
 
 template <class ELFT> uint32_t elf::calcMipsEFlags() {