Added codegen for column drawers

This commit is contained in:
Magnus Norddahl 2016-10-07 03:38:43 +02:00
commit c1e859dbca
10 changed files with 444 additions and 645 deletions

View file

@ -1,6 +1,7 @@
#include "r_compiler/llvm_include.h"
#include "ssa_ubyte.h"
#include "ssa_int.h"
#include "ssa_scope.h"
SSAUByte::SSAUByte()
@ -24,6 +25,11 @@ llvm::Type *SSAUByte::llvm_type()
return llvm::Type::getInt8Ty(SSAScope::context());
}
SSAInt SSAUByte::zext_int()
{
return SSAInt::from_llvm(SSAScope::builder().CreateZExt(v, SSAInt::llvm_type(), SSAScope::hint()));
}
SSAUByte operator+(const SSAUByte &a, const SSAUByte &b)
{
return SSAUByte::from_llvm(SSAScope::builder().CreateAdd(a.v, b.v, SSAScope::hint()));