summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--polly/lib/CodeGen/ManagedMemoryRewrite.cpp4
-rw-r--r--polly/lib/CodeGen/PPCGCodeGeneration.cpp9
2 files changed, 7 insertions, 6 deletions
diff --git a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
index 7c2dba1a5ecf..ad74fa276934 100644
--- a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
+++ b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
@@ -212,14 +212,14 @@ replaceGlobalArray(Module &M, const DataLayout &DL, GlobalVariable &Array,
// 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);
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index 7224cbec1c3d..522dc3e3674b 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -1402,13 +1402,14 @@ const std::map<std::string, std::string> IntrinsicToLibdeviceFunc = {
/// 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 "";
}
@@ -1760,7 +1761,7 @@ GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F,
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 =
@@ -2377,7 +2378,7 @@ std::string GPUNodeBuilder::createKernelASM() {
PM.run(*GPUModule);
- return ASMStream.str();
+ return ASMStream.str().str();
}
bool GPUNodeBuilder::requiresCUDALibDevice() {