aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/IPO/ArgumentPromotion.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-15 07:29:08 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-15 07:29:08 +0000
commit07aae2e7d58fe23e370e0cbb9e1a3def99434c36 (patch)
tree9961bc6b914ce55768f0ea5d168fb892894ca9db /lib/Transforms/IPO/ArgumentPromotion.cpp
parentad4643f54ba52d1f93426a9853934df8ce3271a0 (diff)
downloadexternal_llvm-07aae2e7d58fe23e370e0cbb9e1a3def99434c36.zip
external_llvm-07aae2e7d58fe23e370e0cbb9e1a3def99434c36.tar.gz
external_llvm-07aae2e7d58fe23e370e0cbb9e1a3def99434c36.tar.bz2
Add an enum for the return and function indexes into the AttrListPtr object. This gets rid of some magic numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165924 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r--lib/Transforms/IPO/ArgumentPromotion.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index 948d1d7..8a0274b 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -520,7 +520,8 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
// Add any return attributes.
Attributes attrs = PAL.getRetAttributes();
if (attrs.hasAttributes())
- AttributesVec.push_back(AttributeWithIndex::get(0, attrs));
+ AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::ReturnIndex,
+ attrs));
// First, determine the new argument list
unsigned ArgIndex = 1;
@@ -592,7 +593,8 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
// Add any function attributes.
attrs = PAL.getFnAttributes();
if (attrs.hasAttributes())
- AttributesVec.push_back(AttributeWithIndex::get(~0, attrs));
+ AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::FunctionIndex,
+ attrs));
Type *RetTy = FTy->getReturnType();
@@ -639,7 +641,8 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
// Add any return attributes.
Attributes attrs = CallPAL.getRetAttributes();
if (attrs.hasAttributes())
- AttributesVec.push_back(AttributeWithIndex::get(0, attrs));
+ AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::ReturnIndex,
+ attrs));
// Loop over the operands, inserting GEP and loads in the caller as
// appropriate.
@@ -720,7 +723,8 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
// Add any function attributes.
attrs = CallPAL.getFnAttributes();
if (attrs.hasAttributes())
- AttributesVec.push_back(AttributeWithIndex::get(~0, attrs));
+ AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::FunctionIndex,
+ attrs));
Instruction *New;
if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {