diff --git a/src/ir/Context.cpp b/src/ir/Context.cpp index a119446..6f95676 100644 --- a/src/ir/Context.cpp +++ b/src/ir/Context.cpp @@ -1,6 +1,4 @@ -// IR 上下文: -// - 管理类型与常量的创建/复用 -// - 保存字符串常量、符号等公共资源(按需要扩展) +// 管理基础类型、整型常量池和临时名生成。 #include "ir/IR.h" #include diff --git a/src/ir/Module.cpp b/src/ir/Module.cpp index 3e5d455..c40eb88 100644 --- a/src/ir/Module.cpp +++ b/src/ir/Module.cpp @@ -1,6 +1,4 @@ -// IR Module: -// - 保存全局变量与函数列表 -// - 维护与目标相关的模块级信息(如需要) +// 保存函数列表并提供模块级上下文访问。 #include "ir/IR.h" diff --git a/src/ir/Type.cpp b/src/ir/Type.cpp index 1dbcc33..148f060 100644 --- a/src/ir/Type.cpp +++ b/src/ir/Type.cpp @@ -1,7 +1,4 @@ -// 极简类型系统:仅支持 void 与 i32。 - -// 还应该包含 f32、数组类型等 -// - 参照SysY官方文档范围逐步补齐 +// 当前仅支持 void、i32 和 i32*。 #include "ir/IR.h" namespace ir { diff --git a/src/ir/passes/PassManager.cpp b/src/ir/passes/PassManager.cpp index dd642d6..044328f 100644 --- a/src/ir/passes/PassManager.cpp +++ b/src/ir/passes/PassManager.cpp @@ -1,9 +1 @@ -// IR Pass 管理: -// - 按优化级别组织优化 pipeline -// - 统一运行 pass、统计与调试输出(按需要扩展) -// -// Lab5 推荐顺序(可迭代多轮): -// 1. ConstFold -// 2. CSE -// 3. DCE -// 4. CFGSimplify +// IR Pass 管理骨架。 diff --git a/src/sem/SymbolTable.cpp b/src/sem/SymbolTable.cpp index cde3941..ec0a721 100644 --- a/src/sem/SymbolTable.cpp +++ b/src/sem/SymbolTable.cpp @@ -1,6 +1,4 @@ -// 符号表与作用域管理: -// - 支持嵌套作用域(块/函数/全局) -// - 变量/函数/参数/常量的注册、查找与遮蔽规则 +// 维护局部变量声明的注册与查找。 #include "sem/SymbolTable.h" diff --git a/src/utils/CLI.cpp b/src/utils/CLI.cpp index da8c2ba..21b6d20 100644 --- a/src/utils/CLI.cpp +++ b/src/utils/CLI.cpp @@ -1,7 +1,4 @@ -// 命令行参数解析: -// - 解析输入/输出路径 -// - 解析输出类型(IR/MIR/ASM)与优化级别等选项 -// - 将参数传递给 main.cpp 的编译流水线驱动 +// 解析帮助、输入文件和输出阶段选项。 #include "utils/CLI.h" diff --git a/src/utils/Log.cpp b/src/utils/Log.cpp index f5852f8..0f780a7 100644 --- a/src/utils/Log.cpp +++ b/src/utils/Log.cpp @@ -1,6 +1,4 @@ -// 日志模块: -// - 统一输出调试信息、阶段信息与错误信息 -// - 提供可配置的日志级别与输出位置(按需要实现) +// 格式化错误并统一打印异常与帮助信息。 #include "utils/Log.h"