diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-21 21:57:28 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-21 21:57:28 +0000 |
commit | bd4ea16bf39033271255dfbcc8ffb636a7de26bb (patch) | |
tree | 1f7b638c81daf44cefb27e811c4c3f2003c0a633 /llvm/lib/Transforms/InstCombine | |
parent | 9d86a4a3b636abc9871108d0ffecb990b824f3dd (diff) | |
download | bcm5719-llvm-bd4ea16bf39033271255dfbcc8ffb636a7de26bb.tar.gz bcm5719-llvm-bd4ea16bf39033271255dfbcc8ffb636a7de26bb.zip |
Make AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.
This is more code to isolate the use of the Attribute class to that of just
holding one attribute instead of a collection of attributes.
llvm-svn: 173094
Diffstat (limited to 'llvm/lib/Transforms/InstCombine')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index 1ac9a9d50bd..f3036d82dd5 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -1175,16 +1175,17 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { } } - Attribute FnAttrs = CallerPAL.getFnAttributes(); + AttributeSet FnAttrs = CallerPAL.getFnAttributes(); if (CallerPAL.hasAttributes(AttributeSet::FunctionIndex)) - attrVec.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex, + attrVec.push_back(AttributeWithIndex::get(Callee->getContext(), + AttributeSet::FunctionIndex, FnAttrs)); if (NewRetTy->isVoidTy()) Caller->setName(""); // Void type should not have a name. const AttributeSet &NewCallerPAL = AttributeSet::get(Callee->getContext(), - attrVec); + attrVec); Instruction *NC; if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) { @@ -1319,10 +1320,10 @@ InstCombiner::transformCallThroughTrampoline(CallSite CS, } // Add any function attributes. - Attr = Attrs.getFnAttributes(); if (Attrs.hasAttributes(AttributeSet::FunctionIndex)) - NewAttrs.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex, - Attr)); + NewAttrs.push_back(AttributeWithIndex::get(FTy->getContext(), + AttributeSet::FunctionIndex, + Attrs.getFnAttributes())); // The trampoline may have been bitcast to a bogus type (FTy). // Handle this by synthesizing a new function type, equal to FTy |