summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/DeadArgumentElimination.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-23 06:14:59 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-23 06:14:59 +0000
commit28d65722d6f283b327b5815914382077fe9c0ab4 (patch)
tree2edfbefbb4ed020a14b308718f9ccecebfaa0c6b /lib/Transforms/IPO/DeadArgumentElimination.cpp
parentd3afa9be99e504350582f08ffc4cd05cf928db6a (diff)
downloadllvm-28d65722d6f283b327b5815914382077fe9c0ab4.tar.gz
llvm-28d65722d6f283b327b5815914382077fe9c0ab4.tar.bz2
llvm-28d65722d6f283b327b5815914382077fe9c0ab4.tar.xz
Remove the last of uses that use the Attribute object as a collection of attributes.
Collections of attributes are handled via the AttributeSet class now. This finally frees us up to make significant changes to how attributes are structured. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/DeadArgumentElimination.cpp')
-rw-r--r--lib/Transforms/IPO/DeadArgumentElimination.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp
index 5204248c1f..3a38ca4bb8 100644
--- a/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -791,9 +791,12 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
// Get the original parameter attributes (skipping the first one, that is
// for the return value.
- Attribute Attrs = PAL.getParamAttributes(i + 1);
- if (Attrs.hasAttributes())
- AttributesVec.push_back(AttributeWithIndex::get(Params.size(), Attrs));
+ if (PAL.hasAttributes(i + 1)) {
+ AttributesVec.
+ push_back(AttributeWithIndex::get(F->getContext(), i + 1,
+ PAL.getParamAttributes(i + 1)));
+ AttributesVec.back().Index = Params.size();
+ }
} else {
++NumArgumentsEliminated;
DEBUG(dbgs() << "DAE - Removing argument " << i << " (" << I->getName()
@@ -859,17 +862,23 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
if (ArgAlive[i]) {
Args.push_back(*I);
// Get original parameter attributes, but skip return attributes.
- Attribute Attrs = CallPAL.getParamAttributes(i + 1);
- if (Attrs.hasAttributes())
- AttributesVec.push_back(AttributeWithIndex::get(Args.size(), Attrs));
+ if (CallPAL.hasAttributes(i + 1)) {
+ AttributesVec.
+ push_back(AttributeWithIndex::get(F->getContext(), i + 1,
+ CallPAL.getParamAttributes(i + 1)));
+ AttributesVec.back().Index = Args.size();
+ }
}
// Push any varargs arguments on the list. Don't forget their attributes.
for (CallSite::arg_iterator E = CS.arg_end(); I != E; ++I, ++i) {
Args.push_back(*I);
- Attribute Attrs = CallPAL.getParamAttributes(i + 1);
- if (Attrs.hasAttributes())
- AttributesVec.push_back(AttributeWithIndex::get(Args.size(), Attrs));
+ if (CallPAL.hasAttributes(i + 1)) {
+ AttributesVec.
+ push_back(AttributeWithIndex::get(F->getContext(), i + 1,
+ CallPAL.getParamAttributes(i + 1)));
+ AttributesVec.back().Index = Args.size();
+ }
}
if (CallPAL.hasAttributes(AttributeSet::FunctionIndex))