diff options
| author | Bill Wendling <isanbard@gmail.com> | 2013-01-18 21:53:16 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2013-01-18 21:53:16 +0000 |
| commit | 658d24d211e8f110ff35681605a5d4f65382bcb7 (patch) | |
| tree | 5694e43730eb47df43ccb8d280a9d72c1787187d /llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | |
| parent | 4f972ea2d86c995f80264a1c5b47ca87cc10184a (diff) | |
| download | bcm5719-llvm-658d24d211e8f110ff35681605a5d4f65382bcb7.tar.gz bcm5719-llvm-658d24d211e8f110ff35681605a5d4f65382bcb7.zip | |
Use AttributeSet accessor methods instead of Attribute accessor methods.
Further encapsulation of the Attribute object. Don't allow direct access to the
Attribute object as an aggregate.
llvm-svn: 172853
Diffstat (limited to 'llvm/lib/Transforms/IPO/ArgumentPromotion.cpp')
| -rw-r--r-- | llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index 15a479e90cc..75c05040608 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -518,10 +518,9 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, const AttributeSet &PAL = F->getAttributes(); // Add any return attributes. - Attribute attrs = PAL.getRetAttributes(); - if (attrs.hasAttributes()) + if (PAL.hasAttributes(AttributeSet::ReturnIndex)) AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::ReturnIndex, - attrs)); + PAL.getRetAttributes())); // First, determine the new argument list unsigned ArgIndex = 1; @@ -591,10 +590,9 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, } // Add any function attributes. - attrs = PAL.getFnAttributes(); if (PAL.hasAttributes(AttributeSet::FunctionIndex)) AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex, - attrs)); + PAL.getFnAttributes())); Type *RetTy = FTy->getReturnType(); @@ -639,10 +637,9 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, const AttributeSet &CallPAL = CS.getAttributes(); // Add any return attributes. - Attribute attrs = CallPAL.getRetAttributes(); - if (attrs.hasAttributes()) + if (CallPAL.hasAttributes(AttributeSet::ReturnIndex)) AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::ReturnIndex, - attrs)); + CallPAL.getRetAttributes())); // Loop over the operands, inserting GEP and loads in the caller as // appropriate. @@ -721,10 +718,9 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, } // Add any function attributes. - attrs = CallPAL.getFnAttributes(); if (CallPAL.hasAttributes(AttributeSet::FunctionIndex)) AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex, - attrs)); + CallPAL.getFnAttributes())); Instruction *New; if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) { |

