continue;
// Get the call site's attribute list.
- SmallVector<llvm::AttributeList, 8> newAttrs;
+ SmallVector<llvm::AttributeSetNode *, 8> newAttrs;
llvm::AttributeList oldAttrs = callSite.getAttributes();
// Collect any return attributes from the call.
- if (oldAttrs.hasAttributes(llvm::AttributeList::ReturnIndex))
- newAttrs.push_back(llvm::AttributeList::get(newFn->getContext(),
- oldAttrs.getRetAttributes()));
+ newAttrs.push_back(oldAttrs.getRetAttributes());
// If the function was passed too few arguments, don't transform.
unsigned newNumArgs = newFn->arg_size();
}
// Add any parameter attributes.
- if (oldAttrs.hasAttributes(argNo + 1))
- newAttrs.push_back(llvm::AttributeList::get(
- newFn->getContext(), oldAttrs.getParamAttributes(argNo + 1)));
+ newAttrs.push_back(oldAttrs.getParamAttributes(argNo + 1));
}
if (dontTransform)
continue;
- if (oldAttrs.hasAttributes(llvm::AttributeList::FunctionIndex))
- newAttrs.push_back(llvm::AttributeList::get(newFn->getContext(),
- oldAttrs.getFnAttributes()));
+ newAttrs.push_back(oldAttrs.getFnAttributes());
// Okay, we can transform this. Create the new call instruction and copy
// over the required information.
// Test returning a single element aggregate value containing a double.
+// RUN: %clang_cc1 -triple i686-linux %s -emit-llvm -o - | FileCheck %s --check-prefix=X86_32
// RUN: %clang_cc1 %s -emit-llvm -o -
struct X {
double D;
};
-struct Y {
- struct X x;
+struct Y {
+ struct X x;
};
struct Y bar();
return a;
}
+
+// X86_32: define void @foo(%struct.Y* %P)
+// X86_32: call void @bar(%struct.Y* sret %{{[^),]*}})
+
+// X86_32: define void @bar(%struct.Y* noalias sret %{{[^,)]*}})
+// X86_32: ret void