aboutsummaryrefslogtreecommitdiff
path: root/llvm/examples/Fibonacci/fibonacci.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-31 05:50:28 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-31 05:50:28 +0000
commitbc013ba3675dd5df1ec2f5ea49416aa027ba40c8 (patch)
tree146980a6db0b31befab2a600412cf252118b2ef0 /llvm/examples/Fibonacci/fibonacci.cpp
parentc635f47d9a02dc7da288864169804d3ff9481e8b (diff)
downloadllvm-bc013ba3675dd5df1ec2f5ea49416aa027ba40c8.zip
llvm-bc013ba3675dd5df1ec2f5ea49416aa027ba40c8.tar.gz
llvm-bc013ba3675dd5df1ec2f5ea49416aa027ba40c8.tar.bz2
For PR950:
Convert signed integer types to signless. llvm-svn: 32786
Diffstat (limited to 'llvm/examples/Fibonacci/fibonacci.cpp')
-rw-r--r--llvm/examples/Fibonacci/fibonacci.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/examples/Fibonacci/fibonacci.cpp b/llvm/examples/Fibonacci/fibonacci.cpp
index 96aeb63..80b7f32 100644
--- a/llvm/examples/Fibonacci/fibonacci.cpp
+++ b/llvm/examples/Fibonacci/fibonacci.cpp
@@ -38,15 +38,15 @@ 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::IntTy, Type::IntTy,
+ Function *FibF = M->getOrInsertFunction("fib", Type::Int32Ty, Type::Int32Ty,
(Type *)0);
// Add a basic block to the function.
BasicBlock *BB = new BasicBlock("EntryBlock", FibF);
// Get pointers to the constants.
- Value *One = ConstantInt::get(Type::IntTy, 1);
- Value *Two = ConstantInt::get(Type::IntTy, 2);
+ Value *One = ConstantInt::get(Type::Int32Ty, 1);
+ Value *Two = ConstantInt::get(Type::Int32Ty, 2);
// Get pointer to the integer argument of the add1 function...
Argument *ArgX = FibF->arg_begin(); // Get the arg.
@@ -111,10 +111,10 @@ int main(int argc, char **argv) {
// Call the Fibonacci function with argument n:
std::vector<GenericValue> Args(1);
- Args[0].IntVal = n;
+ Args[0].Int32Val = n;
GenericValue GV = EE->runFunction(FibF, Args);
// import result of execution
- std::cout << "Result: " << GV.IntVal << "\n";
+ std::cout << "Result: " << GV.Int32Val << "\n";
return 0;
}