[GB.JIT]
* BUG: Maybe fix reading global boolean variables. git-svn-id: svn://localhost/gambas/trunk@4862 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
001a5947bd
commit
bded0d999a
1 changed files with 6 additions and 2 deletions
|
@ -1327,7 +1327,9 @@ llvm::Value* PushLastExpression::codegen_get_value(){
|
||||||
|
|
||||||
static llvm::Value* read_variable(TYPE type, char* addr){
|
static llvm::Value* read_variable(TYPE type, char* addr){
|
||||||
llvm::Value* ret;
|
llvm::Value* ret;
|
||||||
if (type < T_STRING || type == T_POINTER)
|
if (type == T_BOOLEAN)
|
||||||
|
ret = builder->CreateTrunc(read_global(addr, llvmType(getInt8Ty)), llvmType(getInt1Ty));
|
||||||
|
else if (type < T_STRING || type == T_POINTER)
|
||||||
ret = read_global(addr, TYPE_llvm(type));
|
ret = read_global(addr, TYPE_llvm(type));
|
||||||
else if (type == T_STRING){
|
else if (type == T_STRING){
|
||||||
llvm::Value* ad = read_global(addr);
|
llvm::Value* ad = read_global(addr);
|
||||||
|
@ -1394,7 +1396,9 @@ llvm::Value* ReadVariableExpression::codegen_get_value(){
|
||||||
//FIXME this is almost same as array_read, only difference is in variant
|
//FIXME this is almost same as array_read, only difference is in variant
|
||||||
static llvm::Value* read_variable(TYPE type, llvm::Value* addr){
|
static llvm::Value* read_variable(TYPE type, llvm::Value* addr){
|
||||||
llvm::Value* ret;
|
llvm::Value* ret;
|
||||||
if (type < T_STRING || type == T_POINTER)
|
if (type == T_BOOLEAN)
|
||||||
|
ret = builder->CreateTrunc(builder->CreateLoad(builder->CreateBitCast(addr, llvmType(getInt8PtrTy))), llvmType(getInt1Ty));
|
||||||
|
else if (type < T_STRING || type == T_POINTER)
|
||||||
ret = builder->CreateLoad(builder->CreateBitCast(addr, pointer_t(TYPE_llvm(type))));
|
ret = builder->CreateLoad(builder->CreateBitCast(addr, pointer_t(TYPE_llvm(type))));
|
||||||
else if (type == T_STRING){
|
else if (type == T_STRING){
|
||||||
llvm::Value* ad = builder->CreateLoad(builder->CreateBitCast(addr, charPP));
|
llvm::Value* ad = builder->CreateLoad(builder->CreateBitCast(addr, charPP));
|
||||||
|
|
Loading…
Reference in a new issue