summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-10 21:45:38 +0000
committerChris Lattner <sabre@nondot.org>2010-08-10 21:45:38 +0000
commit9908fec11e5bfd90768f344df69416a6b621aba4 (patch)
tree246c2b218a7db724675ea7366acf2b4d48aba858 /examples
parent95743d8748a85bbb03aff3b3baae728c138acbab (diff)
downloadllvm-9908fec11e5bfd90768f344df69416a6b621aba4.tar.gz
llvm-9908fec11e5bfd90768f344df69416a6b621aba4.tar.bz2
llvm-9908fec11e5bfd90768f344df69416a6b621aba4.tar.xz
upgrade to use new intrinsics, patch by Dan Hipschman!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r--examples/BrainF/BrainF.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/BrainF/BrainF.cpp b/examples/BrainF/BrainF.cpp
index a443ad420e..8536915993 100644
--- a/examples/BrainF/BrainF.cpp
+++ b/examples/BrainF/BrainF.cpp
@@ -54,10 +54,10 @@ void BrainF::header(LLVMContext& C) {
//Function prototypes
- //declare void @llvm.memset.i32(i8 *, i8, i32, i32)
- const Type *Tys[] = { Type::getInt32Ty(C) };
+ //declare void @llvm.memset.p0i8.i32(i8 *, i8, i32, i32, i1)
+ const Type *Tys[] = { Type::getInt8PtrTy(C), Type::getInt32Ty(C) };
Function *memset_func = Intrinsic::getDeclaration(module, Intrinsic::memset,
- Tys, 1);
+ Tys, 2);
//declare i32 @getchar()
getchar_func = cast<Function>(module->
@@ -88,13 +88,14 @@ void BrainF::header(LLVMContext& C) {
NULL, "arr");
BB->getInstList().push_back(cast<Instruction>(ptr_arr));
- //call void @llvm.memset.i32(i8 *%arr, i8 0, i32 %d, i32 1)
+ //call void @llvm.memset.p0i8.i32(i8 *%arr, i8 0, i32 %d, i32 1, 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(32, 1)),
+ ConstantInt::get(C, APInt(1, 0))
};
CallInst *memset_call = builder->