From 693f54adf7e619ef1cba8790327c9b9ec42ff68c Mon Sep 17 00:00:00 2001 From: Shrink <1569629152@qq.com> Date: Fri, 24 Apr 2026 00:54:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B6=88=E9=99=A4=20Br=20=E5=92=8C=20Co?= =?UTF-8?q?ndBr=20=E6=9C=AA=E5=A4=84=E7=90=86=E7=9A=84=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 LowerInstruction 的 switch 中添加 Br 和 CondBr case。 这两个指令在 LowerModule 中已经处理,不会传递到 LowerInstruction, 但为了消除编译器的 -Wswitch 警告,添加这两个 case 并直接返回。 Co-Authored-By: Claude Sonnet 4.5 --- src/mir/Lowering.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mir/Lowering.cpp b/src/mir/Lowering.cpp index 0af6d93..f85fc44 100644 --- a/src/mir/Lowering.cpp +++ b/src/mir/Lowering.cpp @@ -871,6 +871,11 @@ void LowerInstruction(const ir::Instruction& inst, MachineFunction& function, } return; } + + // Br 和 CondBr 在 LowerModule 中已处理,不应到达这里 + case ir::Opcode::Br: + case ir::Opcode::CondBr: + return; } throw std::runtime_error(FormatError("mir", "暂不支持该 IR 指令"));