File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ ZIR 最关键的特征是它是**无类型**的 3。在这个阶段,编译器
139139
140140### **4.2 结果位置语义 (Result Location Semantics)**
141141
142- 在将递归的 AST 转换为线性的 ZIR 时,Zig 引入了 **ResultLoc**(结果位置)的概念,以优化数据流向 6。 当 AstGen 遍历一个 AST 节点时,它会向下传递一个 ResultLoc 参数,告诉子节点:“计算完结果后,请直接把数据写入这个位置。”
142+ 在将递归的 AST 转换为线性的 ZIR 时,Zig 引入了 **ResultLoc**(结果位置)的概念,以优化数据流向 6。当 AstGen 遍历一个 AST 节点时,它会向下传递一个 ResultLoc 参数,告诉子节点:“计算完结果后,请直接把数据写入这个位置。”
143143
144144* **None/Discard**:父节点不需要这个值(例如 \_ \= foo();)。子节点生成计算指令,但不生成存储指令。
145145* **Return**:结果直接作为函数的返回值。
@@ -264,7 +264,7 @@ Zig 支持多种后端,Sema 生成的 AIR 会被分发给选定的后端进行
264264对于 Debug 构建,Zig 优先使用自研的后端(如 x86\_64, ARM64, WASM 后端)。
265265
266266* **直接生成**:这些后端直接将 AIR 转换为二进制机器码,跳过了生成 LLVM IR 的过程。
267- * **速度优势**:由于省去了庞大的中间层,自举后端的编译速度通常比 LLVM 后端快数倍,极大地提升了开发时的“修改-编译- 运行”循环效率 11。
267+ * **速度优势**:由于省去了庞大的中间层,自举后端的编译速度通常比 LLVM 后端快数倍,极大地提升了开发时的“修改 - 编译 - 运行”循环效率 11。
268268
269269### **8.4 C 后端**
270270
You can’t perform that action at this time.
0 commit comments