aboutsummaryrefslogtreecommitdiffstats
path: root/llvm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm.cpp')
-rw-r--r--llvm.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm.cpp b/llvm.cpp
index 51d4706..c15d35d 100644
--- a/llvm.cpp
+++ b/llvm.cpp
@@ -21,7 +21,7 @@ LLVMState::LLVMState():
ctx(),
modul("forsp", ctx),
builder(ctx),
- inttype(llvm::Type::getInt32Ty(ctx)),
+ inttype(llvm::Type::getInt64Ty(ctx)),
stacktype(llvm::VectorType::get(inttype, 16, false)),
ftype(llvm::FunctionType::get(llvm::Type::getVoidTy(ctx), llvm::ArrayRef<llvm::Type *> {inttype->getPointerTo()}, false)),
one(llvm::ConstantInt::get(inttype, 1)),
@@ -38,7 +38,7 @@ llvm::Value *LLVMState::createPush(llvm::Value *var)
{
auto dspval = builder.CreateLoad(inttype, llvmSp);
auto inc = builder.CreateAdd(dspval, one);
- builder.CreateStore(inc, llvmSp, false);
+ builder.CreateStore(inc, llvmSp);
auto gep = builder.CreateGEP(stacktype, llvmStack, {zero, dspval});
return builder.CreateStore(var, gep);
@@ -48,7 +48,7 @@ llvm::Value *LLVMState::createPop()
{
auto dspval = builder.CreateLoad(inttype, llvmSp);
auto dec = builder.CreateSub(dspval, one);
- builder.CreateStore(dec, llvmSp, false);
+ builder.CreateStore(dec, llvmSp);
auto gep = builder.CreateGEP(stacktype, llvmStack, {zero, dec});
return builder.CreateLoad(inttype, gep);
@@ -75,7 +75,7 @@ llvm::Value *LLVMState::createVariable(const std::string& name)
llvm::Constant *LLVMState::createInt(int n)
{
- return llvm::ConstantInt::get(ctx, llvm::APInt(32, n, true));
+ return llvm::ConstantInt::get(ctx, llvm::APInt(64, n, true));
}
void LLVMState::output()