add some casts to support a change in the getOrInsertFunction interface
[oota-llvm.git] / examples / Fibonacci / fibonacci.cpp
index 80b7f3222693f666621537f03212261552a7beba..53ec1b04d399e11ce71201fa459f8ba7b80a231c 100644 (file)
@@ -38,8 +38,9 @@ using namespace llvm;
 static Function *CreateFibFunction(Module *M) {
   // Create the fib function and insert it into module M.  This function is said
   // to return an int and take an int parameter.
-  Function *FibF = M->getOrInsertFunction("fib", Type::Int32Ty, Type::Int32Ty,
-                                          (Type *)0);
+  Function *FibF =
+    cast<Function>(M->getOrInsertFunction("fib", Type::Int32Ty, Type::Int32Ty,
+                                          (Type *)0));
 
   // Add a basic block to the function.
   BasicBlock *BB = new BasicBlock("EntryBlock", FibF);