[lld] r372570 - [LLD][ELF] - Simplify getFlagsFromEmulation(). NFCI.

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


OK, r372747<https://reviews.llvm.org/rL372747>?.


Best regards,
George | Developer | Access Softek, Inc
________________________________
От: Rui Ueyama <ruiu at google.com>
Отправлено: 24 сентября 2019 г. 15:04
Кому: George Rimar
Копия: llvm-commits
Тема: Re: [lld] r372570 - [LLD][ELF] - Simplify getFlagsFromEmulation(). NFCI.

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.  If you suspect potential phishing or spam email, report it to ReportSpam at accesssoftek.com
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<mailto: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<mailto: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/33cc89cb/attachment.html>


More information about the llvm-commits mailing list