Factor bespoke debug variables into debug_flags crate

This commit is contained in:
Ayaz Hafiz 2022-04-29 17:45:55 -04:00
parent 5e47e4767e
commit 9964f86a3d
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
13 changed files with 167 additions and 70 deletions

View file

@ -10,6 +10,7 @@ use roc_builtins::bitcode::{FloatWidth, IntWidth};
use roc_can::abilities::AbilitiesStore;
use roc_can::expr::{AnnotatedMark, ClosureData, IntValue};
use roc_collections::all::{default_hasher, BumpMap, BumpMapDefault, MutMap};
use roc_debug_flags::{dbg_do, ROC_PRETTY_PRINT_IR_SYMBOLS};
use roc_exhaustive::{Ctor, CtorName, Guard, RenderAs, TagId};
use roc_module::ident::{ForeignSymbol, Lowercase, TagName};
use roc_module::low_level::LowLevel;
@ -25,11 +26,11 @@ use roc_types::subs::{
use std::collections::HashMap;
use ven_pretty::{BoxAllocator, DocAllocator, DocBuilder};
#[inline(always)]
pub fn pretty_print_ir_symbols() -> bool {
#[cfg(debug_assertions)]
if std::env::var("PRETTY_PRINT_IR_SYMBOLS") == Ok("1".into()) {
dbg_do!(ROC_PRETTY_PRINT_IR_SYMBOLS, {
return true;
}
});
false
}