summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/BrainF/BrainF.cpp8
-rw-r--r--examples/BrainF/BrainFDriver.cpp2
-rw-r--r--examples/Fibonacci/fibonacci.cpp3
-rw-r--r--examples/HowToUseJIT/HowToUseJIT.cpp7
-rw-r--r--examples/ParallelJIT/ParallelJIT.cpp6
5 files changed, 10 insertions, 16 deletions
diff --git a/examples/BrainF/BrainF.cpp b/examples/BrainF/BrainF.cpp
index 91d813a6c3b..8af34d04701 100644
--- a/examples/BrainF/BrainF.cpp
+++ b/examples/BrainF/BrainF.cpp
@@ -74,18 +74,18 @@ void BrainF::header(LLVMContext& C) {
//declare i32 @getchar()
getchar_func = cast<Function>(module->
- getOrInsertFunction("getchar", IntegerType::getInt32Ty(C), NULL));
+ getOrInsertFunction("getchar", IntegerType::getInt32Ty(C)));
//declare i32 @putchar(i32)
putchar_func = cast<Function>(module->
getOrInsertFunction("putchar", IntegerType::getInt32Ty(C),
- IntegerType::getInt32Ty(C), NULL));
+ IntegerType::getInt32Ty(C)));
//Function header
//define void @brainf()
brainf_func = cast<Function>(module->
- getOrInsertFunction("brainf", Type::getVoidTy(C), NULL));
+ getOrInsertFunction("brainf", Type::getVoidTy(C)));
builder = new IRBuilder<>(BasicBlock::Create(C, label, brainf_func));
@@ -156,7 +156,7 @@ void BrainF::header(LLVMContext& C) {
//declare i32 @puts(i8 *)
Function *puts_func = cast<Function>(module->
getOrInsertFunction("puts", IntegerType::getInt32Ty(C),
- PointerType::getUnqual(IntegerType::getInt8Ty(C)), NULL));
+ PointerType::getUnqual(IntegerType::getInt8Ty(C))));
//brainf.aberror:
aberrorbb = BasicBlock::Create(C, label, brainf_func);
diff --git a/examples/BrainF/BrainFDriver.cpp b/examples/BrainF/BrainFDriver.cpp
index d704506d244..65f8033a7e2 100644
--- a/examples/BrainF/BrainFDriver.cpp
+++ b/examples/BrainF/BrainFDriver.cpp
@@ -77,7 +77,7 @@ void addMainFunction(Module *mod) {
getOrInsertFunction("main", IntegerType::getInt32Ty(mod->getContext()),
IntegerType::getInt32Ty(mod->getContext()),
PointerType::getUnqual(PointerType::getUnqual(
- IntegerType::getInt8Ty(mod->getContext()))), NULL));
+ IntegerType::getInt8Ty(mod->getContext())))));
{
Function::arg_iterator args = main_func->arg_begin();
Value *arg_0 = &*args++;
diff --git a/examples/Fibonacci/fibonacci.cpp b/examples/Fibonacci/fibonacci.cpp
index 16e52bf0409..662cb01dd37 100644
--- a/examples/Fibonacci/fibonacci.cpp
+++ b/examples/Fibonacci/fibonacci.cpp
@@ -54,8 +54,7 @@ static Function *CreateFibFunction(Module *M, LLVMContext &Context) {
// to return an int and take an int parameter.
Function *FibF =
cast<Function>(M->getOrInsertFunction("fib", Type::getInt32Ty(Context),
- Type::getInt32Ty(Context),
- nullptr));
+ Type::getInt32Ty(Context)));
// Add a basic block to the function.
BasicBlock *BB = BasicBlock::Create(Context, "EntryBlock", FibF);
diff --git a/examples/HowToUseJIT/HowToUseJIT.cpp b/examples/HowToUseJIT/HowToUseJIT.cpp
index 0050d27b45d..f141fa5a7f5 100644
--- a/examples/HowToUseJIT/HowToUseJIT.cpp
+++ b/examples/HowToUseJIT/HowToUseJIT.cpp
@@ -69,11 +69,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 =
cast<Function>(M->getOrInsertFunction("add1", Type::getInt32Ty(Context),
- Type::getInt32Ty(Context),
- nullptr));
+ Type::getInt32Ty(Context)));
// Add a basic block to the function. As before, it automatically inserts
// because of the last argument.
@@ -102,8 +100,7 @@ int main() {
// Now we're going to create function `foo', which returns an int and takes no
// arguments.
Function *FooF =
- cast<Function>(M->getOrInsertFunction("foo", Type::getInt32Ty(Context),
- nullptr));
+ cast<Function>(M->getOrInsertFunction("foo", Type::getInt32Ty(Context)));
// Add a basic block to the FooF function.
BB = BasicBlock::Create(Context, "EntryBlock", FooF);
diff --git a/examples/ParallelJIT/ParallelJIT.cpp b/examples/ParallelJIT/ParallelJIT.cpp
index 6fb8bd61982..f1932d2471c 100644
--- a/examples/ParallelJIT/ParallelJIT.cpp
+++ b/examples/ParallelJIT/ParallelJIT.cpp
@@ -54,8 +54,7 @@ static Function* createAdd1(Module *M) {
Function *Add1F =
cast<Function>(M->getOrInsertFunction("add1",
Type::getInt32Ty(M->getContext()),
- Type::getInt32Ty(M->getContext()),
- nullptr));
+ Type::getInt32Ty(M->getContext())));
// Add a basic block to the function. As before, it automatically inserts
// because of the last argument.
@@ -85,8 +84,7 @@ static Function *CreateFibFunction(Module *M) {
Function *FibF =
cast<Function>(M->getOrInsertFunction("fib",
Type::getInt32Ty(M->getContext()),
- Type::getInt32Ty(M->getContext()),
- nullptr));
+ Type::getInt32Ty(M->getContext())));
// Add a basic block to the function.
BasicBlock *BB = BasicBlock::Create(M->getContext(), "EntryBlock", FibF);