feat: complete Lab3 instruction selection and assembly generation
This commit is contained in:
16
src/main.cpp
16
src/main.cpp
@@ -46,13 +46,17 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
if (opts.emit_asm) {
|
||||
auto machine_func = mir::LowerToMIR(*module);
|
||||
mir::RunRegAlloc(*machine_func);
|
||||
mir::RunFrameLowering(*machine_func);
|
||||
if (need_blank_line) {
|
||||
std::cout << "\n";
|
||||
mir::PrintGlobals(*module, std::cout);
|
||||
auto machine_funcs = mir::LowerToMIR(*module);
|
||||
for (auto& machine_func : machine_funcs) {
|
||||
mir::RunRegAlloc(*machine_func);
|
||||
mir::RunFrameLowering(*machine_func);
|
||||
if (need_blank_line) {
|
||||
std::cout << "\n";
|
||||
}
|
||||
mir::PrintAsm(*machine_func, std::cout);
|
||||
need_blank_line = true;
|
||||
}
|
||||
mir::PrintAsm(*machine_func, std::cout);
|
||||
}
|
||||
#else
|
||||
if (opts.emit_ir || opts.emit_asm) {
|
||||
|
||||
Reference in New Issue
Block a user