more stuff

This commit is contained in:
nora 2023-05-23 15:40:07 +02:00
parent 77e18126e7
commit c84fdfaf3a
12 changed files with 270 additions and 38 deletions

View file

@ -32,19 +32,21 @@
//! ```
mod pretty;
mod validate;
use std::fmt::{Debug, Display};
use parser::{Span, Symbol};
pub use pretty::{func_to_string, ir_to_string};
use rustc_hash::FxHashMap;
pub use validate::validate;
use crate::ty::Ty;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct DefId(u32);
pub struct DefId(pub u32);
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Copy)]
pub struct TyLayout<'cx> {
pub ty: Ty<'cx>,
pub layout: &'cx Layout,
@ -160,6 +162,11 @@ pub enum BinKind {
Geq,
Lt,
Leq,
Shl,
Shr,
BitAnd,
BitOr,
BitXor,
}
#[derive(Debug, Clone, Copy)]
@ -212,3 +219,9 @@ impl Operand {
Self::Const(ConstValue::u64(int))
}
}
impl Branch {
pub fn dummy() -> Self {
Branch::Goto(BbIdx(u32::MAX))
}
}