// At this point, we have committed to replacing this array.
ReplacedGlobals.insert(&Array);
- std::string NewName = Array.getName();
+ std::string NewName = Array.getName().str();
NewName += ".toptr";
GlobalVariable *ReplacementToArr =
cast<GlobalVariable>(M.getOrInsertGlobal(NewName, ElemPtrTy));
ReplacementToArr->setInitializer(ConstantPointerNull::get(ElemPtrTy));
Function *PollyMallocManaged = getOrCreatePollyMallocManaged(M);
- std::string FnName = Array.getName();
+ std::string FnName = Array.getName().str();
FnName += ".constructor";
PollyIRBuilder Builder(M.getContext());
FunctionType *Ty = FunctionType::get(Builder.getVoidTy(), false);
/// so that we use intrinsics whenever possible.
///
/// Return "" if we are not compiling for CUDA.
-std::string getCUDALibDeviceFuntion(StringRef Name) {
+std::string getCUDALibDeviceFuntion(StringRef NameRef) {
+ std::string Name = NameRef.str();
auto It = IntrinsicToLibdeviceFunc.find(Name);
if (It != IntrinsicToLibdeviceFunc.end())
return getCUDALibDeviceFuntion(It->second);
if (CUDALibDeviceFunctions.count(Name))
- return ("__nv_" + Name).str();
+ return ("__nv_" + Name);
return "";
}
void GPUNodeBuilder::setupKernelSubtreeFunctions(
SetVector<Function *> SubtreeFunctions) {
for (auto Fn : SubtreeFunctions) {
- const std::string ClonedFnName = Fn->getName();
+ const std::string ClonedFnName = Fn->getName().str();
Function *Clone = GPUModule->getFunction(ClonedFnName);
if (!Clone)
Clone =
PM.run(*GPUModule);
- return ASMStream.str();
+ return ASMStream.str().str();
}
bool GPUNodeBuilder::requiresCUDALibDevice() {