[lld] r372570 - [LLD][ELF] - Simplify getFlagsFromEmulation(). NFCI.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 23 02:55:11 PDT 2019
Author: grimar
Date: Mon Sep 23 02:55:10 2019
New Revision: 372570
URL: http://llvm.org/viewvc/llvm-project?rev=372570&view=rev
Log:
[LLD][ELF] - Simplify getFlagsFromEmulation(). NFCI.
A straightforward simplification.
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=372570&r1=372569&r2=372570&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/MipsArchTree.cpp (original)
+++ lld/trunk/ELF/Arch/MipsArchTree.cpp Mon Sep 23 02:55:10 2019
@@ -297,19 +297,9 @@ static uint32_t getArchFlags(ArrayRef<Fi
// 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() {
More information about the llvm-commits
mailing list