]> granicus.if.org Git - clang/commitdiff
Remove operator cast method in favor of querying with the correct method.
authorBill Wendling <isanbard@gmail.com>
Sun, 14 Oct 2012 08:54:39 +0000 (08:54 +0000)
committerBill Wendling <isanbard@gmail.com>
Sun, 14 Oct 2012 08:54:39 +0000 (08:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165900 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index 0d70968b9def1e3682e00916f4698dbb222f7b79..7e688585d09f5473a80e804aff28e18e83276911 100644 (file)
@@ -1820,7 +1820,7 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old,
     llvm::Attributes RAttrs = AttrList.getRetAttributes();
 
     // Add the return attributes.
-    if (RAttrs)
+    if (RAttrs.hasAttributes())
       AttrVec.push_back(llvm::AttributeWithIndex::get(0, RAttrs));
 
     // If the function was passed too few arguments, don't transform.  If extra
@@ -1837,13 +1837,15 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old,
       }
 
       // Add any parameter attributes.
-      if (llvm::Attributes PAttrs = AttrList.getParamAttributes(ArgNo + 1))
+      llvm::Attributes PAttrs = AttrList.getParamAttributes(ArgNo + 1);
+      if (PAttrs.hasAttributes())
         AttrVec.push_back(llvm::AttributeWithIndex::get(ArgNo + 1, PAttrs));
     }
     if (DontTransform)
       continue;
 
-    if (llvm::Attributes FnAttrs =  AttrList.getFnAttributes())
+    llvm::Attributes FnAttrs =  AttrList.getFnAttributes();
+    if (FnAttrs.hasAttributes())
       AttrVec.push_back(llvm::AttributeWithIndex::get(~0, FnAttrs));
 
     // Okay, we can transform this.  Create the new call instruction and copy