[backend] introduced debug option
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
#include <iomanip>
|
||||
#include <functional> // For std::function
|
||||
|
||||
#define DEBUG 0
|
||||
namespace sysy {
|
||||
|
||||
// 可用于分配的通用寄存器
|
||||
@ -172,7 +173,8 @@ std::string RISCv32CodeGen::basicBlock_gen(BasicBlock* bb, const RegAllocResult&
|
||||
// 所以 build_dag 应该返回一个完整的 DAG 节点列表,而不是每次都创建新的。
|
||||
// 为了简化,这里仍然按块构建,但需要注意跨块值的使用。
|
||||
auto dag_nodes_for_bb = build_dag(bb);
|
||||
print_dag(dag_nodes_for_bb, bb_name); // 打印 DAG 调试信息
|
||||
if (DEBUG)
|
||||
print_dag(dag_nodes_for_bb, bb_name); // 打印 DAG 调试信息
|
||||
|
||||
// 存储最终生成的指令
|
||||
std::set<DAGNode*> emitted_nodes; // 跟踪已发射的节点,防止重复
|
||||
|
||||
@ -83,7 +83,6 @@ int main(int argc, char **argv) {
|
||||
auto builder = generator.getBuilder();
|
||||
SysYOptPre optPre(moduleIR, builder);
|
||||
optPre.SysYOptimizateAfterIR();
|
||||
printer.printIR();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user