mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 11:11:11 +08:00
feat: 编译管线/类型层 crate 补全多级日志宏 + 关键路径日志
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
//! CFG 日志宏:`cfg_error!/warn!/info!/debug!/trace!`,经由 oxide_log 上报。
|
||||
//! 编译管线属 Kernel 子系统,`OXIDE_LOG=oxide::kernel=debug` 控制本 crate 日志。
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! cfg_error {
|
||||
($($arg:tt)*) => {
|
||||
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::ERROR, $($arg)*)
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! cfg_warn {
|
||||
($($arg:tt)*) => {
|
||||
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::WARN, $($arg)*)
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! cfg_info {
|
||||
($($arg:tt)*) => {
|
||||
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::INFO, $($arg)*)
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! cfg_debug {
|
||||
($($arg:tt)*) => {
|
||||
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::DEBUG, $($arg)*)
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! cfg_trace {
|
||||
($($arg:tt)*) => {
|
||||
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::TRACE, $($arg)*)
|
||||
};
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
//! (异常边)→ `finalize`(exit 哨兵 + preds 反推)。每阶段是独立文件的纯函数,
|
||||
//! 中间产物(heads / blocks / exit_id)显式传参,无共享可变状态。
|
||||
|
||||
mod cfg_log;
|
||||
mod exception;
|
||||
mod finalize;
|
||||
mod partition;
|
||||
@@ -93,7 +94,9 @@ pub fn build_cfg(f: &IRFunction) -> Cfg {
|
||||
let heads = partition::partition_blocks(f);
|
||||
let (mut blocks, exit_id) = split::split_and_edges(f, &heads);
|
||||
exception::add_exception_edges(f, &mut blocks);
|
||||
finalize::finalize(blocks, exit_id)
|
||||
let cfg = finalize::finalize(blocks, exit_id);
|
||||
cfg_debug!("build_cfg: {} blocks", cfg.blocks.len());
|
||||
cfg
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user