refactor(dev): 统一 IR/MIR 接口命名风格
This commit is contained in:
@@ -23,9 +23,10 @@ bool IsAllowedReg(PhysReg reg) {
|
||||
} // namespace
|
||||
|
||||
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())) {
|
||||
for (const auto& inst : function.GetEntry().GetInstructions()) {
|
||||
for (const auto& operand : inst.GetOperands()) {
|
||||
if (operand.GetKind() == Operand::Kind::Reg &&
|
||||
!IsAllowedReg(operand.GetReg())) {
|
||||
throw std::runtime_error(FormatError("mir", "寄存器分配失败"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user