mirror of
https://github.com/Noratrieb/uwucc.git
synced 2026-01-15 00:55:05 +01:00
analysis
This commit is contained in:
parent
b74c11987b
commit
475a520de3
8 changed files with 61 additions and 8 deletions
31
analysis/src/lower.rs
Normal file
31
analysis/src/lower.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
use parser::{
|
||||
ast::{self, Ident},
|
||||
Span,
|
||||
};
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use crate::hir;
|
||||
|
||||
pub struct LowerCtx<'hir> {
|
||||
hir_arena: &'hir bumpalo::Bump,
|
||||
global_symbols: FxHashMap<Ident, &'hir hir::ExternalDecl>,
|
||||
}
|
||||
|
||||
impl<'hir> LowerCtx<'hir> {
|
||||
pub fn lower_translation_unit(&mut self, unit: &ast::TranslationUnit) -> hir::Hir<'hir> {
|
||||
for decl in unit {}
|
||||
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn lower_decl(&mut self, decl: &ast::ExternalDecl, span: Span) -> hir::ExternalDecl {
|
||||
match decl {
|
||||
ast::ExternalDecl::Decl(_) => todo!(),
|
||||
ast::ExternalDecl::FunctionDef(func) => todo!(),
|
||||
}
|
||||
}
|
||||
|
||||
fn lower_function_def(&mut self, def: &ast::FunctionDef, span: Span) -> hir::FunctionDef {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue