mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-10 00:42:45 +01:00
glasm: Throw when there are register leaks
This commit is contained in:
parent
ca05a13c62
commit
379b305b4b
2 changed files with 7 additions and 0 deletions
|
@ -271,6 +271,9 @@ void EmitCode(EmitContext& ctx, const IR::Program& program) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (!ctx.reg_alloc.IsEmpty()) {
|
||||
throw LogicError("Register allocator is not empty");
|
||||
}
|
||||
}
|
||||
|
||||
void SetupOptions(const IR::Program& program, const Profile& profile,
|
||||
|
|
|
@ -128,6 +128,10 @@ public:
|
|||
return num_used_long_registers;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool IsEmpty() const noexcept {
|
||||
return register_use.none() && long_register_use.none();
|
||||
}
|
||||
|
||||
/// Returns true if the instruction is expected to be aliased to another
|
||||
static bool IsAliased(const IR::Inst& inst);
|
||||
|
||||
|
|
Loading…
Reference in a new issue