Upgrade LLVM and Clang to current ToT (#305)
* Fix uses of getOrInsertFunction
* return type changed
* Fix uses of raw_fd_ostream
* enums changed
* Fix memcpy replacement
* alignments are now src and dest params
* Add default verification prefix
* needs to know what string to use with -verify
* Test updates
* struct inserts needs new targeted tests
* pointer selection needs new targeted tests
* Allow old toolchains
* rewrite function attribute copy
diff --git a/lib/ClusterPodKernelArgumentsPass.cpp b/lib/ClusterPodKernelArgumentsPass.cpp
index 5a9093b..d5be5a4 100644
--- a/lib/ClusterPodKernelArgumentsPass.cpp
+++ b/lib/ClusterPodKernelArgumentsPass.cpp
@@ -201,16 +201,13 @@
}
}
- // And finally function attributes. We deal with function attributes
- // differently since the version of LLVM used by clspv has a bug in get().
- // TODO(kpet): Add function attributes to AttrBuildInfo when updating
- // LLVM past r330136.
- auto newAttributes = AttributeList::get(M.getContext(), AttrBuildInfo);
+ // And finally function attributes.
if (Attributes.hasAttributes(AttributeList::FunctionIndex)) {
- auto attrs = AttrBuilder(Attributes.getFnAttributes());
auto idx = AttributeList::FunctionIndex;
- newAttributes = newAttributes.addAttributes(M.getContext(), idx, attrs);
+ auto attrs = Attributes.getFnAttributes();
+ AttrBuildInfo.push_back(std::make_pair(idx, attrs));
}
+ auto newAttributes = AttributeList::get(M.getContext(), AttrBuildInfo);
NewFunc->setAttributes(newAttributes);
// Move OpenCL kernel named attributes.