Make ret part of the instruction block instead of implicitely

closing at the end of parsing.
This commit is contained in:
Zack Rusin 2007-10-25 12:14:07 -04:00
parent e4f6f0ec02
commit 61d998c966
3 changed files with 7 additions and 2 deletions

View file

@ -1080,3 +1080,8 @@ llvm::Value * Instructions::trunc(llvm::Value *in)
return vectorFromVals(fx, fy, fz, fw);
}
void Instructions::end()
{
new ReturnInst(m_block);
}

View file

@ -64,6 +64,7 @@ public:
void elseop();
void endif();
void endLoop();
void end();
llvm::Value *ex2(llvm::Value *in);
llvm::Value *floor(llvm::Value *in);
llvm::Value *frc(llvm::Value *in);

View file

@ -595,6 +595,7 @@ translate_instruction(llvm::Module *module,
case TGSI_OPCODE_KIL:
break;
case TGSI_OPCODE_END:
instr->end();
return;
break;
default:
@ -696,8 +697,6 @@ tgsi_to_llvm(struct gallivm_prog *prog, const struct tgsi_token *tokens)
}
}
new ReturnInst(instr.currentBlock());
tgsi_parse_free(&parse);
prog->num_consts = storage.numConsts();