mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-25 19:29:53 +00:00
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
This commit is contained in:
parent
95743d8748
commit
9908fec11e
@ -54,10 +54,10 @@ void BrainF::header(LLVMContext& C) {
|
|||||||
|
|
||||||
//Function prototypes
|
//Function prototypes
|
||||||
|
|
||||||
//declare void @llvm.memset.i32(i8 *, i8, i32, i32)
|
//declare void @llvm.memset.p0i8.i32(i8 *, i8, i32, i32, i1)
|
||||||
const Type *Tys[] = { Type::getInt32Ty(C) };
|
const Type *Tys[] = { Type::getInt8PtrTy(C), Type::getInt32Ty(C) };
|
||||||
Function *memset_func = Intrinsic::getDeclaration(module, Intrinsic::memset,
|
Function *memset_func = Intrinsic::getDeclaration(module, Intrinsic::memset,
|
||||||
Tys, 1);
|
Tys, 2);
|
||||||
|
|
||||||
//declare i32 @getchar()
|
//declare i32 @getchar()
|
||||||
getchar_func = cast<Function>(module->
|
getchar_func = cast<Function>(module->
|
||||||
@ -88,13 +88,14 @@ void BrainF::header(LLVMContext& C) {
|
|||||||
NULL, "arr");
|
NULL, "arr");
|
||||||
BB->getInstList().push_back(cast<Instruction>(ptr_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[] = {
|
Value *memset_params[] = {
|
||||||
ptr_arr,
|
ptr_arr,
|
||||||
ConstantInt::get(C, APInt(8, 0)),
|
ConstantInt::get(C, APInt(8, 0)),
|
||||||
val_mem,
|
val_mem,
|
||||||
ConstantInt::get(C, APInt(32, 1))
|
ConstantInt::get(C, APInt(32, 1)),
|
||||||
|
ConstantInt::get(C, APInt(1, 0))
|
||||||
};
|
};
|
||||||
|
|
||||||
CallInst *memset_call = builder->
|
CallInst *memset_call = builder->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user