summaryrefslogtreecommitdiffstats
path: root/llvm/examples/HowToUseJIT/HowToUseJIT.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-07 07:40:09 +0000
committerChris Lattner <sabre@nondot.org>2007-01-07 07:40:09 +0000
commitb800b3921c86cba2d870ffc8daffc30492255ef3 (patch)
tree38fd237d97621fda1de0aa5947f731e5a8be4938 /llvm/examples/HowToUseJIT/HowToUseJIT.cpp
parentf7eef61f208285067864d59e92f8cc48f1717112 (diff)
downloadbcm5719-llvm-b800b3921c86cba2d870ffc8daffc30492255ef3.tar.gz
bcm5719-llvm-b800b3921c86cba2d870ffc8daffc30492255ef3.zip
add some casts to support a change in the getOrInsertFunction interface
llvm-svn: 32984
Diffstat (limited to 'llvm/examples/HowToUseJIT/HowToUseJIT.cpp')
-rw-r--r--llvm/examples/HowToUseJIT/HowToUseJIT.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/examples/HowToUseJIT/HowToUseJIT.cpp b/llvm/examples/HowToUseJIT/HowToUseJIT.cpp
index 438ed0616cb..abcd117b51b 100644
--- a/llvm/examples/HowToUseJIT/HowToUseJIT.cpp
+++ b/llvm/examples/HowToUseJIT/HowToUseJIT.cpp
@@ -52,8 +52,9 @@ int main() {
// Create the add1 function entry and insert this entry into module M. The
// function will have a return type of "int" and take an argument of "int".
// The '0' terminates the list of argument types.
- Function *Add1F = M->getOrInsertFunction("add1", Type::Int32Ty, Type::Int32Ty,
- (Type *)0);
+ Function *Add1F =
+ cast<Function>(M->getOrInsertFunction("add1", Type::Int32Ty, Type::Int32Ty,
+ (Type *)0));
// Add a basic block to the function. As before, it automatically inserts
// because of the last argument.
@@ -78,7 +79,8 @@ int main() {
// Now we going to create function `foo', which returns an int and takes no
// arguments.
- Function *FooF = M->getOrInsertFunction("foo", Type::Int32Ty, (Type *)0);
+ Function *FooF =
+ cast<Function>(M->getOrInsertFunction("foo", Type::Int32Ty, (Type *)0));
// Add a basic block to the FooF function.
BB = new BasicBlock("EntryBlock", FooF);
OpenPOWER on IntegriCloud