[llvm] 3b0f5a4 - [Mips16HardFloat] Simplify attribute change (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 22 00:44:35 PST 2021


Author: Nikita Popov
Date: 2021-12-22T09:41:11+01:00
New Revision: 3b0f5a4856fce76a6535feddd1692747b81b60cd

URL: https://github.com/llvm/llvm-project/commit/3b0f5a4856fce76a6535feddd1692747b81b60cd
DIFF: https://github.com/llvm/llvm-project/commit/3b0f5a4856fce76a6535feddd1692747b81b60cd.diff

LOG: [Mips16HardFloat] Simplify attribute change (NFC)

As we're only removing and adding a single attribute, there is no
need to go through AttrBuilder.

Added: 
    

Modified: 
    llvm/lib/Target/Mips/Mips16HardFloat.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Mips/Mips16HardFloat.cpp b/llvm/lib/Target/Mips/Mips16HardFloat.cpp
index 203e05dde7ad9..419f0ac1a8a72 100644
--- a/llvm/lib/Target/Mips/Mips16HardFloat.cpp
+++ b/llvm/lib/Target/Mips/Mips16HardFloat.cpp
@@ -479,14 +479,12 @@ static void createFPFnStub(Function *F, Module *M, FPParamVariant PV,
 
 // remove the use-soft-float attribute
 static void removeUseSoftFloat(Function &F) {
-  AttrBuilder B;
   LLVM_DEBUG(errs() << "removing -use-soft-float\n");
-  B.addAttribute("use-soft-float", "false");
-  F.removeFnAttrs(B);
+  F.removeFnAttr("use-soft-float");
   if (F.hasFnAttribute("use-soft-float")) {
     LLVM_DEBUG(errs() << "still has -use-soft-float\n");
   }
-  F.addFnAttrs(B);
+  F.addFnAttr("use-soft-float", "false");
 }
 
 // This pass only makes sense when the underlying chip has floating point but


        


More information about the llvm-commits mailing list