[llvm-commits] CVS: llvm/lib/VMCore/Module.cpp
Reid Spencer
reid at x10sys.com
Mon Feb 5 13:19:51 PST 2007
Changes in directory llvm/lib/VMCore:
Module.cpp updated: 1.76 -> 1.77
---
Log message:
For PR411: http://llvm.org/PR411 :
Adjust to changes in Module interface:
getMainFunction() -> getFunction("main")
getNamedFunction(X) -> getFunction(X)
---
Diffs of the changes: (+2 -2)
Module.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/lib/VMCore/Module.cpp
diff -u llvm/lib/VMCore/Module.cpp:1.76 llvm/lib/VMCore/Module.cpp:1.77
--- llvm/lib/VMCore/Module.cpp:1.76 Mon Feb 5 14:47:20 2007
+++ llvm/lib/VMCore/Module.cpp Mon Feb 5 15:19:13 2007
@@ -142,7 +142,7 @@
ValueSymbolTable &SymTab = getValueSymbolTable();
// See if we have a definition for the specified function already.
- Function *F = dyn_cast_or_null<Function>(SymTab.lookup(Name));
+ GlobalValue *F = dyn_cast_or_null<GlobalValue>(SymTab.lookup(Name));
if (F == 0) {
// Nope, add it
Function *New = new Function(Ty, GlobalVariable::ExternalLinkage, Name);
@@ -160,7 +160,7 @@
// 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.
More information about the llvm-commits
mailing list