Author: rnk Date: Thu Apr 13 18:12:13 2017 New Revision: 300272 URL: http://llvm.org/viewvc/llvm-project?rev=300272&view=rev Log: [IR] Make getParamAttributes take argument numbers, not ArgNo+1
Add hasParamAttribute() and use it instead of hasAttribute(ArgNo+1, Kind) everywhere. The fact that the AttributeList index for an argument is ArgNo+1 should be a hidden implementation detail. NFC Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=300272&r1=300271&r2=300272&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original) +++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu Apr 13 18:12:13 2017 @@ -2953,7 +2953,7 @@ static void replaceUsesOfNonProtoConstan } // Add any parameter attributes. - newArgAttrs.push_back(oldAttrs.getParamAttributes(argNo + 1)); + newArgAttrs.push_back(oldAttrs.getParamAttributes(argNo)); argNo++; } if (dontTransform) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits