[lld] r372570 - [LLD][ELF] - Simplify getFlagsFromEmulation(). NFCI.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 24 05:04:00 PDT 2019
Now the function is so small that you probably want to inline it and
remove it.
On Mon, Sep 23, 2019 at 6:53 PM George Rimar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> 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() {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190924/8ec28fc9/attachment.html>
More information about the llvm-commits
mailing list