Skip to content

Commit

Permalink
[examples] Fix llvm.memset prototype in BrainF example.
Browse files Browse the repository at this point in the history
Commit 1e68724 removed the alignment
argument from the memset intrinsic. Update the BrainF example to match.

Reviewed By: jyknight
Differential Revision: https://reviews.llvm.org/D79601
  • Loading branch information
rickyz authored and jyknight committed May 10, 2020
1 parent 856dda3 commit 6d23f29
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llvm/examples/BrainF/BrainF.cpp
Expand Up @@ -66,7 +66,7 @@ void BrainF::header(LLVMContext& C) {

//Function prototypes

//declare void @llvm.memset.p0i8.i32(i8 *, i8, i32, i32, i1)
//declare void @llvm.memset.p0i8.i32(i8 *, i8, i32, i1)
Type *Tys[] = { Type::getInt8PtrTy(C), Type::getInt32Ty(C) };
Function *memset_func = Intrinsic::getDeclaration(module, Intrinsic::memset,
Tys);
Expand Down Expand Up @@ -98,13 +98,12 @@ void BrainF::header(LLVMContext& C) {
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)
//call void @llvm.memset.p0i8.i32(i8 *%arr, i8 0, i32 %d, i1 0)
{
Value *memset_params[] = {
ptr_arr,
ConstantInt::get(C, APInt(8, 0)),
val_mem,
ConstantInt::get(C, APInt(32, 1)),
ConstantInt::get(C, APInt(1, 0))
};

Expand Down

0 comments on commit 6d23f29

Please sign in to comment.