ast visiting for IR building
This commit is contained in:
parent
379769bc59
commit
1a20acd763
|
@ -574,6 +574,17 @@ pub struct TypeInfo {
|
|||
pub signed: bool,
|
||||
}
|
||||
|
||||
impl TypeInfo {
|
||||
/// byte size
|
||||
pub fn size(&self) -> u32 {
|
||||
self.bitsize.div_ceil(8)
|
||||
}
|
||||
/// byte align
|
||||
pub fn align(&self) -> u32 {
|
||||
self.bitalign.div_ceil(8)
|
||||
}
|
||||
}
|
||||
|
||||
impl InternPool {
|
||||
pub fn peer_type(&mut self, lhs: Index, rhs: Index) -> Option<Index> {
|
||||
if lhs == rhs {
|
||||
|
|
1195
src/ast2/mod.rs
1195
src/ast2/mod.rs
File diff suppressed because it is too large
Load diff
|
@ -70,3 +70,5 @@ impl BitSize for &[u8] {
|
|||
bits as u32
|
||||
}
|
||||
}
|
||||
|
||||
pub fn unit<T>(_: T) {}
|
||||
|
|
|
@ -759,8 +759,8 @@ impl<'tree, 'ir> IRBuilder<'tree, 'ir> {
|
|||
}
|
||||
|
||||
pub struct IR {
|
||||
nodes: Vec<Inst>,
|
||||
data: Vec<Option<Data>>,
|
||||
pub(crate) nodes: Vec<Inst>,
|
||||
pub(crate) data: Vec<Option<Data>>,
|
||||
// intern_pool: &'a mut InternPool,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue