Tabs -> Spaces
[oota-llvm.git] / lib / VMCore / Module.cpp
index 163d8d2ac173797909502b7616020a9b8efd39db..016ab16ff5211c295d505ae9e11a6628eb391c21 100644 (file)
@@ -32,8 +32,7 @@ using namespace llvm;
 
 Function *ilist_traits<Function>::createSentinel() {
   FunctionType *FTy =
-    FunctionType::get(Type::VoidTy, std::vector<const Type*>(), false, 
-                      std::vector<FunctionType::ParameterAttributes>() );
+    FunctionType::get(Type::VoidTy, std::vector<const Type*>(), false);
   Function *Ret = new Function(FTy, GlobalValue::ExternalLinkage);
   // This should not be garbage monitored.
   LeakDetector::removeGarbageObject(Ret);
@@ -142,7 +141,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<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 +159,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.