diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-27 02:46:53 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-27 02:46:53 +0000 |
commit | 290d952bb47e90cc742ff4c2138c5c85c84e4726 (patch) | |
tree | aecccaa0d63672cb3f82b0ee7ccdd47cd1ebc078 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | f5075a4fe0b85bd24b49251ce2d01afca4351714 (diff) | |
download | bcm5719-llvm-290d952bb47e90cc742ff4c2138c5c85c84e4726.tar.gz bcm5719-llvm-290d952bb47e90cc742ff4c2138c5c85c84e4726.zip |
Use the AttributeSet instead of AttributeWithIndex.
In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.
llvm-svn: 173605
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 225ff8b3502..da419dde034 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1875,15 +1875,14 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, continue; // Get the call site's attribute list. - SmallVector<llvm::AttributeWithIndex, 8> newAttrs; + SmallVector<llvm::AttributeSet, 8> newAttrs; llvm::AttributeSet oldAttrs = callSite.getAttributes(); // Collect any return attributes from the call. if (oldAttrs.hasAttributes(llvm::AttributeSet::ReturnIndex)) newAttrs.push_back( - llvm::AttributeWithIndex::get(newFn->getContext(), - llvm::AttributeSet::ReturnIndex, - oldAttrs.getRetAttributes())); + llvm::AttributeSet::get(newFn->getContext(), + oldAttrs.getRetAttributes())); // If the function was passed too few arguments, don't transform. unsigned newNumArgs = newFn->arg_size(); @@ -1903,19 +1902,16 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, // Add any parameter attributes. if (oldAttrs.hasAttributes(argNo + 1)) newAttrs. - push_back(llvm::AttributeWithIndex:: - get(newFn->getContext(), - argNo + 1, - oldAttrs.getParamAttributes(argNo + 1))); + push_back(llvm:: + AttributeSet::get(newFn->getContext(), + oldAttrs.getParamAttributes(argNo + 1))); } if (dontTransform) continue; if (oldAttrs.hasAttributes(llvm::AttributeSet::FunctionIndex)) - newAttrs.push_back(llvm:: - AttributeWithIndex::get(newFn->getContext(), - llvm::AttributeSet::FunctionIndex, - oldAttrs.getFnAttributes())); + newAttrs.push_back(llvm::AttributeSet::get(newFn->getContext(), + oldAttrs.getFnAttributes())); // Okay, we can transform this. Create the new call instruction and copy // over the required information. |