fix(dev): 统一 IR/MIR 异常前缀

This commit is contained in:
Lane0218
2026-03-12 15:01:19 +08:00
parent f3d0102376
commit a7779038ca
6 changed files with 53 additions and 32 deletions

View File

@@ -3,13 +3,15 @@
#include <ostream>
#include <stdexcept>
#include "utils/Log.h"
namespace mir {
namespace {
const FrameSlot& GetFrameSlot(const MachineFunction& function,
const Operand& operand) {
if (operand.kind() != Operand::Kind::FrameIndex) {
throw std::runtime_error("期望 FrameIndex 操作数");
throw std::runtime_error(FormatError("mir", "期望 FrameIndex 操作数"));
}
return function.frame_slot(operand.frame_index());
}