diff options
author | Devang Patel <dpatel@apple.com> | 2008-09-25 21:00:45 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2008-09-25 21:00:45 +0000 |
commit | 0598866c052147c31b808391f58434ce3dbfb838 (patch) | |
tree | 5a33037d52126e5eb635d76afe643d9b854694a1 /lib/Transforms/IPO/StructRetPromotion.cpp | |
parent | 32b952a2a60d1091e0e17bb6ce788cd1d41e6f8b (diff) |
Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g
This sets the stage
- to implement function notes as function attributes and
- to distinguish between function attributes and return value attributes.
This requires corresponding changes in llvm-gcc and clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56622 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/StructRetPromotion.cpp')
-rw-r--r-- | lib/Transforms/IPO/StructRetPromotion.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp index 69aecc3e57..07b9e504c7 100644 --- a/lib/Transforms/IPO/StructRetPromotion.cpp +++ b/lib/Transforms/IPO/StructRetPromotion.cpp @@ -205,13 +205,13 @@ Function *SRETPromotion::cloneFunctionBody(Function *F, const FunctionType *FTy = F->getFunctionType(); std::vector<const Type*> Params; - // ParamAttrs - Keep track of the parameter attributes for the arguments. - SmallVector<FnAttributeWithIndex, 8> ParamAttrsVec; - const PAListPtr &PAL = F->getParamAttrs(); + // Attributes - Keep track of the parameter attributes for the arguments. + SmallVector<AttributeWithIndex, 8> AttributesVec; + const AttrListPtr &PAL = F->getAttributes(); // Add any return attributes. - if (Attributes attrs = PAL.getParamAttrs(0)) - ParamAttrsVec.push_back(FnAttributeWithIndex::get(0, attrs)); + if (Attributes attrs = PAL.getAttributes(0)) + AttributesVec.push_back(AttributeWithIndex::get(0, attrs)); // Skip first argument. Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); @@ -221,8 +221,8 @@ Function *SRETPromotion::cloneFunctionBody(Function *F, unsigned ParamIndex = 2; while (I != E) { Params.push_back(I->getType()); - if (Attributes Attrs = PAL.getParamAttrs(ParamIndex)) - ParamAttrsVec.push_back(FnAttributeWithIndex::get(ParamIndex - 1, Attrs)); + if (Attributes Attrs = PAL.getAttributes(ParamIndex)) + AttributesVec.push_back(AttributeWithIndex::get(ParamIndex - 1, Attrs)); ++I; ++ParamIndex; } @@ -231,7 +231,7 @@ Function *SRETPromotion::cloneFunctionBody(Function *F, Function *NF = Function::Create(NFTy, F->getLinkage()); NF->takeName(F); NF->copyAttributesFrom(F); - NF->setParamAttrs(PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end())); + NF->setAttributes(AttrListPtr::get(AttributesVec.begin(), AttributesVec.end())); F->getParent()->getFunctionList().insert(F, NF); NF->getBasicBlockList().splice(NF->begin(), F->getBasicBlockList()); @@ -255,17 +255,17 @@ void SRETPromotion::updateCallSites(Function *F, Function *NF) { CallGraph &CG = getAnalysis<CallGraph>(); SmallVector<Value*, 16> Args; - // ParamAttrs - Keep track of the parameter attributes for the arguments. - SmallVector<FnAttributeWithIndex, 8> ArgAttrsVec; + // Attributes - Keep track of the parameter attributes for the arguments. + SmallVector<AttributeWithIndex, 8> ArgAttrsVec; while (!F->use_empty()) { CallSite CS = CallSite::get(*F->use_begin()); Instruction *Call = CS.getInstruction(); - const PAListPtr &PAL = F->getParamAttrs(); + const AttrListPtr &PAL = F->getAttributes(); // Add any return attributes. - if (Attributes attrs = PAL.getParamAttrs(0)) - ArgAttrsVec.push_back(FnAttributeWithIndex::get(0, attrs)); + if (Attributes attrs = PAL.getAttributes(0)) + ArgAttrsVec.push_back(AttributeWithIndex::get(0, attrs)); // Copy arguments, however skip first one. CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end(); @@ -276,14 +276,14 @@ void SRETPromotion::updateCallSites(Function *F, Function *NF) { unsigned ParamIndex = 2; while (AI != AE) { Args.push_back(*AI); - if (Attributes Attrs = PAL.getParamAttrs(ParamIndex)) - ArgAttrsVec.push_back(FnAttributeWithIndex::get(ParamIndex - 1, Attrs)); + if (Attributes Attrs = PAL.getAttributes(ParamIndex)) + ArgAttrsVec.push_back(AttributeWithIndex::get(ParamIndex - 1, Attrs)); ++ParamIndex; ++AI; } - PAListPtr NewPAL = PAListPtr::get(ArgAttrsVec.begin(), ArgAttrsVec.end()); + AttrListPtr NewPAL = AttrListPtr::get(ArgAttrsVec.begin(), ArgAttrsVec.end()); // Build new call instruction. Instruction *New; @@ -291,11 +291,11 @@ void SRETPromotion::updateCallSites(Function *F, Function *NF) { New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(), Args.begin(), Args.end(), "", Call); cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv()); - cast<InvokeInst>(New)->setParamAttrs(NewPAL); + cast<InvokeInst>(New)->setAttributes(NewPAL); } else { New = CallInst::Create(NF, Args.begin(), Args.end(), "", Call); cast<CallInst>(New)->setCallingConv(CS.getCallingConv()); - cast<CallInst>(New)->setParamAttrs(NewPAL); + cast<CallInst>(New)->setAttributes(NewPAL); if (cast<CallInst>(Call)->isTailCall()) cast<CallInst>(New)->setTailCall(); } |