feat: 编译管线/类型层 crate 补全多级日志宏 + 关键路径日志

This commit is contained in:
爱特每羊队
2026-08-10 17:56:28 +08:00
parent 61898f8983
commit d3ed1113ef
34 changed files with 421 additions and 1 deletions
+2
View File
@@ -7,6 +7,7 @@
mod dataflow;
mod live_info;
mod liveness_log;
mod ranges;
pub use live_info::LiveInfo;
@@ -20,6 +21,7 @@ pub fn liveness(f: &IRFunction, cfg: &Cfg) -> LiveInfo {
if f.insts.is_empty() {
return LiveInfo::new();
}
liveness_debug!("liveness: {} blocks, {} insts", cfg.blocks.len(), f.insts.len());
let (block_in, block_out, reg_count) = dataflow::block_liveness(f, cfg);
let (inst_before, inst_after) = ranges::inst_liveness(f, cfg, &block_out, &block_in, reg_count);
LiveInfo {
+37
View File
@@ -0,0 +1,37 @@
//! liveness 日志宏:`liveness_error!/warn!/info!/debug!/trace!`,经由 oxide_log 上报。
//! 编译管线属 Kernel 子系统,`OXIDE_LOG=oxide::kernel=debug` 控制本 crate 日志。
#[macro_export]
macro_rules! liveness_error {
($($arg:tt)*) => {
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::ERROR, $($arg)*)
};
}
#[macro_export]
macro_rules! liveness_warn {
($($arg:tt)*) => {
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::WARN, $($arg)*)
};
}
#[macro_export]
macro_rules! liveness_info {
($($arg:tt)*) => {
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::INFO, $($arg)*)
};
}
#[macro_export]
macro_rules! liveness_debug {
($($arg:tt)*) => {
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::DEBUG, $($arg)*)
};
}
#[macro_export]
macro_rules! liveness_trace {
($($arg:tt)*) => {
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::TRACE, $($arg)*)
};
}