diff --git a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp index 95f9d7dceed2..989b5f401476 100644 --- a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp +++ b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp @@ -218,13 +218,15 @@ 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() + Twine(".toptr")).str(); + std::string NewName = Array.getName(); + NewName += ".toptr"; GlobalVariable *ReplacementToArr = cast(M.getOrInsertGlobal(NewName, ElemPtrTy)); ReplacementToArr->setInitializer(ConstantPointerNull::get(ElemPtrTy)); Function *PollyMallocManaged = getOrCreatePollyMallocManaged(M); - Twine FnName = Array.getName() + ".constructor"; + std::string FnName = Array.getName(); + FnName += ".constructor"; PollyIRBuilder Builder(M.getContext()); FunctionType *Ty = FunctionType::get(Builder.getVoidTy(), false); const GlobalValue::LinkageTypes Linkage = Function::ExternalLinkage;