aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/InstCombine/InstCombineCalls.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/InstCombine/InstCombineCalls.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/InstCombine/InstCombineCalls.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineCalls.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 6d7e6a6..44ddf3b 100644
--- a/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -1118,7 +1118,8 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
// Add the new return attributes.
if (RAttrs.hasAttributes())
attrVec.push_back(
- AttributeWithIndex::get(0, Attributes::get(FT->getContext(), RAttrs)));
+ AttributeWithIndex::get(AttrListPtr::ReturnIndex,
+ Attributes::get(FT->getContext(), RAttrs)));
AI = CS.arg_begin();
for (unsigned i = 0; i != NumCommonArgs; ++i, ++AI) {
@@ -1170,7 +1171,8 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
Attributes FnAttrs = CallerPAL.getFnAttributes();
if (FnAttrs.hasAttributes())
- attrVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
+ attrVec.push_back(AttributeWithIndex::get(AttrListPtr::FunctionIndex,
+ FnAttrs));
if (NewRetTy->isVoidTy())
Caller->setName(""); // Void type should not have a name.
@@ -1280,7 +1282,8 @@ InstCombiner::transformCallThroughTrampoline(CallSite CS,
// Add any result attributes.
Attributes Attr = Attrs.getRetAttributes();
if (Attr.hasAttributes())
- NewAttrs.push_back(AttributeWithIndex::get(0, Attr));
+ NewAttrs.push_back(AttributeWithIndex::get(AttrListPtr::ReturnIndex,
+ Attr));
{
unsigned Idx = 1;
@@ -1312,7 +1315,8 @@ InstCombiner::transformCallThroughTrampoline(CallSite CS,
// Add any function attributes.
Attr = Attrs.getFnAttributes();
if (Attr.hasAttributes())
- NewAttrs.push_back(AttributeWithIndex::get(~0, Attr));
+ NewAttrs.push_back(AttributeWithIndex::get(AttrListPtr::FunctionIndex,
+ Attr));
// The trampoline may have been bitcast to a bogus type (FTy).
// Handle this by synthesizing a new function type, equal to FTy