diff --git a/src/high-level-overview.md b/src/high-level-overview.md index 9f3b63a5..be396054 100644 --- a/src/high-level-overview.md +++ b/src/high-level-overview.md @@ -104,8 +104,8 @@ take: nodes, and hence may strip things out of the AST as well. 3. **Lowering to HIR** - Once name resolution completes, we convert the AST into the HIR, - or "high-level IR". The HIR is defined in `src/librustc/hir/`; - that module also includes the lowering code. + or "[high-level intermediate representation]". The HIR is defined in + `src/librustc/hir/`; that module also includes the lowering code. - The HIR is a lightly desugared variant of the AST. It is more processed than the AST and more suitable for the analyses that follow. It is **not** required to match the syntax of the Rust language. @@ -138,3 +138,4 @@ take: [query model]: query.html +[high-level intermediate representation]: hir.html diff --git a/src/hir.md b/src/hir.md index 06ee5e10..44c4968b 100644 --- a/src/hir.md +++ b/src/hir.md @@ -1,10 +1,10 @@ # The HIR -The HIR – "High-level IR" – is the primary IR used in most of rustc. It is a -compiler-friendly representation of the abstract syntax tree (AST) that is -generated after parsing, macro expansion, and name resolution. -Many parts of HIR resemble Rust surface syntax quite closely, with the -exception that some of Rust's expression forms have been desugared away. For +The HIR – "High-Level Intermediate Representation" – is the primary IR used in +most of rustc. It is a compiler-friendly representation of the abstract syntax +tree (AST) that is generated after parsing, macro expansion, and name +resolution. Many parts of HIR resemble Rust surface syntax quite closely, with +the exception that some of Rust's expression forms have been desugared away. For example, `for` loops are converted into a `loop` and do not appear in the HIR. This makes HIR more amenable to analysis than a normal AST.