diff options
author | Michael Kruse <llvm-project@meinersbur.de> | 2020-02-05 22:23:29 -0600 |
---|---|---|
committer | Michael Kruse <llvm-project@meinersbur.de> | 2020-02-05 22:28:05 -0600 |
commit | 1a53b732e6bf1bbadd8d352573172c9d0c8b0cca (patch) | |
tree | 8cab5b8026f355b2a3863b3c1e913019f0fc62c5 /polly | |
parent | 2f025bb87c33a25e3a0d226cdb663f237ccd602e (diff) | |
download | llvm-1a53b732e6bf1bbadd8d352573172c9d0c8b0cca.tar.gz |
Compile-fix after StringRef's conversion operator has been made explicit.
Commit 777180a "[ADT] Make StringRef's std::string conversion operator explicit"
caused Polly's GPU code generator to not compile anymore. The rest of
Polly has already been fixed in commit
0257a9 "Fix polly build after StringRef change."
Diffstat (limited to 'polly')
-rw-r--r-- | polly/lib/CodeGen/ManagedMemoryRewrite.cpp | 4 | ||||
-rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 9 |
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() { |