Struct HirProgram
pub struct HirProgram {
pub functions: PrimaryMap<FuncId, HirFunction>,
pub extern_functions: BTreeMap<String, HirExternFunction>,
pub duplicate_extern_functions: Vec<DuplicateExternFunction>,
pub structs: Vec<HirStructDecl>,
pub enums: Vec<HirEnumDecl>,
pub statements: PrimaryMap<StmtId, HirStmt>,
pub expressions: PrimaryMap<ExprId, HirExpr>,
pub expr_spans: PrimaryMap<ExprId, Option<SourceSpan>>,
}Expand description
Whole-program HIR container.
Fields§
§functions: PrimaryMap<FuncId, HirFunction>Runtime functions stored in the program arena.
extern_functions: BTreeMap<String, HirExternFunction>Extern functions keyed by their canonical names.
duplicate_extern_functions: Vec<DuplicateExternFunction>Duplicate extern declarations discovered during lowering.
structs: Vec<HirStructDecl>Struct declarations visible in the program.
enums: Vec<HirEnumDecl>Enum declarations visible in the program.
statements: PrimaryMap<StmtId, HirStmt>Statement arena for all lowered runtime statements.
expressions: PrimaryMap<ExprId, HirExpr>Expression arena for all lowered runtime expressions.
expr_spans: PrimaryMap<ExprId, Option<SourceSpan>>Optional source spans keyed by expression id.
Implementations§
§impl HirProgram
impl HirProgram
pub fn function_count(&self) -> usize
pub fn function_count(&self) -> usize
Return the number of runtime functions in the program.
Trait Implementations§
§impl Clone for HirProgram
impl Clone for HirProgram
§fn clone(&self) -> HirProgram
fn clone(&self) -> HirProgram
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HirProgram
impl RefUnwindSafe for HirProgram
impl Send for HirProgram
impl Sync for HirProgram
impl Unpin for HirProgram
impl UnwindSafe for HirProgram
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more