refactor(dev): unify user-facing diagnostics
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include "utils/Log.h"
|
||||
|
||||
namespace mir {
|
||||
namespace {
|
||||
|
||||
@@ -24,7 +26,7 @@ void RunRegAlloc(MachineFunction& function) {
|
||||
for (const auto& inst : function.entry().instructions()) {
|
||||
for (const auto& operand : inst.operands()) {
|
||||
if (operand.kind() == Operand::Kind::Reg && !IsAllowedReg(operand.reg())) {
|
||||
throw std::runtime_error("Lab3 MVP 后端发现未预着色的寄存器");
|
||||
throw std::runtime_error(FormatError("mir", "寄存器分配失败"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user