Author: baldrick Date: Sat Feb 16 14:53:06 2008 New Revision: 47219 URL: http://llvm.org/viewvc/llvm-project?rev=47219&view=rev Log: Some micro-optimizations.
Modified: llvm/trunk/lib/VMCore/ParameterAttributes.cpp Modified: llvm/trunk/lib/VMCore/ParameterAttributes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ParameterAttributes.cpp?rev=47219&r1=47218&r2=47219&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ParameterAttributes.cpp (original) +++ llvm/trunk/lib/VMCore/ParameterAttributes.cpp Sat Feb 16 14:53:06 2008 @@ -124,6 +124,7 @@ if (!PAL) { // Strip any instances of ParamAttr::None from modVec before calling 'get'. ParamAttrsVector newVec; + newVec.reserve(modVec.size()); for (unsigned i = 0, e = modVec.size(); i < e; ++i) if (modVec[i].attrs != ParamAttr::None) newVec.push_back(modVec[i]); @@ -175,8 +176,8 @@ if (NewAttrs == OldAttrs) return PAL; - ParamAttrsVector modVec; - modVec.push_back(ParamAttrsWithIndex::get(idx, NewAttrs)); + ParamAttrsVector modVec(1); + modVec[0] = ParamAttrsWithIndex::get(idx, NewAttrs); return getModified(PAL, modVec); } @@ -188,8 +189,8 @@ if (NewAttrs == OldAttrs) return PAL; - ParamAttrsVector modVec; - modVec.push_back(ParamAttrsWithIndex::get(idx, NewAttrs)); + ParamAttrsVector modVec(1); + modVec[0] = ParamAttrsWithIndex::get(idx, NewAttrs); return getModified(PAL, modVec); } _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits