mirror of
https://github.com/open-goal/jak-project
synced 2026-08-06 09:54:10 -04:00
decomp: resolve first batch of trivial files (#4266)
This commit is contained in:
@@ -110,13 +110,14 @@ void clean_up_cond_with_else(FormPool& pool, FormElement* ir, const Env& env) {
|
||||
*/
|
||||
void clean_up_until_loop(FormPool& pool, UntilElement* ir, const Env& env) {
|
||||
auto condition_branch = get_condition_branch(ir->condition);
|
||||
ASSERT(condition_branch.first);
|
||||
ASSERT_MSG(condition_branch.first, fmt::format("bad condition branch in {}\n", env.func->name()));
|
||||
if (condition_branch.first->op()->branch_delay().kind() != IR2_BranchDelay::Kind::NOP) {
|
||||
ASSERT_MSG(
|
||||
condition_branch.first->op()->branch_delay().kind() == IR2_BranchDelay::Kind::SET_REG_FALSE,
|
||||
fmt::format(
|
||||
"bad delay slot in until loop: {} in {}\n", env.func->name(),
|
||||
condition_branch.first->op()->branch_delay().to_form(env.file->labels, env).print()));
|
||||
"bad delay slot in until loop: {} in {}\n",
|
||||
condition_branch.first->op()->branch_delay().to_form(env.file->labels, env).print(),
|
||||
env.func->name()));
|
||||
ir->false_destination = condition_branch.first->op()->branch_delay().var(0);
|
||||
}
|
||||
auto replacement = condition_branch.first->op()->get_condition_as_form(pool, env);
|
||||
@@ -1974,7 +1975,8 @@ void clean_up_while_loops(FormPool& pool, Form* sequence, const Env& env) {
|
||||
|
||||
auto condition_branch = get_condition_branch(form_as_while->condition);
|
||||
|
||||
ASSERT(condition_branch.first);
|
||||
ASSERT_MSG(condition_branch.first,
|
||||
fmt::format("bad conditional branch in {}\n", env.func->name()));
|
||||
ASSERT(condition_branch.first->op()->branch_delay().kind() == IR2_BranchDelay::Kind::NOP);
|
||||
// printf("got while condition branch %s\n", condition_branch.first->print(file).c_str());
|
||||
auto replacement = condition_branch.first->op()->get_condition_as_form(pool, env);
|
||||
|
||||
Reference in New Issue
Block a user