svadev AT lists.siebelschool.illinois.edu
Subject: Svadev mailing list
List archive
- From: Randy MacLeod <rwmacleod AT gmail.com>
- To: svadev AT cs.uiuc.edu
- Subject: [svadev] getNameStr() -> getName().str() for poolalloc and safecode
- Date: Sun, 11 Dec 2011 22:32:26 -0500
- List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev>
- List-id: <svadev.cs.uiuc.edu>
I was compiling safe from llvm/clang head and fixed
the recent drppage of getNameStr(). Note that I don't know your code
and it's been a while since I looked at C++ so you should check that
what I did is correct (but you were going to do that anyway, I assume).
I also commented out a few unused variables and marked them as:
// Unused: someVar...
Oh and I'm on Ubuntu-11.10-64 bit using gcc-4.6.1 and
I'm at the point where it seems I should reconfigure to use clang
as the compiler...
Maybe I'll got back to using the clang/llvm 3.0 preproduction release
until I get my bearings.
Hope this helps.
--
../Randy/..
Index: include/dsa/svset.h =================================================================== --- include/dsa/svset.h (revision 146353) +++ include/dsa/svset.h (working copy) @@ -223,7 +223,7 @@ const_iterator ii = begin(); const_iterator ee = end(); const_iterator rhs_ii = rhs.begin(); - const_iterator rhs_ee = rhs.end(); + // Unused: const_iterator rhs_ee = rhs.end(); while (ii != ee) { if (*rhs_ii < *ii) return false; if (*ii < *rhs_ii) return true; Index: lib/DSA/CallTargets.cpp =================================================================== --- lib/DSA/CallTargets.cpp (revision 146353) +++ lib/DSA/CallTargets.cpp (working copy) @@ -142,13 +142,13 @@ O << "* "; CallSite cs = ii->first; cs.getInstruction()->dump(); - O << cs.getInstruction()->getParent()->getParent()->getNameStr() << " " - << cs.getInstruction()->getNameStr() << " "; + O << cs.getInstruction()->getParent()->getParent()->getName().str() << " " + << cs.getInstruction()->getName().str() << " "; } O << ii->first.getInstruction() << ":"; for (std::vector<const Function*>::const_iterator i = ii->second.begin(), e = ii->second.end(); i != e; ++i) { - O << " " << (*i)->getNameStr(); + O << " " << (*i)->getName().str(); } O << "\n"; } Index: lib/DSA/StdLibPass.cpp =================================================================== --- lib/DSA/StdLibPass.cpp (revision 146353) +++ lib/DSA/StdLibPass.cpp (working copy) @@ -442,16 +442,16 @@ if (CI->getCalledValue() == F) { DSGraph* Graph = getDSGraph(*CI->getParent()->getParent()); //delete the call - DEBUG(errs() << "Removing " << F->getNameStr() << " from " - << CI->getParent()->getParent()->getNameStr() << "\n"); + DEBUG(errs() << "Removing " << F->getName().str() << " from " + << CI->getParent()->getParent()->getName().str() << "\n"); Graph->removeFunctionCalls(*F); } }else if (InvokeInst* CI = dyn_cast<InvokeInst>(*ii)){ if (CI->getCalledValue() == F) { DSGraph* Graph = getDSGraph(*CI->getParent()->getParent()); //delete the call - DEBUG(errs() << "Removing " << F->getNameStr() << " from " - << CI->getParent()->getParent()->getNameStr() << "\n"); + DEBUG(errs() << "Removing " << F->getName().str() << " from " + << CI->getParent()->getParent()->getName().str() << "\n"); Graph->removeFunctionCalls(*F); } } else if(ConstantExpr *CE = dyn_cast<ConstantExpr>(*ii)) { @@ -462,8 +462,8 @@ if(CI->getCalledValue() == CE) { DSGraph* Graph = getDSGraph(*CI->getParent()->getParent()); //delete the call - DEBUG(errs() << "Removing " << F->getNameStr() << " from " - << CI->getParent()->getParent()->getNameStr() << "\n"); + DEBUG(errs() << "Removing " << F->getName().str() << " from " + << CI->getParent()->getParent()->getName().str() << "\n"); Graph->removeFunctionCalls(*F); } } Index: lib/DSA/DataStructureStats.cpp =================================================================== --- lib/DSA/DataStructureStats.cpp (revision 146353) +++ lib/DSA/DataStructureStats.cpp (working copy) @@ -134,7 +134,7 @@ ++numIndirectCalls; } else { DEBUG(errs() << "WARNING: No callee in Function '" - << F.getNameStr() << " at call: \n" + << F.getName().str() << " at call: \n" << *I->getCallSite().getInstruction()); } } Index: lib/DSA/EntryPointAnalysis.cpp =================================================================== --- lib/DSA/EntryPointAnalysis.cpp (revision 146353) +++ lib/DSA/EntryPointAnalysis.cpp (working copy) @@ -65,7 +65,7 @@ bool prev = false; for (std::vector<const Function*>::iterator ii = d.begin(), ee = d.end(); ii != ee; ++ii) { - O << (prev ? ", " : "") << (*ii)->getNameStr(); + O << (prev ? ", " : "") << (*ii)->getName().str(); prev = true; } O << "\n"; @@ -88,7 +88,7 @@ return !F->isDeclaration() && F->hasExternalLinkage() && F->hasName() - && names.find(F->getNameStr()) != names.end(); + && names.find(F->getName().str()) != names.end(); } else { return !F->isDeclaration() && F->hasExternalLinkage() Index: lib/DSA/Printer.cpp =================================================================== --- lib/DSA/Printer.cpp (revision 146353) +++ lib/DSA/Printer.cpp (working copy) @@ -107,7 +107,7 @@ I != E; ++I) { DSNodeHandle VANode = I->second; if (N == VANode.getNode()) { - OS << "(VANode for " << I->first->getNameStr() << ")\n"; + OS << "(VANode for " << I->first->getName().str() << ")\n"; } } @@ -235,7 +235,7 @@ if (G->getReturnNodes().size() == 1) Label = "returning"; else - Label = I->first->getNameStr() + " ret node"; + Label = I->first->getName().str() + " ret node"; // Output the return node... GW.emitSimpleNode((void*)I->first, "plaintext=circle", Label); @@ -345,23 +345,23 @@ //otherwise check the name if (!doPrint) doPrint = OnlyPrint.end() != - std::find(OnlyPrint.begin(), OnlyPrint.end(), I->getNameStr()); + std::find(OnlyPrint.begin(), OnlyPrint.end(), I->getName().str()); if (doPrint) { const Function *SCCFn = Gr->retnodes_begin()->first; if (&*I == SCCFn) { - Gr->writeGraphToFile(O, Prefix+I->getNameStr()); + Gr->writeGraphToFile(O, Prefix+I->getName().str()); } else { IsDuplicateGraph = true; // Don't double count node/call nodes. - O << "Didn't write '" << Prefix+I->getNameStr() - << ".dot' - Graph already emitted to '" << Prefix+SCCFn->getNameStr() + O << "Didn't write '" << Prefix+I->getName().str() + << ".dot' - Graph already emitted to '" << Prefix+SCCFn->getName().str() << "\n"; } } else { const Function *SCCFn = Gr->retnodes_begin()->first; if (&*I == SCCFn) { -// O << "Skipped Writing '" << Prefix+I->getNameStr() << ".dot'... [" -// << Gr->getGraphSize() << "+" << NumCalls << "]\n"; + O << "Skipped Writing '" << Prefix+I->getName().str() << ".dot'... [" + << Gr->getGraphSize() << "+" << NumCalls << "]\n"; } else { IsDuplicateGraph = true; // Don't double count node/call nodes. } Index: lib/DSA/TopDownClosure.cpp =================================================================== --- lib/DSA/TopDownClosure.cpp (revision 146353) +++ lib/DSA/TopDownClosure.cpp (working copy) @@ -254,12 +254,12 @@ const DSCallSite &CS = *EdgesFromCaller.back().CS; const Function &CF = *EdgesFromCaller.back().CalledFunction; DEBUG(errs() << " [TD] Inlining graph into Fn '" - << CF.getNameStr() << "' from "); + << CF.getName().str() << "' from "); if (CallerGraph->getReturnNodes().empty()) { DEBUG(errs() << "SYNTHESIZED INDIRECT GRAPH"); } else { DEBUG(errs() << "Fn '" << CS.getCallSite().getInstruction()-> - getParent()->getParent()->getNameStr() << "'"); + getParent()->getParent()->getName().str() << "'"); } DEBUG(errs() << ": " << CF.getFunctionType()->getNumParams() << " args\n"); Index: lib/DSA/DSGraph.cpp =================================================================== --- lib/DSA/DSGraph.cpp (revision 146353) +++ lib/DSA/DSGraph.cpp (working copy) @@ -99,7 +99,7 @@ std::string Return; for (DSGraph::retnodes_iterator I = retnodes_begin(); I != retnodes_end(); ++I) - Return += I->first->getNameStr() + " "; + Return += I->first->getName().str() + " "; Return.erase(Return.end()-1, Return.end()); // Remove last space character return Return; } @@ -765,7 +765,7 @@ for (Function::const_arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I){ if(TypeInferenceOptimize) { - if(I->getNameStr() == "argv") + if(I->getName().str() == "argv") continue; } if (isa<PointerType>(I->getType())) @@ -820,13 +820,13 @@ E = ScalarMap.global_end(); I != E; ++I) { if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(*I)) { if(TypeInferenceOptimize) { - if(GV->getNameStr() == "stderr"){ + if(GV->getName().str() == "stderr"){ continue; } - if(GV->getNameStr() == "stdout"){ + if(GV->getName().str() == "stdout"){ continue; } - if(GV->getNameStr() == "stdin"){ + if(GV->getName().str() == "stdin"){ continue; } } Index: lib/DSA/Local.cpp =================================================================== --- lib/DSA/Local.cpp (revision 146353) +++ lib/DSA/Local.cpp (working copy) @@ -1315,8 +1315,8 @@ DSNodeHandle& DHV = GlobalsGraph->getNodeForValue(V); for (svset<Value*>::iterator SI = inSection.begin(), SE = inSection.end(); SI != SE; ++SI) { - DEBUG(errs() << "Merging " << V->getNameStr() << " with " - << (*SI)->getNameStr() << "\n"); + DEBUG(errs() << "Merging " << V->getName().str() << " with " + << (*SI)->getName().str() << "\n"); GlobalsGraph->getNodeForValue(*SI).mergeWith(DHV); } } Index: lib/DSA/DataStructure.cpp =================================================================== --- lib/DSA/DataStructure.cpp (revision 146353) +++ lib/DSA/DataStructure.cpp (working copy) @@ -322,7 +322,7 @@ std::vector<const Function *> List; addFullFunctionList (List); for (unsigned index = 0; index < List.size(); ++index) { - std::cerr << List[index]->getNameStr() << std::endl; + std::cerr << List[index]->getName().str() << std::endl; } return; } Index: lib/DSA/AllocatorIdentification.cpp =================================================================== --- lib/DSA/AllocatorIdentification.cpp (revision 146353) +++ lib/DSA/AllocatorIdentification.cpp (working copy) @@ -144,7 +144,7 @@ if(changed) { ++numAllocators; allocators.insert(WrapperF->getName()); - DEBUG(errs() << WrapperF->getNameStr() << "\n"); + // DEBUG(errs() << WrapperF->getNameStr() << "\n"); } } } @@ -179,7 +179,7 @@ if(changed) { ++numDeallocators; deallocators.insert(WrapperF->getName()); - DEBUG(errs() << WrapperF->getNameStr() << "\n"); + // DEBUG(errs() << WrapperF->getNameStr() << "\n"); } } } Index: lib/AssistDS/TypeChecks.cpp =================================================================== --- lib/AssistDS/TypeChecks.cpp (revision 146353) +++ lib/AssistDS/TypeChecks.cpp (working copy) @@ -661,7 +661,7 @@ false); Function *NewF = Function::Create(NewFTy, GlobalValue::InternalLinkage, - F.getNameStr() + ".mod", + F.getName().str() + ".mod", &M); // 3. Set the mapping for the args @@ -785,7 +785,7 @@ // create internal clone Function *F_clone = CloneFunction(&F); - F_clone->setName(F.getNameStr() + "internal"); + F_clone->setName(F.getName().str() + "internal"); F.setLinkage(GlobalValue::InternalLinkage); F.getParent()->getFunctionList().push_back(F_clone); F.replaceAllUsesWith(F_clone); @@ -826,7 +826,7 @@ true); Function *NewF = Function::Create(NewFTy, GlobalValue::InternalLinkage, - F.getNameStr() + ".vararg", + F.getName().str() + ".vararg", &M); // 3. Set the mapping for the args @@ -1018,7 +1018,7 @@ } else { // create internal clone Function *F_clone = CloneFunction(&F); - F_clone->setName(F.getNameStr() + "internal"); + F_clone->setName(F.getName().str() + "internal"); F.setLinkage(GlobalValue::InternalLinkage); F.getParent()->getFunctionList().push_back(F_clone); F.replaceAllUsesWith(F_clone); @@ -1251,11 +1251,11 @@ I != E; ++I) { if(I->use_empty()) continue; - if(I->getNameStr() == "stderr" || - I->getNameStr() == "stdout" || - I->getNameStr() == "stdin" || - I->getNameStr() == "optind" || - I->getNameStr() == "optarg") { + if(I->getName().str() == "stderr" || + I->getName().str() == "stdout" || + I->getName().str() == "stdin" || + I->getName().str() == "optind" || + I->getName().str() == "optarg") { // assume initialized Value *BCI = castTo(I, VoidPtrTy, "", InsertPt); std::vector<Value *> Args; @@ -1533,7 +1533,7 @@ CallInst::Create(trackInitInst, Args, "", I); return true; } - } else if (F->getNameStr() == std::string("_ZNKSs5c_strEv")) { //c_str + } else if (F->getName().str() == std::string("_ZNKSs5c_strEv")) { //c_str std::vector<Value *>Args; Args.push_back(I); Args.push_back(getTagCounter()); @@ -1547,7 +1547,7 @@ } else ++InsertPt; CI->insertBefore(InsertPt); - } else if (F->getNameStr() == std::string("_ZNSsC1EPKcRKSaIcE")) { //c_str() + } else if (F->getName().str() == std::string("_ZNSsC1EPKcRKSaIcE")) { //c_str() Value *BCI = castTo(CS.getArgument(0), VoidPtrTy, "", I); std::vector<Value *>Args; Args.push_back(BCI); @@ -1562,7 +1562,7 @@ } else ++InsertPt; CI->insertBefore(InsertPt); - } else if (F->getNameStr() == std::string("accept")) { + } else if (F->getName().str() == std::string("accept")) { CastInst *BCI = BitCastInst::CreatePointerCast(CS.getArgument(1), VoidPtrTy); BCI->insertAfter(I); CastInst *BCI_Size = BitCastInst::CreatePointerCast(CS.getArgument(2), VoidPtrTy); @@ -1574,7 +1574,7 @@ Constant *F = M.getOrInsertFunction("trackaccept", VoidTy, VoidPtrTy,VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("poll")) { + } else if (F->getName().str() == std::string("poll")) { CastInst *BCI = BitCastInst::CreatePointerCast(CS.getArgument(0), VoidPtrTy); BCI->insertAfter(I); std::vector<Value*>Args; @@ -1584,7 +1584,7 @@ Constant *F = M.getOrInsertFunction("trackpoll", VoidTy, VoidPtrTy, Int64Ty, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("getaddrinfo")) { + } else if (F->getName().str() == std::string("getaddrinfo")) { CastInst *BCI = BitCastInst::CreatePointerCast(CS.getArgument(3), VoidPtrTy); BCI->insertAfter(I); std::vector<Value *>Args; @@ -1593,7 +1593,7 @@ Constant *F = M.getOrInsertFunction("trackgetaddrinfo", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("mmap")) { + } else if (F->getName().str() == std::string("mmap")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); std::vector<Value *> Args; @@ -1602,7 +1602,7 @@ Args.push_back(getTagCounter()); CallInst *CI = CallInst::Create(trackInitInst, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("__strdup")) { + } else if (F->getName().str() == std::string("__strdup")) { CastInst *BCI_Dest = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI_Dest->insertAfter(I); CastInst *BCI_Src = BitCastInst::CreatePointerCast(CS.getArgument(0), VoidPtrTy); @@ -1614,9 +1614,9 @@ Constant *F = M.getOrInsertFunction("trackStrcpyInst", VoidTy, VoidPtrTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI_Src); - } else if (F->getNameStr() == std::string("gettimeofday") || - F->getNameStr() == std::string("time") || - F->getNameStr() == std::string("times")) { + } else if (F->getName().str() == std::string("gettimeofday") || + F->getName().str() == std::string("time") || + F->getName().str() == std::string("times")) { Value *BCI = castTo(CS.getArgument(0), VoidPtrTy, "", I); assert (isa<PointerType>(CS.getArgument(0)->getType())); PointerType * PT = cast<PointerType>(CS.getArgument(0)->getType()); @@ -1627,7 +1627,7 @@ Args.push_back(AllocSize); Args.push_back(getTagCounter()); CallInst::Create(trackInitInst, Args, "", I); - } else if (F->getNameStr() == std::string("getpwuid")) { + } else if (F->getName().str() == std::string("getpwuid")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); std::vector<Value *>Args; @@ -1636,7 +1636,7 @@ Constant *F = M.getOrInsertFunction("trackgetpwuid", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("getpwnam")) { + } else if (F->getName().str() == std::string("getpwnam")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); std::vector<Value *>Args; @@ -1645,7 +1645,7 @@ Constant *F = M.getOrInsertFunction("trackgetpwuid", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if(F->getNameStr() == std::string("getopt_long")) { + } else if(F->getName().str() == std::string("getopt_long")) { Value *OptArg = M.getNamedGlobal("optarg"); LoadInst *LI = new LoadInst(OptArg); LI->insertAfter(I); @@ -1655,10 +1655,10 @@ Constant *F = M.getOrInsertFunction("trackgetcwd", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(LI); - } else if (F->getNameStr() == std::string("getgruid") || - F->getNameStr() == std::string("getgrnam") || - F->getNameStr() == std::string("getpwnam") || - F->getNameStr() == std::string("__errno_location")) { + } else if (F->getName().str() == std::string("getgruid") || + F->getName().str() == std::string("getgrnam") || + F->getName().str() == std::string("getpwnam") || + F->getName().str() == std::string("__errno_location")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); assert (isa<PointerType>(I->getType())); PointerType * PT = cast<PointerType>(I->getType()); @@ -1671,7 +1671,7 @@ Args.push_back(getTagCounter()); CallInst *CI = CallInst::Create(trackInitInst, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("getservbyname")) { + } else if (F->getName().str() == std::string("getservbyname")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); std::vector<Value*>Args; @@ -1680,8 +1680,8 @@ Constant *F = M.getOrInsertFunction("trackgetservbyname", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("gethostbyname") || - F->getNameStr() == std::string("gethostbyaddr")) { + } else if (F->getName().str() == std::string("gethostbyname") || + F->getName().str() == std::string("gethostbyaddr")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); std::vector<Value*>Args; @@ -1690,7 +1690,7 @@ Constant *F = M.getOrInsertFunction("trackgethostbyname", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("gethostname")) { + } else if (F->getName().str() == std::string("gethostname")) { CastInst *BCI = BitCastInst::CreatePointerCast(CS.getArgument(0), VoidPtrTy); BCI->insertAfter(I); std::vector<Value*>Args; @@ -1699,9 +1699,9 @@ Constant *F = M.getOrInsertFunction("trackgethostname", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("getenv") || - F->getNameStr() == std::string("strerror") || - F->getNameStr() == std::string("inet_ntoa")) { + } else if (F->getName().str() == std::string("getenv") || + F->getName().str() == std::string("strerror") || + F->getName().str() == std::string("inet_ntoa")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); std::vector<Value *>Args; @@ -1710,7 +1710,7 @@ Constant *F = M.getOrInsertFunction("trackgetcwd", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("getcwd")) { + } else if (F->getName().str() == std::string("getcwd")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); std::vector<Value *>Args; @@ -1719,7 +1719,7 @@ Constant *F = M.getOrInsertFunction("trackgetcwd", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if(F->getNameStr() == std::string("crypt")) { + } else if(F->getName().str() == std::string("crypt")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); std::vector<Value *>Args; @@ -1728,12 +1728,12 @@ Constant *F = M.getOrInsertFunction("trackgetcwd", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("getrusage") || - F->getNameStr() == std::string("getrlimit") || - F->getNameStr() == std::string("stat") || - F->getNameStr() == std::string("vfsstat") || - F->getNameStr() == std::string("fstat") || - F->getNameStr() == std::string("lstat")) { + } else if (F->getName().str() == std::string("getrusage") || + F->getName().str() == std::string("getrlimit") || + F->getName().str() == std::string("stat") || + F->getName().str() == std::string("vfsstat") || + F->getName().str() == std::string("fstat") || + F->getName().str() == std::string("lstat")) { Value *BCI = castTo(CS.getArgument(1), VoidPtrTy, "", I); assert (isa<PointerType>(CS.getArgument(1)->getType())); PointerType * PT = cast<PointerType>(CS.getArgument(1)->getType()); @@ -1744,7 +1744,7 @@ Args.push_back(AllocSize); Args.push_back(getTagCounter()); CallInst::Create(trackInitInst, Args, "", I); - } else if (F->getNameStr() == std::string("sigaction")) { + } else if (F->getName().str() == std::string("sigaction")) { Value *BCI = castTo(CS.getArgument(2), VoidPtrTy, "", I); assert (isa<PointerType>(CS.getArgument(2)->getType())); PointerType * PT = cast<PointerType>(CS.getArgument(2)->getType()); @@ -1755,7 +1755,7 @@ Args.push_back(AllocSize); Args.push_back(getTagCounter()); CallInst::Create(trackInitInst, Args, "", I); - } else if (F->getNameStr() == std::string("__ctype_b_loc")) { + } else if (F->getName().str() == std::string("__ctype_b_loc")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); std::vector<Value *>Args; @@ -1764,7 +1764,7 @@ Constant *F = M.getOrInsertFunction("trackctype", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("__ctype_toupper_loc")) { + } else if (F->getName().str() == std::string("__ctype_toupper_loc")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); std::vector<Value *>Args; @@ -1773,7 +1773,7 @@ Constant *F = M.getOrInsertFunction("trackctype_32", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("__ctype_tolower_loc")) { + } else if (F->getName().str() == std::string("__ctype_tolower_loc")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); std::vector<Value *>Args; @@ -1782,8 +1782,8 @@ Constant *F = M.getOrInsertFunction("trackctype_32", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("strtol") || - F->getNameStr() == std::string("strtod")) { + } else if (F->getName().str() == std::string("strtol") || + F->getName().str() == std::string("strtod")) { Value *BCI = castTo(CS.getArgument(1), VoidPtrTy, "", I); PointerType *PTy = cast<PointerType>(CS.getArgument(1)->getType()); Type * ElementType = PTy->getElementType(); @@ -1793,8 +1793,8 @@ Args.push_back(getTagCounter()); CallInst::Create(trackInitInst, Args, "", I); return true; - } else if (F->getNameStr() == std::string("strcat") || - F->getNameStr() == std::string("_ZNSspLEPKc")) { + } else if (F->getName().str() == std::string("strcat") || + F->getName().str() == std::string("_ZNSspLEPKc")) { Value *BCI_Src = castTo(CS.getArgument(1), VoidPtrTy, "", I); Value *BCI_Dest = castTo(CS.getArgument(0), VoidPtrTy, "", I); std::vector<Value *> Args; @@ -1803,14 +1803,14 @@ Args.push_back(getTagCounter()); Constant *F = M.getOrInsertFunction("trackStrcatInst", VoidTy, VoidPtrTy, VoidPtrTy, Int32Ty, NULL); CallInst::Create(F, Args, "", I); - } else if (F->getNameStr() == std::string("strcpy")) { + } else if (F->getName().str() == std::string("strcpy")) { std::vector<Value *> Args; Args.push_back(CS.getArgument(0)); Args.push_back(CS.getArgument(1)); Args.push_back(getTagCounter()); Constant *F = M.getOrInsertFunction("trackStrcpyInst", VoidTy, VoidPtrTy, VoidPtrTy, Int32Ty, NULL); CallInst::Create(F, Args, "", I); - } else if (F->getNameStr() == std::string("strncpy")) { + } else if (F->getName().str() == std::string("strncpy")) { std::vector<Value *>Args; Args.push_back(CS.getArgument(0)); Args.push_back(CS.getArgument(1)); @@ -1818,7 +1818,7 @@ Args.push_back(getTagCounter()); Constant *F = M.getOrInsertFunction("trackStrncpyInst", VoidTy, VoidPtrTy, VoidPtrTy, I->getOperand(3)->getType(), Int32Ty, NULL); CallInst::Create(F, Args, "", I); - } else if (F->getNameStr() == std::string("readlink")) { + } else if (F->getName().str() == std::string("readlink")) { std::vector<Value *>Args; Args.push_back(CS.getArgument(1)); Args.push_back(I); @@ -1826,7 +1826,7 @@ Constant *F = M.getOrInsertFunction("trackReadLink", VoidTy, VoidPtrTy, I->getType(), Int32Ty, NULL); CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(I); - } else if (F->getNameStr() == std::string("pipe")) { + } else if (F->getName().str() == std::string("pipe")) { Value *BCI = castTo(CS.getArgument(0), VoidPtrTy, "", I); std::vector<Value*> Args; Args.push_back(BCI); @@ -1834,7 +1834,7 @@ Constant *F = M.getOrInsertFunction("trackpipe", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst::Create(F, Args, "", I); return true; - } else if (F->getNameStr() == std::string("getsockname")) { + } else if (F->getName().str() == std::string("getsockname")) { CastInst *BCI = BitCastInst::CreatePointerCast(CS.getArgument(1), VoidPtrTy); BCI->insertAfter(I); CastInst *BCI_Size = BitCastInst::CreatePointerCast(CS.getArgument(2), VoidPtrTy); @@ -1847,7 +1847,7 @@ CallInst *CI = CallInst::Create(F, Args); CI->insertAfter(BCI); return true; - } else if (F->getNameStr() == std::string("readdir")) { + } else if (F->getName().str() == std::string("readdir")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); PointerType *PTy = cast<PointerType>(I->getType()); @@ -1859,8 +1859,8 @@ CallInst *CI = CallInst::Create(trackInitInst, Args); CI->insertAfter(BCI); return true; - } else if (F->getNameStr() == std::string("localtime") || - F->getNameStr() == std::string("gmtime")) { + } else if (F->getName().str() == std::string("localtime") || + F->getName().str() == std::string("gmtime")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); PointerType *PTy = cast<PointerType>(I->getType()); @@ -1871,8 +1871,8 @@ Args.push_back(getTagCounter()); CallInst *CI = CallInst::Create(trackInitInst, Args); CI->insertAfter(BCI); - } else if (F->getNameStr() == std::string("ftime") || - F->getNameStr() == std::string("gettimeofday")) { + } else if (F->getName().str() == std::string("ftime") || + F->getName().str() == std::string("gettimeofday")) { Value *BCI = castTo(CS.getArgument(0), VoidPtrTy, "", I); PointerType *PTy = cast<PointerType>(CS.getArgument(0)->getType()); Type * ElementType = PTy->getElementType(); @@ -1882,7 +1882,7 @@ Args.push_back(getTagCounter()); CallInst::Create(trackInitInst, Args, "", I); return true; - } else if(F->getNameStr() == std::string("read")) { + } else if(F->getName().str() == std::string("read")) { CastInst *BCI = BitCastInst::CreatePointerCast(CS.getArgument(1), VoidPtrTy); BCI->insertAfter(I); std::vector<Value *> Args; @@ -1894,7 +1894,7 @@ CallInst *CI = CallInst::Create(trackInitInst, Args); CI->insertAfter(BCI); return true; - } else if(F->getNameStr() == std::string("fread")) { + } else if(F->getName().str() == std::string("fread")) { CastInst *BCI = BitCastInst::CreatePointerCast(CS.getArgument(0), VoidPtrTy); BCI->insertAfter(I); std::vector<Value *> Args; @@ -1908,7 +1908,7 @@ CallInst *CI = CallInst::Create(trackInitInst, Args); CI->insertAfter(BCI); return true; - } else if(F->getNameStr() == std::string("calloc")) { + } else if(F->getName().str() == std::string("calloc")) { CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI->insertAfter(I); std::vector<Value *> Args; @@ -1927,7 +1927,7 @@ CallInst *CI_Arr = CallInst::Create(trackArray, Args1); CI_Arr->insertAfter(CI); return true; - } else if(F->getNameStr() == std::string("realloc")) { + } else if(F->getName().str() == std::string("realloc")) { CastInst *BCI_Src = BitCastInst::CreatePointerCast(CS.getArgument(0), VoidPtrTy); CastInst *BCI_Dest = BitCastInst::CreatePointerCast(I, VoidPtrTy); BCI_Src->insertAfter(I); @@ -1941,7 +1941,7 @@ CallInst *CI = CallInst::Create(copyTypeInfo, Args); CI->insertAfter(BCI_Dest); return true; - } else if(F->getNameStr() == std::string("fgets")) { + } else if(F->getName().str() == std::string("fgets")) { Value *BCI = castTo(CS.getArgument(0), VoidPtrTy, "", I); std::vector<Value *> Args; Args.push_back(BCI); @@ -1950,8 +1950,8 @@ Args.push_back(getTagCounter()); CallInst::Create(trackInitInst, Args, "", I); return true; - } else if(F->getNameStr() == std::string("snprintf") || - F->getNameStr() == std::string("vsnprintf")) { + } else if(F->getName().str() == std::string("snprintf") || + F->getName().str() == std::string("vsnprintf")) { Value *BCI = castTo(CS.getArgument(0), VoidPtrTy, "", I); std::vector<Value*>Args; Args.push_back(BCI); @@ -1959,7 +1959,7 @@ Constant *F = M.getOrInsertFunction("trackgetcwd", VoidTy, VoidPtrTy, Int32Ty, NULL); CallInst *CINew = CallInst::Create(F, Args); CINew->insertAfter(I); - } else if(F->getNameStr() == std::string("sprintf")) { + } else if(F->getName().str() == std::string("sprintf")) { Value *BCI = castTo(CS.getArgument(0), VoidPtrTy, "", I); std::vector<Value*>Args; Args.push_back(BCI); @@ -1973,20 +1973,20 @@ Args.push_back(getTagCounter()); CallInst *CINew = CallInst::Create(trackInitInst, Args); CINew->insertAfter(NewValue); - } else if(F->getNameStr() == std::string("scanf")) { + } else if(F->getName().str() == std::string("scanf")) { unsigned i = 1; while(i < CS.arg_size()) { visitInputFunctionValue(M, CS.getArgument(i), I); i++; } - } else if(F->getNameStr() == std::string("sscanf")) { + } else if(F->getName().str() == std::string("sscanf")) { // FIXME: Need to look at the format string and check unsigned i = 2; while(i < CS.arg_size()) { visitInputFunctionValue(M, CS.getArgument(i), I); i++; } - } else if(F->getNameStr() == std::string("fscanf")) { + } else if(F->getName().str() == std::string("fscanf")) { unsigned i = 2; while(i < CS.arg_size()) { visitInputFunctionValue(M, CS.getArgument(i), I); @@ -2207,11 +2207,11 @@ if(!Prev) { AI_New = PHINode::Create(AI->getType(), PH->getNumIncomingValues(), - PH->getNameStr() + ".md", + PH->getName().str() + ".md", PH); BCI_New = PHINode::Create(BCI->getType(), PH->getNumIncomingValues(), - PH->getNameStr() + ".baseptr", + PH->getName().str() + ".baseptr", PH); for(unsigned c = 0; c < PH->getNumIncomingValues(); c++) { if(PH->getIncomingValue(c) == I) { Index: lib/AssistDS/FuncSpec.cpp =================================================================== --- lib/AssistDS/FuncSpec.cpp (revision 146353) +++ lib/AssistDS/FuncSpec.cpp (working copy) @@ -60,12 +60,12 @@ if (isa<FunctionType>(Ty->getElementType())) { // Store the index of such an argument FPArgs.push_back(ii->getArgNo()); - DEBUG(errs() << "Eligible: " << I->getNameStr() << "\n"); + DEBUG(errs() << "Eligible: " << I->getName().str() << "\n"); } } else if (isa<FunctionType>(ii->getType())) { // Store the index of such an argument FPArgs.push_back(ii->getArgNo()); - DEBUG(errs() << "Eligible: " << I->getNameStr() << "\n"); + DEBUG(errs() << "Eligible: " << I->getName().str() << "\n"); } } // Now find all call sites that it is called from @@ -97,7 +97,7 @@ for (std::map<std::pair<Function*, std::vector<std::pair<unsigned, Constant*> > >, Function* >::iterator I = toClone.begin(), E = toClone.end(); I != E; ++I) { // Clone all the functions we need cloned Function* DirectF = CloneFunction(I->first.first); - DirectF->setName(I->first.first->getNameStr() + "_SPEC"); + DirectF->setName(I->first.first->getName().str() + "_SPEC"); DirectF->setLinkage(GlobalValue::InternalLinkage); I->first.first->getParent()->getFunctionList().push_back(DirectF); I->second = DirectF; Index: lib/AssistDS/ArgSimplify.cpp =================================================================== --- lib/AssistDS/ArgSimplify.cpp (revision 146353) +++ lib/AssistDS/ArgSimplify.cpp (working copy) @@ -144,7 +144,7 @@ for (Module::iterator I = M.begin(); I != M.end(); ++I) if (!I->isDeclaration() && !I->mayBeOverridden()) { - if(I->getNameStr() == "main") + if(I->getName().str() == "main") continue; std::vector<unsigned> Args; for (Function::arg_iterator ii = I->arg_begin(), ee = I->arg_end(); Index: lib/AssistDS/GEPExprArgs.cpp =================================================================== --- lib/AssistDS/GEPExprArgs.cpp (revision 146353) +++ lib/AssistDS/GEPExprArgs.cpp (working copy) @@ -106,7 +106,7 @@ NewF = Function::Create(NewFTy, GlobalValue::InternalLinkage, - F->getNameStr() + ".TEST", + F->getName().str() + ".TEST", &M); Function::arg_iterator NI = NewF->arg_begin(); Index: lib/AssistDS/LoadArgs.cpp =================================================================== --- lib/AssistDS/LoadArgs.cpp (revision 146353) +++ lib/AssistDS/LoadArgs.cpp (working copy) @@ -140,7 +140,7 @@ } else { NewF = Function::Create(NewFTy, GlobalValue::InternalLinkage, - F->getNameStr() + ".TEST", + F->getName().str() + ".TEST", &M); fnCache[std::make_pair(F, NewFTy)] = NewF; Index: lib/AssistDS/Devirt.cpp =================================================================== --- lib/AssistDS/Devirt.cpp (revision 146353) +++ lib/AssistDS/Devirt.cpp (working copy) @@ -321,7 +321,7 @@ // if (CallInst* CI = dyn_cast<CallInst>(CS.getInstruction())) { std::vector<Value*> Params (CI->op_begin(), CI->op_end()); - std::string name = CI->hasName() ? CI->getNameStr() + ".dv" : ""; + std::string name = CI->hasName() ? CI->getName().str() + ".dv" : ""; CallInst* CN = CallInst::Create ((Value *) NF, Params, name, @@ -330,7 +330,7 @@ CI->eraseFromParent(); } else if (InvokeInst* CI = dyn_cast<InvokeInst>(CS.getInstruction())) { std::vector<Value*> Params (CI->op_begin(), CI->op_end()); - std::string name = CI->hasName() ? CI->getNameStr() + ".dv" : ""; + std::string name = CI->hasName() ? CI->getName().str() + ".dv" : ""; InvokeInst* CN = InvokeInst::Create((Value *) NF, CI->getNormalDest(), CI->getUnwindDest(), Index: lib/PoolAllocate/PoolAllocate.cpp =================================================================== --- lib/PoolAllocate/PoolAllocate.cpp (revision 146353) +++ lib/PoolAllocate/PoolAllocate.cpp (working copy) @@ -936,7 +936,7 @@ // // Create the new function... // - Function *New = Function::Create(FuncTy, Function::InternalLinkage, F.getNameStr() + "_clone"); + Function *New = Function::Create(FuncTy, Function::InternalLinkage, F.getName().str() + "_clone"); F.getParent()->getFunctionList().insert(&F, New); CloneToOrigMap[New] = &F; // Remember original function. @@ -1129,7 +1129,7 @@ // Is this main? If so, make the pool descriptors globals, not automatic // vars. - bool IsMain = F.getNameStr() == "main" && F.hasExternalLinkage(); + bool IsMain = F.getName().str() == "main" && F.hasExternalLinkage(); // // Create each pool and update the DSGraph to account for the new pool. @@ -1260,11 +1260,11 @@ // Add code to create the pools that are local to this function. // if (!FI.NodesToPA.empty()) { - errs() << "[" << F.getNameStr() << "] " << FI.NodesToPA.size() + errs() << "[" << F.getName().str() << "] " << FI.NodesToPA.size() << " nodes pool allocatable\n"; CreatePools(NewF, G, FI.NodesToPA, FI.PoolDescriptors); } else { - DEBUG(errs() << "[" << F.getNameStr() << "] transforming body.\n"); + DEBUG(errs() << "[" << F.getName().str() << "] transforming body.\n"); } // Transform the body of the function now... collecting information about uses @@ -1389,11 +1389,11 @@ InitializedBefore.clear(); DestroyedAfter.clear(); - DEBUG(errs() << "POOL: " << PD->getNameStr() << " information:\n"); + DEBUG(errs() << "POOL: " << PD->getName().str() << " information:\n"); DEBUG(errs() << " Live in blocks: "); DEBUG(for (std::set<BasicBlock*>::iterator I = LiveBlocks.begin(), E = LiveBlocks.end(); I != E; ++I) - errs() << (*I)->getNameStr() << " "); + errs() << (*I)->getName().str() << " "); DEBUG(errs() << "\n"); @@ -1408,7 +1408,7 @@ /*empty*/; PoolInitPoints.push_back(InsertPoint); - if (F.getNameStr() != "main") + if (F.getName().str() != "main") for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) if (isa<ReturnInst>(BB->getTerminator()) || isa<UnwindInst>(BB->getTerminator())) @@ -1507,7 +1507,7 @@ for (unsigned i = 0, e = PoolInitPoints.size(); i != e; ++i) { Value* Opts[3] = {PD, ElSize, Align}; CallInst::Create(PoolInit, Opts, "", PoolInitPoints[i]); - DEBUG(errs() << PoolInitPoints[i]->getParent()->getNameStr() << " "); + DEBUG(errs() << PoolInitPoints[i]->getParent()->getName().str() << " "); } DEBUG(errs() << "\n Destroy in blocks: "); @@ -1516,7 +1516,7 @@ for (unsigned i = 0, e = PoolDestroyPoints.size(); i != e; ++i) { // Insert the pooldestroy call for this pool. CallInst::Create(PoolDestroy, PD, "", PoolDestroyPoints[i]); - DEBUG(errs() << PoolDestroyPoints[i]->getParent()->getNameStr()<<" "); + DEBUG(errs() << PoolDestroyPoints[i]->getParent()->getName().str()<<" "); } DEBUG(errs() << "\n\n"); Index: lib/PoolAllocate/RunTimeAssociate.cpp =================================================================== --- lib/PoolAllocate/RunTimeAssociate.cpp (revision 146353) +++ lib/PoolAllocate/RunTimeAssociate.cpp (working copy) @@ -496,9 +496,9 @@ // if ((UsingBugpoint) && (!CF)) return; if (!CF) errs() << "No Graph for CallSite in " - << TheCall->getParent()->getParent()->getNameStr() + << TheCall->getParent()->getParent()->getName().str() << " originally " - << OrigInst->getParent()->getParent()->getNameStr() + << OrigInst->getParent()->getParent()->getName().str() << "\n"; assert (CF && "No call graph info"); Index: lib/PoolAllocate/TransformFunctionBody.cpp =================================================================== --- lib/PoolAllocate/TransformFunctionBody.cpp (revision 146353) +++ lib/PoolAllocate/TransformFunctionBody.cpp (working copy) @@ -966,7 +966,7 @@ // examining a target that doesn't need it. // const DSCallGraph & callGraph = Graphs.getCallGraph(); - unsigned maxArgsWithNodes = 0; + // Unused: unsigned maxArgsWithNodes = 0; DSCallGraph::callee_iterator I = callGraph.callee_begin(OrigInst); for (; I != callGraph.callee_end(OrigInst); ++I) { @@ -981,12 +981,13 @@ // This call site calls a function, that is not defined in this module if (!(Graphs.hasDSGraph(**sccii))) return; // For all other cases Func Info must exist. - FuncInfo *CFI = PAInfo.getFuncInfo(**sccii); + // Unused due to maxArgsWithNodes + // Unused: FuncInfo *CFI = PAInfo.getFuncInfo(**sccii); // // If this target takes more DSNodes than the last one we found, then // make *this* target our canonical target. // - maxArgsWithNodes = CFI->ArgNodes.size(); + // Unused: maxArgsWithNodes = CFI->ArgNodes.size(); CF = *sccii; break; } @@ -1006,12 +1007,13 @@ // This call site calls a function, that is not defined in this module if (!(Graphs.hasDSGraph(**sccii))) return; // For all other cases Func Info must exist. - FuncInfo *CFI = PAInfo.getFuncInfo(**sccii); + // Unused due to commenting out maxArgsWithNodes + // Unused FuncInfo *CFI = PAInfo.getFuncInfo(**sccii); // // If this target takes more DSNodes than the last one we found, then // make *this* target our canonical target. // - maxArgsWithNodes = CFI->ArgNodes.size(); + // Unused: maxArgsWithNodes = CFI->ArgNodes.size(); CF = *sccii; } } Index: lib/PoolAllocate/PASimple.cpp =================================================================== --- lib/PoolAllocate/PASimple.cpp (revision 146353) +++ lib/PoolAllocate/PASimple.cpp (working copy) @@ -214,7 +214,7 @@ // std::string name = I->getName(); if (name == "__poolalloc_init") continue; - if (name == PoolInit->getNameStr()) continue; + if (name == PoolInit->getName().str()) continue; // // Skip declarations. Index: lib/PoolAllocate/PointerCompress.cpp =================================================================== --- lib/PoolAllocate/PointerCompress.cpp (revision 146353) +++ lib/PoolAllocate/PointerCompress.cpp (working copy) @@ -715,7 +715,7 @@ } - gep_type_iterator GTI = gep_type_begin(GEPI), E = gep_type_end(GEPI); + gep_type_iterator GTI = gep_type_begin(GEPI); // Unused: , E = gep_type_end(GEPI); for (unsigned i = 1, e = GEPI.getNumOperands(); i != e; ++i, ++GTI) { Value *Idx = GEPI.getOperand(i); if (StructType *STy = dyn_cast<StructType>(*GTI)) { @@ -1196,7 +1196,7 @@ Value*> &PreassignedPools, Function &F, DSGraph* DSG, PA::FuncInfo *FI) { - DEBUG(errs() << "In function '" << F.getNameStr() << "':\n"); + DEBUG(errs() << "In function '" << F.getName().str() << "':\n"); for (unsigned i = 0, e = FI->NodesToPA.size(); i != e; ++i) { const DSNode *N = FI->NodesToPA[i]; @@ -1262,7 +1262,7 @@ if (FI == 0) { errs() << "DIDN'T FIND POOL INFO FOR: " - << *F.getType() << F.getNameStr() << "!\n"; + << *F.getType() << F.getName().str() << "!\n"; return false; } @@ -1313,7 +1313,7 @@ // particular, if one pool points to another, we need to know if the outgoing // pointer is compressed. const TargetData &TD = DSG->getTargetData(); - errs() << "In function '" << F.getNameStr() << "':\n"; + errs() << "In function '" << F.getName().str() << "':\n"; for (std::map<const DSNode*, CompressedPoolInfo>::iterator I = PoolsToCompress.begin(), E = PoolsToCompress.end(); I != E; ++I) { @@ -1322,7 +1322,7 @@ // Only dump info about a compressed pool if this is the home for it. if (isa<AllocaInst>(I->second.getPoolDesc()) || (isa<GlobalValue>(I->second.getPoolDesc()) && - F.hasExternalLinkage() && F.getNameStr() == "main")) { + F.hasExternalLinkage() && F.getName().str() == "main")) { errs() << " COMPRESSING POOL:\nPCS:"; I->second.dump(); } @@ -1367,7 +1367,7 @@ // Next, create the clone prototype and insert it into the module. Clone = Function::Create (CFTy, GlobalValue::ExternalLinkage, - F->getNameStr()+"_pc"); + F->getName().str()+"_pc"); F->getParent()->getFunctionList().insert(F, Clone); return Clone; } @@ -1413,7 +1413,7 @@ // Next, create the clone prototype and insert it into the module. Clone = Function::Create (CFTy, GlobalValue::InternalLinkage, - F->getNameStr()+".pc"); + F->getName().str()+".pc"); F->getParent()->getFunctionList().insert(F, Clone); // Remember where this clone came from. @@ -1421,8 +1421,8 @@ ClonedFunctionInfoMap.insert(std::make_pair(Clone, F)).first->second; ++NumCloned; - errs() << " CLONING FUNCTION: " << F->getNameStr() << " -> " - << Clone->getNameStr() << "\n"; + errs() << " CLONING FUNCTION: " << F->getName().str() << " -> " + << Clone->getName().str() << "\n"; if (F->isDeclaration()) { Clone->setLinkage(GlobalValue::ExternalLinkage); @@ -1441,7 +1441,7 @@ for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I, ++CI) { // Transfer the argument names over. - CI->setName(I->getNameStr()); + CI->setName(I->getName().str()); // If we are compressing this argument, set up RemappedArgs. if (CI->getType() != I->getType()) {
Index: lib/InsertPoolChecks/RegisterBounds.cpp =================================================================== --- lib/InsertPoolChecks/RegisterBounds.cpp (revision 146353) +++ lib/InsertPoolChecks/RegisterBounds.cpp (working copy) @@ -583,7 +583,7 @@ void RegisterVariables::RegisterVariableIntoPool(Value * PH, Value * val, Value * AllocSize, Instruction * InsertBefore) { if (!PH) { - llvm::errs() << "pool descriptor not present for " << val->getNameStr() + llvm::errs() << "pool descriptor not present for " << val->getName().str() << "\n"; return; } Index: lib/ConvertUnsafeAllocas/InitAllocas.cpp =================================================================== --- lib/ConvertUnsafeAllocas/InitAllocas.cpp (revision 146353) +++ lib/ConvertUnsafeAllocas/InitAllocas.cpp (working copy) @@ -146,7 +146,7 @@ Module * M = AI.getParent()->getParent()->getParent(); Function * Memset = cast<Function>(M->getFunction ("llvm.memset.p0i8.i32")); std::vector<Value *> args; - args.push_back (castTo (&AI, VoidPtrType, AI.getNameStr(), InsertPt)); + args.push_back (castTo (&AI, VoidPtrType, AI.getName().str(), InsertPt)); args.push_back (ConstantInt::get(Int8Type, 0)); args.push_back (ConstantInt::get(Int32Type,TD.getTypeAllocSize(AllocType))); args.push_back (ConstantInt::get(Int32Type, 0)); Index: lib/CStdLib/RegisterVarargCallSites.cpp =================================================================== --- lib/CStdLib/RegisterVarargCallSites.cpp (revision 146353) +++ lib/CStdLib/RegisterVarargCallSites.cpp (working copy) @@ -185,7 +185,7 @@ // The function has not been encountered yet. // Determine if calls to this function should be registered. else { - if (f->isVarArg() && !isExternalVarargFunction(f->getNameStr())) { + if (f->isVarArg() && !isExternalVarargFunction(f->getName().str())) { shouldRegister[f] = true; toRegister.push_back(CS); }
- [svadev] getNameStr() -> getName().str() for poolalloc and safecode, Randy MacLeod, 12/11/2011
- Re: [svadev] getNameStr() -> getName().str() for poolalloc and safecode, John Criswell, 12/12/2011
- Re: [svadev] getNameStr() -> getName().str() for poolalloc and safecode, Matthew Wala, 12/12/2011
- Re: [svadev] getNameStr() -> getName().str() for poolalloc and safecode, John Criswell, 12/12/2011
- Re: [svadev] getNameStr() -> getName().str() for poolalloc and safecode, Matthew Wala, 12/12/2011
- Re: [svadev] getNameStr() -> getName().str() for poolalloc and safecode, John Criswell, 12/12/2011
Archive powered by MHonArc 2.6.16.