Changes in directory llvm/tools/bugpoint:
CrashDebugger.cpp updated: 1.54 -> 1.55 ExtractFunction.cpp updated: 1.56 -> 1.57 Miscompilation.cpp updated: 1.84 -> 1.85 --- Log message: For PR1136: http://llvm.org/PR1136 : Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. --- Diffs of the changes: (+12 -12) CrashDebugger.cpp | 6 +++--- ExtractFunction.cpp | 6 +++--- Miscompilation.cpp | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) Index: llvm/tools/bugpoint/CrashDebugger.cpp diff -u llvm/tools/bugpoint/CrashDebugger.cpp:1.54 llvm/tools/bugpoint/CrashDebugger.cpp:1.55 --- llvm/tools/bugpoint/CrashDebugger.cpp:1.54 Sat Jan 6 01:24:44 2007 +++ llvm/tools/bugpoint/CrashDebugger.cpp Tue Jan 30 14:08:38 2007 @@ -219,7 +219,7 @@ // Loop over and delete any functions which we aren't supposed to be playing // with... for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) - if (!I->isExternal() && !Functions.count(I)) + if (!I->isDeclaration() && !Functions.count(I)) DeleteFunctionBody(I); // Try running the hacked up program... @@ -406,7 +406,7 @@ std::vector<Function*> Functions; for (Module::iterator I = BD.getProgram()->begin(), E = BD.getProgram()->end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) Functions.push_back(I); if (Functions.size() > 1 && !BugpointIsInterrupted) { @@ -459,7 +459,7 @@ unsigned CurInstructionNum = 0; for (Module::const_iterator FI = BD.getProgram()->begin(), E = BD.getProgram()->end(); FI != E; ++FI) - if (!FI->isExternal()) + if (!FI->isDeclaration()) for (Function::const_iterator BI = FI->begin(), E = FI->end(); BI != E; ++BI) for (BasicBlock::const_iterator I = BI->begin(), E = --BI->end(); Index: llvm/tools/bugpoint/ExtractFunction.cpp diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.56 llvm/tools/bugpoint/ExtractFunction.cpp:1.57 --- llvm/tools/bugpoint/ExtractFunction.cpp:1.56 Sun Dec 31 00:02:26 2006 +++ llvm/tools/bugpoint/ExtractFunction.cpp Tue Jan 30 14:08:38 2007 @@ -170,7 +170,7 @@ void llvm::DeleteFunctionBody(Function *F) { // delete the body of the function... F->deleteBody(); - assert(F->isExternal() && "This didn't make the function external!"); + assert(F->isDeclaration() && "This didn't make the function external!"); } /// GetTorInit - Given a list of entries for static ctors/dtors, return them @@ -195,7 +195,7 @@ /// prune appropriate entries out of M1s list. static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2){ GlobalVariable *GV = M1->getNamedGlobal(GlobalName); - if (!GV || GV->isExternal() || GV->hasInternalLinkage() || + if (!GV || GV->isDeclaration() || GV->hasInternalLinkage() || !GV->use_empty()) return; std::vector<std::pair<Function*, int> > M1Tors, M2Tors; @@ -217,7 +217,7 @@ if (CE->isCast()) FP = CE->getOperand(0); if (Function *F = dyn_cast<Function>(FP)) { - if (!F->isExternal()) + if (!F->isDeclaration()) M1Tors.push_back(std::make_pair(F, Priority)); else { // Map to M2's version of the function. Index: llvm/tools/bugpoint/Miscompilation.cpp diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.84 llvm/tools/bugpoint/Miscompilation.cpp:1.85 --- llvm/tools/bugpoint/Miscompilation.cpp:1.84 Sun Jan 7 02:13:39 2007 +++ llvm/tools/bugpoint/Miscompilation.cpp Tue Jan 30 14:08:38 2007 @@ -320,7 +320,7 @@ std::vector<std::pair<std::string, const FunctionType*> > MisCompFunctions; for (Module::iterator I = ToOptimizeLoopExtracted->begin(), E = ToOptimizeLoopExtracted->end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) MisCompFunctions.push_back(std::make_pair(I->getName(), I->getFunctionType())); @@ -460,7 +460,7 @@ std::vector<std::pair<std::string, const FunctionType*> > MisCompFunctions; for (Module::iterator I = Extracted->begin(), E = Extracted->end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) MisCompFunctions.push_back(std::make_pair(I->getName(), I->getFunctionType())); @@ -502,7 +502,7 @@ std::vector<Function*> MiscompiledFunctions; Module *Prog = BD.getProgram(); for (Module::iterator I = Prog->begin(), E = Prog->end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) MiscompiledFunctions.push_back(I); // Do the reduction... @@ -637,7 +637,7 @@ // the Test module to call into it. Thus, we create a new function `main' // which just calls the old one. if (Function *oldMain = Safe->getNamedFunction("main")) - if (!oldMain->isExternal()) { + if (!oldMain->isDeclaration()) { // Rename it oldMain->setName("llvm_bugpoint_old_main"); // Create a NEW `main' function with same type in the test module. @@ -680,12 +680,12 @@ // Use the function we just added to get addresses of functions we need. for (Module::iterator F = Safe->begin(), E = Safe->end(); F != E; ++F) { - if (F->isExternal() && !F->use_empty() && &*F != resolverFunc && + if (F->isDeclaration() && !F->use_empty() && &*F != resolverFunc && F->getIntrinsicID() == 0 /* ignore intrinsics */) { Function *TestFn = Test->getNamedFunction(F->getName()); // Don't forward functions which are external in the test module too. - if (TestFn && !TestFn->isExternal()) { + if (TestFn && !TestFn->isDeclaration()) { // 1. Add a string constant with its name to the global file Constant *InitArray = ConstantArray::get(F->getName()); GlobalVariable *funcName = _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits