Use an instruction instead of a special-case boolean instruction.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <type_traits>
|
||||
#include "binop.hpp"
|
||||
#include "error.hpp"
|
||||
#include "instruction.hpp"
|
||||
#include "type.hpp"
|
||||
#include "type_env.hpp"
|
||||
#include "env.hpp"
|
||||
@@ -308,9 +309,13 @@ struct case_strategy_bool {
|
||||
return;
|
||||
}
|
||||
|
||||
into.push_back(instruction_ptr(new instruction_if(
|
||||
std::move(ms.get_case_for(true)),
|
||||
std::move(ms.get_case_for(false)))));
|
||||
instruction_ijump* ijump = new instruction_ijump();
|
||||
instruction_ptr inst(ijump);
|
||||
ijump->branches.push_back(std::move(ms.get_case_for(false)));
|
||||
ijump->tag_mappings[0] = 0;
|
||||
ijump->branches.push_back(std::move(ms.get_case_for(true)));
|
||||
ijump->tag_mappings[1] = 1;
|
||||
into.push_back(std::move(inst));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user