From 688b0490e22eb67623f5aaa24406209be74efcb2 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Mon, 5 Feb 2007 21:19:13 +0000 Subject: 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 --- lib/VMCore/Module.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/VMCore/Module.cpp') diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index 163d8d2ac1..8aab595bd2 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -142,7 +142,7 @@ Constant *Module::getOrInsertFunction(const std::string &Name, ValueSymbolTable &SymTab = getValueSymbolTable(); // See if we have a definition for the specified function already. - Function *F = dyn_cast_or_null(SymTab.lookup(Name)); + GlobalValue *F = dyn_cast_or_null(SymTab.lookup(Name)); if (F == 0) { // Nope, add it Function *New = new Function(Ty, GlobalVariable::ExternalLinkage, Name); @@ -160,7 +160,7 @@ Constant *Module::getOrInsertFunction(const std::string &Name, // If the function exists but has the wrong type, return a bitcast to the // right type. - if (F->getFunctionType() != Ty) + if (F->getType() != PointerType::get(Ty)) return ConstantExpr::getBitCast(F, PointerType::get(Ty)); // Otherwise, we just found the existing function or a prototype. -- cgit v1.2.3-18-g5258