Removing BranchIf.

This commit is contained in:
Ben Vanik
2013-12-15 14:34:41 -08:00
parent 417a970aab
commit 84651623a5
5 changed files with 0 additions and 83 deletions

View File

@@ -472,24 +472,6 @@ void FunctionBuilder::Branch(Label* label, uint32_t branch_flags) {
EndBlock();
}
void FunctionBuilder::BranchIf(
Value* cond, Label* true_label, Label* false_label,
uint32_t branch_flags) {
if (cond->IsConstantTrue()) {
Branch(true_label, branch_flags);
return;
} else if (cond->IsConstantFalse()) {
Branch(false_label, branch_flags);
return;
}
Instr* i = AppendInstr(OPCODE_BRANCH_IF_info, branch_flags);
i->set_src1(cond);
i->src2.label = true_label;
i->src3.label = false_label;
EndBlock();
}
void FunctionBuilder::BranchTrue(
Value* cond, Label* label, uint32_t branch_flags) {
if (cond->IsConstantTrue()) {

View File

@@ -73,8 +73,6 @@ public:
void SetReturnAddress(Value* value);
void Branch(Label* label, uint32_t branch_flags = 0);
void BranchIf(Value* cond, Label* true_label, Label* false_label,
uint32_t branch_flags = 0);
void BranchTrue(Value* cond, Label* label,
uint32_t branch_flags = 0);
void BranchFalse(Value* cond, Label* label,

View File

@@ -83,7 +83,6 @@ enum Opcode {
OPCODE_SET_RETURN_ADDRESS,
OPCODE_BRANCH,
OPCODE_BRANCH_IF,
OPCODE_BRANCH_TRUE,
OPCODE_BRANCH_FALSE,

View File

@@ -86,12 +86,6 @@ DEFINE_OPCODE(
OPCODE_SIG_X_L,
OPCODE_FLAG_BRANCH);
DEFINE_OPCODE(
OPCODE_BRANCH_IF,
"branch_if",
OPCODE_SIG_X_V_L_L,
OPCODE_FLAG_BRANCH);
DEFINE_OPCODE(
OPCODE_BRANCH_TRUE,
"branch_true",