]> granicus.if.org Git - clang/commitdiff
Have AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.
authorBill Wendling <isanbard@gmail.com>
Mon, 21 Jan 2013 22:45:00 +0000 (22:45 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 21 Jan 2013 22:45:00 +0000 (22:45 +0000)
This further restricts the use of the Attribute class to the Attribute family of
classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173099 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index 5e09e47d54030ed2e5e54f1c296c986ff03bf423..aab21a2efbcb735b9fb4a180b9aad08136486fd9 100644 (file)
@@ -1939,9 +1939,10 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old,
 
     // Collect any return attributes from the call.
     if (oldAttrs.hasAttributes(llvm::AttributeSet::ReturnIndex))
-      newAttrs.push_back(llvm::AttributeWithIndex::get(
-                                llvm::AttributeSet::ReturnIndex,
-                                oldAttrs.getRetAttributes()));
+      newAttrs.push_back(
+        llvm::AttributeWithIndex::get(newFn->getContext(),
+                                      llvm::AttributeSet::ReturnIndex,
+                                      oldAttrs.getRetAttributes()));
 
     // If the function was passed too few arguments, don't transform.
     unsigned newNumArgs = newFn->arg_size();