aboutsummaryrefslogtreecommitdiffstats
path: root/examples/Fibonacci
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-14 23:09:55 +0000
committerOwen Anderson <resistor@mac.com>2009-07-14 23:09:55 +0000
commit9adc0abad3c3ed40a268ccbcee0c74cb9e1359fe (patch)
treef15d2aa3fea09947494a5d0bb36583dbe3be000a /examples/Fibonacci
parenta89b7ea9d6819606eea3ba945913127a212b836f (diff)
downloadexternal_llvm-9adc0abad3c3ed40a268ccbcee0c74cb9e1359fe.zip
external_llvm-9adc0abad3c3ed40a268ccbcee0c74cb9e1359fe.tar.gz
external_llvm-9adc0abad3c3ed40a268ccbcee0c74cb9e1359fe.tar.bz2
Move EVER MORE stuff over to LLVMContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75703 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples/Fibonacci')
-rw-r--r--examples/Fibonacci/fibonacci.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/Fibonacci/fibonacci.cpp b/examples/Fibonacci/fibonacci.cpp
index 89f3ef2..d637d4d 100644
--- a/examples/Fibonacci/fibonacci.cpp
+++ b/examples/Fibonacci/fibonacci.cpp
@@ -36,7 +36,7 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
-static Function *CreateFibFunction(Module *M) {
+static Function *CreateFibFunction(Module *M, LLVMContext &Context) {
// 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 =
@@ -47,8 +47,8 @@ static Function *CreateFibFunction(Module *M) {
BasicBlock *BB = BasicBlock::Create("EntryBlock", FibF);
// Get pointers to the constants.
- Value *One = ConstantInt::get(Type::Int32Ty, 1);
- Value *Two = ConstantInt::get(Type::Int32Ty, 2);
+ Value *One = Context.getConstantInt(Type::Int32Ty, 1);
+ Value *Two = Context.getConstantInt(Type::Int32Ty, 2);
// Get pointer to the integer argument of the add1 function...
Argument *ArgX = FibF->arg_begin(); // Get the arg.
@@ -97,7 +97,7 @@ int main(int argc, char **argv) {
Module *M = new Module("test", Context);
// We are about to create the "fib" function:
- Function *FibF = CreateFibFunction(M);
+ Function *FibF = CreateFibFunction(M, Context);
// Now we going to create JIT
ExistingModuleProvider *MP = new ExistingModuleProvider(M);