From: Bill Wendling Date: Sun, 14 Oct 2012 08:54:39 +0000 (+0000) Subject: Remove operator cast method in favor of querying with the correct method. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0120167c204cbd472a6fea16a9dfff75825db996;p=platform%2Fupstream%2Fllvm.git Remove operator cast method in favor of querying with the correct method. llvm-svn: 165900 --- diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 0d70968..7e68858 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -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