feat(mir)修复函数序言插入问题

feature/mir
mxr 2 days ago
parent f0706adcc0
commit 4f4842ae3a

@ -42,13 +42,19 @@ void RunFrameLowering(MachineFunction& function) {
// 基本块
const auto& blocks = function.GetBasicBlocks();
bool firstBlock = true;
for (const auto& bb : blocks) {
DEBUG_MSG("block");
auto& insts = bb->GetInstructions();
std::vector<MachineInstr> lowered;
DEBUG_MSG("empalace Prologue");
lowered.emplace_back(Opcode::Prologue);
// 输出基本块标签(非第一个基本块)
if (firstBlock) {
DEBUG_MSG("empalace Prologue");
lowered.emplace_back(Opcode::Prologue);
}
firstBlock = false;
// 输出基本块中的指令
for (const auto& inst : insts) {
DEBUG_MSG("inst");

Loading…
Cancel
Save