Skip to content

Commit 34f91cb

Browse files
committed
Check for SKIP_LANG_START env var
1 parent 06e5146 commit 34f91cb

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/mk_graph/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,26 @@ pub use context::GraphContext;
2525
pub use index::{AllocEntry, AllocIndex, AllocKind, TypeIndex};
2626
pub use util::GraphLabelString;
2727

28+
// =============================================================================
29+
// Lang Start Filtering
30+
// =============================================================================
31+
32+
pub(crate) fn skip_lang_start() -> bool {
33+
use std::sync::OnceLock;
34+
static VAR: OnceLock<bool> = OnceLock::new();
35+
*VAR.get_or_init(|| std::env::var("SKIP_LANG_START").is_ok())
36+
}
37+
2838
// =============================================================================
2939
// Entry Points
3040
// =============================================================================
3141

3242
/// Entry point to write the DOT file
3343
pub fn emit_dotfile(tcx: TyCtxt<'_>) {
44+
if skip_lang_start() {
45+
println!("SKIP_LANG_START is set");
46+
}
47+
3448
let smir_dot = collect_smir(tcx).to_dot_file();
3549

3650
match tcx.output_filenames(()).path(OutputType::Mir) {

0 commit comments

Comments
 (0)