diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-10-15 07:29:08 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-10-15 07:29:08 +0000 |
commit | 07aae2e7d58fe23e370e0cbb9e1a3def99434c36 (patch) | |
tree | 9961bc6b914ce55768f0ea5d168fb892894ca9db /lib/Transforms/InstCombine/InstCombineCalls.cpp | |
parent | ad4643f54ba52d1f93426a9853934df8ce3271a0 (diff) |
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.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index 6d7e6a6f0b..44ddf3be34 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 |