From ae516b0cc7629f4797201c8b947d5df1a62261ee Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Tue, 8 May 2018 12:40:43 -0500 Subject: [PATCH] reword HIR intro. Fix #116 --- src/hir.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hir.md b/src/hir.md index 3d2fbede..51296e55 100644 --- a/src/hir.md +++ b/src/hir.md @@ -1,11 +1,12 @@ # The HIR -The HIR – "High-level IR" – is the primary IR used in most of rustc. -It is a desugared version of the "abstract syntax tree" (AST) that is generated -after parsing, macro expansion, and name resolution have completed. Many parts -of HIR resemble Rust surface syntax quite closely, with the exception that some -of Rust's expression forms have been desugared away (as an example, `for` loops -are converted into a `loop` and do not appear in 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 have completed. +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. This chapter covers the main concepts of the HIR.