Removing BranchIf.
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -83,7 +83,6 @@ enum Opcode {
|
||||
OPCODE_SET_RETURN_ADDRESS,
|
||||
|
||||
OPCODE_BRANCH,
|
||||
OPCODE_BRANCH_IF,
|
||||
OPCODE_BRANCH_TRUE,
|
||||
OPCODE_BRANCH_FALSE,
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user