diff options
| author | Tobias Grosser <grosser@fim.uni-passau.de> | 2011-11-17 14:52:36 +0000 |
|---|---|---|
| committer | Tobias Grosser <grosser@fim.uni-passau.de> | 2011-11-17 14:52:36 +0000 |
| commit | 29ee0b14d5b6872d1e06fbbd24734c75983d9ffd (patch) | |
| tree | c83aa85f3af13d1064eb45ca4f9c98620cb6083e /polly | |
| parent | 135c9c653444e9790bae5ac9e84786e67e5f6f31 (diff) | |
| download | bcm5719-llvm-29ee0b14d5b6872d1e06fbbd24734c75983d9ffd.tar.gz bcm5719-llvm-29ee0b14d5b6872d1e06fbbd24734c75983d9ffd.zip | |
Do not use getNameStr() anymore.
Instead we switch to the recommended getName(). This fixes compilation with
recent versions of LLVM.
llvm-svn: 144909
Diffstat (limited to 'polly')
| -rw-r--r-- | polly/lib/Analysis/ScopDetection.cpp | 18 | ||||
| -rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 5 | ||||
| -rw-r--r-- | polly/lib/Cloog.cpp | 8 | ||||
| -rw-r--r-- | polly/lib/CodeGeneration.cpp | 25 | ||||
| -rwxr-xr-x | polly/lib/Exchange/JSONExporter.cpp | 8 | ||||
| -rw-r--r-- | polly/lib/Exchange/ScopLib.cpp | 2 | ||||
| -rwxr-xr-x | polly/lib/Exchange/ScopLibExporter.cpp | 4 | ||||
| -rwxr-xr-x | polly/lib/Exchange/ScopLibImporter.cpp | 4 | ||||
| -rw-r--r-- | polly/lib/RegionSimplify.cpp | 4 |
9 files changed, 38 insertions, 40 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index a2dd85645e1..0b092c9d280 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -154,7 +154,7 @@ bool ScopDetection::isValidCFG(BasicBlock &BB, DetectionContext &Context) const BranchInst *Br = dyn_cast<BranchInst>(TI); if (!Br) - INVALID(CFG, "Non branch instruction terminates BB: " + BB.getNameStr()); + INVALID(CFG, "Non branch instruction terminates BB: " + BB.getName()); if (Br->isUnconditional()) return true; @@ -163,11 +163,11 @@ bool ScopDetection::isValidCFG(BasicBlock &BB, DetectionContext &Context) const // UndefValue is not allowed as condition. if (isa<UndefValue>(Condition)) INVALID(AffFunc, "Condition based on 'undef' value in BB: " - + BB.getNameStr()); + + BB.getName()); // Only Constant and ICmpInst are allowed as condition. if (!(isa<Constant>(Condition) || isa<ICmpInst>(Condition))) - INVALID(AffFunc, "Condition in BB '" + BB.getNameStr() + "' neither " + INVALID(AffFunc, "Condition in BB '" + BB.getName() + "' neither " "constant nor an icmp instruction"); // Allow perfectly nested conditions. @@ -185,14 +185,14 @@ bool ScopDetection::isValidCFG(BasicBlock &BB, DetectionContext &Context) const // Are both operands of the ICmp affine? if (isa<UndefValue>(ICmp->getOperand(0)) || isa<UndefValue>(ICmp->getOperand(1))) - INVALID(AffFunc, "undef operand in branch at BB: " + BB.getNameStr()); + INVALID(AffFunc, "undef operand in branch at BB: " + BB.getName()); const SCEV *LHS = SE->getSCEV(ICmp->getOperand(0)); const SCEV *RHS = SE->getSCEV(ICmp->getOperand(1)); if (!isAffineExpr(&Context.CurRegion, LHS, *SE) || !isAffineExpr(&Context.CurRegion, RHS, *SE)) - INVALID(AffFunc, "Non affine branch in BB '" << BB.getNameStr() + INVALID(AffFunc, "Non affine branch in BB '" << BB.getName() << "' with LHS: " << *LHS << " and RHS: " << *RHS); } @@ -204,7 +204,7 @@ bool ScopDetection::isValidCFG(BasicBlock &BB, DetectionContext &Context) const // Allow perfectly nested conditions. Region *R = RI->getRegionFor(&BB); if (R->getEntry() != &BB) - INVALID(CFG, "Not well structured condition at BB: " + BB.getNameStr()); + INVALID(CFG, "Not well structured condition at BB: " + BB.getName()); return true; } @@ -358,13 +358,13 @@ bool ScopDetection::isValidLoop(Loop *L, DetectionContext &Context) const { // No canonical induction variable. if (!IndVar) INVALID(IndVar, "No canonical IV at loop header: " - << L->getHeader()->getNameStr()); + << L->getHeader()->getName()); // Is the loop count affine? const SCEV *LoopCount = SE->getBackedgeTakenCount(L); if (!isAffineExpr(&Context.CurRegion, LoopCount, *SE)) INVALID(LoopBound, "Non affine loop bound '" << *LoopCount << "' in loop: " - << L->getHeader()->getNameStr()); + << L->getHeader()->getName()); return true; } @@ -525,7 +525,7 @@ bool ScopDetection::runOnFunction(llvm::Function &F) { releaseMemory(); - if (OnlyFunction != "" && F.getNameStr() != OnlyFunction) + if (OnlyFunction != "" && F.getName() != OnlyFunction) return false; if(!isValidFunction(F)) diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index f17bcb6a4ce..0ddd75294db 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -237,7 +237,8 @@ public: isl_space *Space; - isl_id *ID = isl_id_alloc(ctx, Value->getNameStr().c_str(), Value); + std::string ValueName = Value->getName(); + isl_id *ID = isl_id_alloc(ctx, ValueName.c_str(), Value); Space = isl_space_set_alloc(ctx, 1, NbLoopSpaces); Space = isl_space_set_dim_id(Space, isl_dim_param, 0, ID); @@ -874,7 +875,7 @@ __isl_give isl_id *Scop::getIdForParam(const SCEV *Parameter) const { if (const SCEVUnknown *ValueParameter = dyn_cast<SCEVUnknown>(Parameter)) { Value *Val = ValueParameter->getValue(); - ParameterName = Val->getNameStr(); + ParameterName = Val->getName(); } if (ParameterName == "" || ParameterName.substr(0, 2) == "p_") diff --git a/polly/lib/Cloog.cpp b/polly/lib/Cloog.cpp index f21b4d92766..fd7b1dafb0b 100644 --- a/polly/lib/Cloog.cpp +++ b/polly/lib/Cloog.cpp @@ -210,7 +210,7 @@ struct CloogExporter : public ScopPass { } std::string CloogExporter::getFileName(Region *R) const { - std::string FunctionName = R->getEntry()->getParent()->getNameStr(); + std::string FunctionName = R->getEntry()->getParent()->getName(); std::string ExitName, EntryName; raw_string_ostream ExitStr(ExitName); @@ -236,7 +236,7 @@ bool CloogExporter::runOnScop(Scop &S) { Region &R = S.getRegion(); CloogInfo &C = getAnalysis<CloogInfo>(); - std::string FunctionName = R.getEntry()->getParent()->getNameStr(); + std::string FunctionName = R.getEntry()->getParent()->getName(); std::string Filename = getFileName(&R); errs() << "Writing Scop '" << R.getNameStr() << "' in function '" @@ -296,7 +296,7 @@ bool CloogInfo::runOnScop(Scop &S) { Function *F = S.getRegion().getEntry()->getParent(); - DEBUG(dbgs() << ":: " << F->getNameStr()); + DEBUG(dbgs() << ":: " << F->getName()); DEBUG(dbgs() << " : " << S.getRegion().getNameStr() << "\n");; DEBUG(C->pprint(dbgs())); @@ -306,7 +306,7 @@ bool CloogInfo::runOnScop(Scop &S) { void CloogInfo::printScop(raw_ostream &OS) const { Function *function = scop->getRegion().getEntry()->getParent(); - OS << function->getNameStr() << "():\n"; + OS << function->getName() << "():\n"; C->pprint(OS); } diff --git a/polly/lib/CodeGeneration.cpp b/polly/lib/CodeGeneration.cpp index c677cc6c00b..430df1363a3 100644 --- a/polly/lib/CodeGeneration.cpp +++ b/polly/lib/CodeGeneration.cpp @@ -239,8 +239,7 @@ public: Value *VectorPtr = Builder.CreateBitCast(newPointer, vectorPtrType, "vector_ptr"); LoadInst *VecLoad = Builder.CreateLoad(VectorPtr, - load->getNameStr() - + "_p_vec_full"); + load->getName() + "_p_vec_full"); if (!Aligned) VecLoad->setAlignment(8); @@ -263,9 +262,9 @@ public: Type *vectorPtrType = getVectorPtrTy(pointer, 1); Value *newPointer = getOperand(pointer, BBMap); Value *vectorPtr = Builder.CreateBitCast(newPointer, vectorPtrType, - load->getNameStr() + "_p_vec_p"); + load->getName() + "_p_vec_p"); LoadInst *scalarLoad= Builder.CreateLoad(vectorPtr, - load->getNameStr() + "_p_splat_one"); + load->getName() + "_p_splat_one"); if (!Aligned) scalarLoad->setAlignment(8); @@ -279,7 +278,7 @@ public: Value *vectorLoad = Builder.CreateShuffleVector(scalarLoad, scalarLoad, splatVector, - load->getNameStr() + load->getName() + "_p_splat"); return vectorLoad; } @@ -307,10 +306,10 @@ public: for (int i = 0; i < size; i++) { Value *newPointer = getOperand(pointer, scalarMaps[i]); Value *scalarLoad = Builder.CreateLoad(newPointer, - load->getNameStr() + "_p_scalar_"); + load->getName() + "_p_scalar_"); vector = Builder.CreateInsertElement(vector, scalarLoad, Builder.getInt32(i), - load->getNameStr() + "_p_vec_"); + load->getName() + "_p_vec_"); } return vector; @@ -387,7 +386,7 @@ public: const Instruction *Inst = dyn_cast<Instruction>(load); Value *newPointer = generateLocationAccessed(Inst, pointer, BBMap); Value *scalarLoad = Builder.CreateLoad(newPointer, - load->getNameStr() + "_p_scalar_"); + load->getName() + "_p_scalar_"); return scalarLoad; } @@ -444,7 +443,7 @@ public: Value *newInst = Builder.CreateBinOp(Inst->getOpcode(), newOpZero, newOpOne, - Inst->getNameStr() + "p_vec"); + Inst->getName() + "p_vec"); vectorMap[Inst] = newInst; return; @@ -580,8 +579,7 @@ public: Function *F = Builder.GetInsertBlock()->getParent(); LLVMContext &Context = F->getContext(); BasicBlock *CopyBB = BasicBlock::Create(Context, - "polly." + BB->getNameStr() - + ".stmt", + "polly." + BB->getName() + ".stmt", F); Builder.CreateBr(CopyBB); DT->addNewBlock(CopyBB, Builder.GetInsertBlock()); @@ -914,11 +912,10 @@ public: /// @brief Add a new definition of an openmp subfunction. Function *addOpenMPSubfunction(Module *M) { Function *F = Builder.GetInsertBlock()->getParent(); - const std::string &Name = F->getNameStr() + ".omp_subfn"; - std::vector<Type*> Arguments(1, Builder.getInt8PtrTy()); FunctionType *FT = FunctionType::get(Builder.getVoidTy(), Arguments, false); - Function *FN = Function::Create(FT, Function::InternalLinkage, Name, M); + Function *FN = Function::Create(FT, Function::InternalLinkage, + F->getName() + ".omp_subfn", M); // Do not run any polly pass on the new function. SD->markFunctionAsInvalid(FN); diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp index d9a2ef1f05e..d9c569b45df 100755 --- a/polly/lib/Exchange/JSONExporter.cpp +++ b/polly/lib/Exchange/JSONExporter.cpp @@ -83,7 +83,7 @@ struct JSONImporter : public ScopPass { char JSONExporter::ID = 0; std::string JSONExporter::getFileName(Scop *S) const { std::string FunctionName = - S->getRegion().getEntry()->getParent()->getNameStr(); + S->getRegion().getEntry()->getParent()->getName(); std::string FileName = FunctionName + "___" + S->getNameStr() + ".jscop"; return FileName; } @@ -142,7 +142,7 @@ bool JSONExporter::runOnScop(Scop &scop) { std::string ErrInfo; tool_output_file F(FileName.c_str(), ErrInfo); - std::string FunctionName = R.getEntry()->getParent()->getNameStr(); + std::string FunctionName = R.getEntry()->getParent()->getName(); errs() << "Writing JScop '" << R.getNameStr() << "' in function '" << FunctionName << "' to '" << FileName << "'.\n"; @@ -182,7 +182,7 @@ Pass *polly::createJSONExporterPass() { char JSONImporter::ID = 0; std::string JSONImporter::getFileName(Scop *S) const { std::string FunctionName = - S->getRegion().getEntry()->getParent()->getNameStr(); + S->getRegion().getEntry()->getParent()->getName(); std::string FileName = FunctionName + "___" + S->getNameStr() + ".jscop"; if (ImportPostfix != "") @@ -207,7 +207,7 @@ bool JSONImporter::runOnScop(Scop &scop) { std::string FileName = ImportDir + "/" + getFileName(S); - std::string FunctionName = R.getEntry()->getParent()->getNameStr(); + std::string FunctionName = R.getEntry()->getParent()->getName(); errs() << "Reading JScop '" << R.getNameStr() << "' in function '" << FunctionName << "' from '" << FileName << "'.\n"; OwningPtr<MemoryBuffer> result; diff --git a/polly/lib/Exchange/ScopLib.cpp b/polly/lib/Exchange/ScopLib.cpp index 81db7e3767a..dc183cf0655 100644 --- a/polly/lib/Exchange/ScopLib.cpp +++ b/polly/lib/Exchange/ScopLib.cpp @@ -76,7 +76,7 @@ void ScopLib::initializeArrays() { VE = ArrayMap.end(); VI != VE; ++VI) if ((*VI).second == i) { const Value *V = (*VI).first; - std::string name = V->getNameStr(); + std::string name = V->getName(); scoplib->arrays[i] = (char*) malloc(sizeof(char*) * (name.size() + 1)); strcpy(scoplib->arrays[i], name.c_str()); } diff --git a/polly/lib/Exchange/ScopLibExporter.cpp b/polly/lib/Exchange/ScopLibExporter.cpp index 24f4ab405ea..583240d51cb 100755 --- a/polly/lib/Exchange/ScopLibExporter.cpp +++ b/polly/lib/Exchange/ScopLibExporter.cpp @@ -54,7 +54,7 @@ char ScopLibExporter::ID = 0; std::string ScopLibExporter::getFileName(Scop *S) const { std::string FunctionName = - S->getRegion().getEntry()->getParent()->getNameStr(); + S->getRegion().getEntry()->getParent()->getName(); std::string FileName = FunctionName + "___" + S->getNameStr() + ".scoplib"; return FileName; } @@ -76,7 +76,7 @@ bool ScopLibExporter::runOnScop(Scop &scop) { scoplib.print(F); fclose(F); - std::string FunctionName = R->getEntry()->getParent()->getNameStr(); + std::string FunctionName = R->getEntry()->getParent()->getName(); errs() << "Writing Scop '" << R->getNameStr() << "' in function '" << FunctionName << "' to '" << FileName << "'.\n"; diff --git a/polly/lib/Exchange/ScopLibImporter.cpp b/polly/lib/Exchange/ScopLibImporter.cpp index 0a4b97b69d6..bf90857f893 100755 --- a/polly/lib/Exchange/ScopLibImporter.cpp +++ b/polly/lib/Exchange/ScopLibImporter.cpp @@ -62,7 +62,7 @@ char ScopLibImporter::ID = 0; namespace { std::string ScopLibImporter::getFileName(Scop *S) const { std::string FunctionName = - S->getRegion().getEntry()->getParent()->getNameStr(); + S->getRegion().getEntry()->getParent()->getName(); std::string FileName = FunctionName + "___" + S->getNameStr() + ".scoplib"; return FileName; } @@ -85,7 +85,7 @@ bool ScopLibImporter::runOnRegion(Region *R, RGPassManager &RGM) { return false; } - std::string FunctionName = R->getEntry()->getParent()->getNameStr(); + std::string FunctionName = R->getEntry()->getParent()->getName(); errs() << "Reading Scop '" << R->getNameStr() << "' in function '" << FunctionName << "' from '" << FileName << "'.\n"; diff --git a/polly/lib/RegionSimplify.cpp b/polly/lib/RegionSimplify.cpp index a81bf596c5a..9d1be9b2b14 100644 --- a/polly/lib/RegionSimplify.cpp +++ b/polly/lib/RegionSimplify.cpp @@ -73,11 +73,11 @@ void RegionSimplify::print(raw_ostream &O, const Module *M) const { O << "Region: " << r->getNameStr() << " Edges:\t"; if (enteringBlock) - O << "Entering: [" << enteringBlock->getNameStr() << " -> " + O << "Entering: [" << enteringBlock->getName() << " -> " << r->getEntry()->getName() << "], "; if (exitingBlock) { - O << "Exiting: [" << exitingBlock->getNameStr() << " -> "; + O << "Exiting: [" << exitingBlock->getName() << " -> "; if (r->getExit()) O << r->getExit()->getName(); else |

