diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-02-05 21:19:13 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-02-05 21:19:13 +0000 |
commit | 688b0490e22eb67623f5aaa24406209be74efcb2 (patch) | |
tree | 69eb17e5f7e3136a7b336ed6c5d0a2ed5692a44d /tools | |
parent | cdedc3b336ff7552e439723fdb96dda68b1dbbdb (diff) | |
download | external_llvm-688b0490e22eb67623f5aaa24406209be74efcb2.tar.gz external_llvm-688b0490e22eb67623f5aaa24406209be74efcb2.tar.bz2 external_llvm-688b0490e22eb67623f5aaa24406209be74efcb2.zip |
For PR411:
Adjust to changes in Module interface:
getMainFunction() -> getFunction("main")
getNamedFunction(X) -> getFunction(X)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33922 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bugpoint/CrashDebugger.cpp | 2 | ||||
-rw-r--r-- | tools/bugpoint/Miscompilation.cpp | 4 | ||||
-rw-r--r-- | tools/lli/lli.cpp | 2 | ||||
-rw-r--r-- | tools/llvm-upgrade/UpgradeParser.cpp.cvs | 12 | ||||
-rw-r--r-- | tools/llvm-upgrade/UpgradeParser.y | 12 | ||||
-rw-r--r-- | tools/llvm-upgrade/UpgradeParser.y.cvs | 12 | ||||
-rw-r--r-- | tools/llvm2cpp/CppWriter.cpp | 4 |
7 files changed, 24 insertions, 24 deletions
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index b597d8256d..5596839979 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -194,7 +194,7 @@ bool ReduceCrashingFunctions::TestFuncs(std::vector<Function*> &Funcs) { //if main isn't present, claim there is no problem if (KeepMain && find(Funcs.begin(), Funcs.end(), - BD.getProgram()->getMainFunction()) == Funcs.end()) + BD.getProgram()->getFunction("main")) == Funcs.end()) return false; // Clone the program to try hacking it apart... diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index 38ccf0bc56..aed90cb80b 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -639,7 +639,7 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test, // First, if the main function is in the Safe module, we must add a stub to // 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 (Function *oldMain = Safe->getFunction("main")) if (!oldMain->isDeclaration()) { // Rename it oldMain->setName("llvm_bugpoint_old_main"); @@ -685,7 +685,7 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test, for (Module::iterator F = Safe->begin(), E = Safe->end(); F != E; ++F) { if (F->isDeclaration() && !F->use_empty() && &*F != resolverFunc && F->getIntrinsicID() == 0 /* ignore intrinsics */) { - Function *TestFn = Test->getNamedFunction(F->getName()); + Function *TestFn = Test->getFunction(F->getName()); // Don't forward functions which are external in the test module too. if (TestFn && !TestFn->isDeclaration()) { diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index 9f1ecc2978..c7b0765d52 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -103,7 +103,7 @@ int main(int argc, char **argv, char * const *envp) { // using the contents of Args to determine argc & argv, and the contents of // EnvVars to determine envp. // - Function *Fn = MP->getModule()->getMainFunction(); + Function *Fn = MP->getModule()->getFunction("main"); if (!Fn) { std::cerr << "'main' function not found in module.\n"; return -1; diff --git a/tools/llvm-upgrade/UpgradeParser.cpp.cvs b/tools/llvm-upgrade/UpgradeParser.cpp.cvs index 70ff399bbe..cee36df230 100644 --- a/tools/llvm-upgrade/UpgradeParser.cpp.cvs +++ b/tools/llvm-upgrade/UpgradeParser.cpp.cvs @@ -929,7 +929,7 @@ ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers, if (const FunctionType *FTy = dyn_cast<FunctionType>(PTy->getElementType())) if (Function *OtherF = - CurModule.CurrentModule->getNamedFunction(DID.getName())) + CurModule.CurrentModule->getFunction(DID.getName())) if (FuncTysDifferOnlyBySRet(FTy,OtherF->getFunctionType())) { V->replaceAllUsesWith(ConstantExpr::getBitCast(OtherF, PTy)); fixed = true; @@ -1677,10 +1677,10 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, //Not all functions use vaarg, so make a second check for ObsoleteVarArgs { Function* F; - if ((F = Result->getNamedFunction("llvm.va_start")) + if ((F = Result->getFunction("llvm.va_start")) && F->getFunctionType()->getNumParams() == 0) ObsoleteVarArgs = true; - if((F = Result->getNamedFunction("llvm.va_copy")) + if((F = Result->getFunction("llvm.va_copy")) && F->getFunctionType()->getNumParams() == 1) ObsoleteVarArgs = true; } @@ -1691,7 +1691,7 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, } if(ObsoleteVarArgs) { - if(Function* F = Result->getNamedFunction("llvm.va_start")) { + if(Function* F = Result->getFunction("llvm.va_start")) { if (F->arg_size() != 0) { error("Obsolete va_start takes 0 argument"); return 0; @@ -1720,7 +1720,7 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, Result->getFunctionList().erase(F); } - if(Function* F = Result->getNamedFunction("llvm.va_end")) { + if(Function* F = Result->getFunction("llvm.va_end")) { if(F->arg_size() != 1) { error("Obsolete va_end takes 1 argument"); return 0; @@ -1746,7 +1746,7 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, Result->getFunctionList().erase(F); } - if(Function* F = Result->getNamedFunction("llvm.va_copy")) { + if(Function* F = Result->getFunction("llvm.va_copy")) { if(F->arg_size() != 1) { error("Obsolete va_copy takes 1 argument"); return 0; diff --git a/tools/llvm-upgrade/UpgradeParser.y b/tools/llvm-upgrade/UpgradeParser.y index 0f47b386ba..3091ea3ba2 100644 --- a/tools/llvm-upgrade/UpgradeParser.y +++ b/tools/llvm-upgrade/UpgradeParser.y @@ -569,7 +569,7 @@ ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers, if (const FunctionType *FTy = dyn_cast<FunctionType>(PTy->getElementType())) if (Function *OtherF = - CurModule.CurrentModule->getNamedFunction(DID.getName())) + CurModule.CurrentModule->getFunction(DID.getName())) if (FuncTysDifferOnlyBySRet(FTy,OtherF->getFunctionType())) { V->replaceAllUsesWith(ConstantExpr::getBitCast(OtherF, PTy)); fixed = true; @@ -1317,10 +1317,10 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, //Not all functions use vaarg, so make a second check for ObsoleteVarArgs { Function* F; - if ((F = Result->getNamedFunction("llvm.va_start")) + if ((F = Result->getFunction("llvm.va_start")) && F->getFunctionType()->getNumParams() == 0) ObsoleteVarArgs = true; - if((F = Result->getNamedFunction("llvm.va_copy")) + if((F = Result->getFunction("llvm.va_copy")) && F->getFunctionType()->getNumParams() == 1) ObsoleteVarArgs = true; } @@ -1331,7 +1331,7 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, } if(ObsoleteVarArgs) { - if(Function* F = Result->getNamedFunction("llvm.va_start")) { + if(Function* F = Result->getFunction("llvm.va_start")) { if (F->arg_size() != 0) { error("Obsolete va_start takes 0 argument"); return 0; @@ -1360,7 +1360,7 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, Result->getFunctionList().erase(F); } - if(Function* F = Result->getNamedFunction("llvm.va_end")) { + if(Function* F = Result->getFunction("llvm.va_end")) { if(F->arg_size() != 1) { error("Obsolete va_end takes 1 argument"); return 0; @@ -1386,7 +1386,7 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, Result->getFunctionList().erase(F); } - if(Function* F = Result->getNamedFunction("llvm.va_copy")) { + if(Function* F = Result->getFunction("llvm.va_copy")) { if(F->arg_size() != 1) { error("Obsolete va_copy takes 1 argument"); return 0; diff --git a/tools/llvm-upgrade/UpgradeParser.y.cvs b/tools/llvm-upgrade/UpgradeParser.y.cvs index 0f47b386ba..3091ea3ba2 100644 --- a/tools/llvm-upgrade/UpgradeParser.y.cvs +++ b/tools/llvm-upgrade/UpgradeParser.y.cvs @@ -569,7 +569,7 @@ ResolveDefinitions(std::map<const Type*,ValueList> &LateResolvers, if (const FunctionType *FTy = dyn_cast<FunctionType>(PTy->getElementType())) if (Function *OtherF = - CurModule.CurrentModule->getNamedFunction(DID.getName())) + CurModule.CurrentModule->getFunction(DID.getName())) if (FuncTysDifferOnlyBySRet(FTy,OtherF->getFunctionType())) { V->replaceAllUsesWith(ConstantExpr::getBitCast(OtherF, PTy)); fixed = true; @@ -1317,10 +1317,10 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, //Not all functions use vaarg, so make a second check for ObsoleteVarArgs { Function* F; - if ((F = Result->getNamedFunction("llvm.va_start")) + if ((F = Result->getFunction("llvm.va_start")) && F->getFunctionType()->getNumParams() == 0) ObsoleteVarArgs = true; - if((F = Result->getNamedFunction("llvm.va_copy")) + if((F = Result->getFunction("llvm.va_copy")) && F->getFunctionType()->getNumParams() == 1) ObsoleteVarArgs = true; } @@ -1331,7 +1331,7 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, } if(ObsoleteVarArgs) { - if(Function* F = Result->getNamedFunction("llvm.va_start")) { + if(Function* F = Result->getFunction("llvm.va_start")) { if (F->arg_size() != 0) { error("Obsolete va_start takes 0 argument"); return 0; @@ -1360,7 +1360,7 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, Result->getFunctionList().erase(F); } - if(Function* F = Result->getNamedFunction("llvm.va_end")) { + if(Function* F = Result->getFunction("llvm.va_end")) { if(F->arg_size() != 1) { error("Obsolete va_end takes 1 argument"); return 0; @@ -1386,7 +1386,7 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, Result->getFunctionList().erase(F); } - if(Function* F = Result->getNamedFunction("llvm.va_copy")) { + if(Function* F = Result->getFunction("llvm.va_copy")) { if(F->arg_size() != 1) { error("Obsolete va_copy takes 1 argument"); return 0; diff --git a/tools/llvm2cpp/CppWriter.cpp b/tools/llvm2cpp/CppWriter.cpp index e7d1185855..70f5626af0 100644 --- a/tools/llvm2cpp/CppWriter.cpp +++ b/tools/llvm2cpp/CppWriter.cpp @@ -1544,7 +1544,7 @@ void CppWriter::printFunctionBody(const Function *F) { } void CppWriter::printInline(const std::string& fname, const std::string& func) { - const Function* F = TheModule->getNamedFunction(func); + const Function* F = TheModule->getFunction(func); if (!F) { error(std::string("Function '") + func + "' not found in input module"); return; @@ -1719,7 +1719,7 @@ void CppWriter::printFunction( const std::string& fname, // Name of generated function const std::string& funcName // Name of function to generate ) { - const Function* F = TheModule->getNamedFunction(funcName); + const Function* F = TheModule->getFunction(funcName); if (!F) { error(std::string("Function '") + funcName + "' not found in input module"); return; |