diff options
author | Hans Wennborg <hans@hanshq.net> | 2015-09-29 18:02:48 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2015-09-29 18:02:48 +0000 |
commit | cc9deb48019f7e5faf401070aa417b0ead871fd6 (patch) | |
tree | 06e64c09dde0052a10e50542c3840643e723a913 /llvm/examples/BrainF/BrainF.cpp | |
parent | 410a25aa7a093ee9f6de4d12e1f8aaa1cf9c0e81 (diff) | |
download | llvm-cc9deb48019f7e5faf401070aa417b0ead871fd6.zip llvm-cc9deb48019f7e5faf401070aa417b0ead871fd6.tar.gz llvm-cc9deb48019f7e5faf401070aa417b0ead871fd6.tar.bz2 |
Fix Clang-tidy modernize-use-nullptr warnings in examples and include directories; other minor cleanups.
Patch by Eugene Zelenko!
Differential Revision: http://reviews.llvm.org/D13172
llvm-svn: 248811
Diffstat (limited to 'llvm/examples/BrainF/BrainF.cpp')
-rw-r--r-- | llvm/examples/BrainF/BrainF.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/examples/BrainF/BrainF.cpp b/llvm/examples/BrainF/BrainF.cpp index 8026adc..d8c54b5 100644 --- a/llvm/examples/BrainF/BrainF.cpp +++ b/llvm/examples/BrainF/BrainF.cpp @@ -29,6 +29,7 @@ #include "llvm/IR/Instructions.h" #include "llvm/IR/Intrinsics.h" #include <iostream> + using namespace llvm; //Set the constants for naming @@ -44,7 +45,7 @@ Module *BrainF::parse(std::istream *in1, int mem, CompileFlags cf, comflag = cf; header(Context); - readloop(0, 0, 0, Context); + readloop(nullptr, nullptr, nullptr, Context); delete builder; return module; } @@ -68,7 +69,6 @@ void BrainF::header(LLVMContext& C) { getOrInsertFunction("putchar", IntegerType::getInt32Ty(C), IntegerType::getInt32Ty(C), NULL)); - //Function header //define void @brainf() @@ -85,7 +85,7 @@ void BrainF::header(LLVMContext& C) { Constant* allocsize = ConstantExpr::getSizeOf(Int8Ty); allocsize = ConstantExpr::getTruncOrBitCast(allocsize, IntPtrTy); ptr_arr = CallInst::CreateMalloc(BB, IntPtrTy, Int8Ty, allocsize, val_mem, - NULL, "arr"); + nullptr, "arr"); BB->getInstList().push_back(cast<Instruction>(ptr_arr)); //call void @llvm.memset.p0i8.i32(i8 *%arr, i8 0, i32 %d, i32 1, i1 0) @@ -114,8 +114,6 @@ void BrainF::header(LLVMContext& C) { ConstantInt::get(C, APInt(32, memtotal/2)), headreg); - - //Function footer //brainf.end: @@ -127,8 +125,6 @@ void BrainF::header(LLVMContext& C) { //ret void ReturnInst::Create(C, endbb); - - //Error block for array out of bounds if (comflag & flag_arraybounds) { |