From 5bafe5be87137eda702233ebfa1c109905dbc4d4 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Thu, 3 Jan 2019 21:17:22 +0000 Subject: [PATCH] Moved debug stuff to a separate subdirectory. --- re2c/Makefile.am | 13 ++- re2c/src/adfa/action.h | 2 +- re2c/src/adfa/adfa.cc | 2 +- re2c/src/adfa/dump.h | 15 ---- re2c/src/adfa/prepare.cc | 2 +- re2c/src/ast/scanner.cc | 2 +- re2c/src/code/emit_action.cc | 2 +- re2c/src/code/go_construct.cc | 2 +- re2c/src/code/input_api.cc | 2 +- re2c/src/compile.cc | 3 +- re2c/src/{dfa/dump.h => debug/debug.h} | 83 +++++++++++-------- re2c/src/{adfa/dump.cc => debug/dump_adfa.cc} | 7 +- .../{dfa/cfg/dump.cc => debug/dump_cfg.cc} | 18 +--- re2c/src/{dfa/dump.cc => debug/dump_dfa.cc} | 10 +-- re2c/src/debug/dump_interf.cc | 29 +++++++ re2c/src/{nfa/dump.cc => debug/dump_nfa.cc} | 4 + re2c/src/dfa/cfg/cfg.h | 3 - re2c/src/dfa/cfg/liveanal.cc | 2 +- re2c/src/dfa/cfg/normalize.cc | 2 +- re2c/src/dfa/determinization.cc | 3 +- re2c/src/dfa/determinization.h | 2 +- re2c/src/dfa/find_state.cc | 4 +- re2c/src/dfa/posix_precedence.cc | 2 +- re2c/src/dfa/tcmd.cc | 2 +- re2c/src/nfa/nfa.h | 1 - re2c/src/re/re.h | 4 +- re2c/src/skeleton/generate_data.cc | 2 +- re2c/src/skeleton/maxpath.cc | 2 +- re2c/src/skeleton/skeleton.cc | 2 +- re2c/src/util/debug.h | 18 ---- re2c/src/util/lookup.h | 2 +- re2c/src/util/range.h | 2 +- 32 files changed, 124 insertions(+), 125 deletions(-) delete mode 100644 re2c/src/adfa/dump.h rename re2c/src/{dfa/dump.h => debug/debug.h} (63%) rename re2c/src/{adfa/dump.cc => debug/dump_adfa.cc} (97%) rename re2c/src/{dfa/cfg/dump.cc => debug/dump_cfg.cc} (82%) rename re2c/src/{dfa/dump.cc => debug/dump_dfa.cc} (99%) create mode 100644 re2c/src/debug/dump_interf.cc rename re2c/src/{nfa/dump.cc => debug/dump_nfa.cc} (98%) delete mode 100644 re2c/src/util/debug.h diff --git a/re2c/Makefile.am b/re2c/Makefile.am index 7a5d6bf3..5afc3855 100644 --- a/re2c/Makefile.am +++ b/re2c/Makefile.am @@ -25,11 +25,9 @@ SRC_HDR = \ src/conf/warn.h \ src/adfa/action.h \ src/adfa/adfa.h \ - src/adfa/dump.h \ src/dfa/cfg/cfg.h \ src/dfa/determinization.h \ src/dfa/dfa.h \ - src/dfa/dump.h \ src/dfa/tag_history.h \ src/dfa/tagver_table.h \ src/dfa/tcmd.h \ @@ -55,11 +53,11 @@ SRC_HDR = \ src/ast/parser.h \ src/ast/scanner.h \ src/ast/unescape.h \ + src/debug/debug.h \ src/util/allocate.h \ src/util/attribute.h \ src/util/c99_stdint.h \ src/util/counter.h \ - src/util/debug.h \ src/util/forbid_copy.h \ src/util/free_list.h \ src/util/get_dir.h \ @@ -90,16 +88,18 @@ SRC = \ src/conf/msg.cc \ src/conf/opt.cc \ src/conf/warn.cc \ - src/nfa/dump.cc \ src/nfa/estimate_size.cc \ src/nfa/re_to_nfa.cc \ src/adfa/adfa.cc \ - src/adfa/dump.cc \ src/adfa/prepare.cc \ + src/debug/dump_adfa.cc \ + src/debug/dump_cfg.cc \ + src/debug/dump_dfa.cc \ + src/debug/dump_interf.cc \ + src/debug/dump_nfa.cc \ src/dfa/cfg/cfg.cc \ src/dfa/cfg/compact.cc \ src/dfa/cfg/dce.cc \ - src/dfa/cfg/dump.cc \ src/dfa/cfg/freeze.cc \ src/dfa/cfg/interfere.cc \ src/dfa/cfg/liveanal.cc \ @@ -112,7 +112,6 @@ SRC = \ src/dfa/closure_posix.cc \ src/dfa/dead_rules.cc \ src/dfa/determinization.cc \ - src/dfa/dump.cc \ src/dfa/fallback_tags.cc \ src/dfa/fillpoints.cc \ src/dfa/find_state.cc \ diff --git a/re2c/src/adfa/action.h b/re2c/src/adfa/action.h index 95ab3de7..b0518969 100644 --- a/re2c/src/adfa/action.h +++ b/re2c/src/adfa/action.h @@ -4,9 +4,9 @@ #include #include "src/code/label.h" +#include "src/debug/debug.h" #include "src/dfa/tcmd.h" #include "src/util/c99_stdint.h" -#include "src/util/debug.h" #include "src/util/uniq_vector.h" namespace re2c diff --git a/re2c/src/adfa/adfa.cc b/re2c/src/adfa/adfa.cc index e642b6f8..ea5dc028 100644 --- a/re2c/src/adfa/adfa.cc +++ b/re2c/src/adfa/adfa.cc @@ -7,9 +7,9 @@ #include "src/adfa/adfa.h" #include "src/code/go.h" +#include "src/debug/debug.h" #include "src/dfa/dfa.h" #include "src/util/allocate.h" -#include "src/util/debug.h" namespace re2c { diff --git a/re2c/src/adfa/dump.h b/re2c/src/adfa/dump.h deleted file mode 100644 index 352f4532..00000000 --- a/re2c/src/adfa/dump.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _RE2C_ADFA_DUMP_ -#define _RE2C_ADFA_DUMP_ - -#include "src/adfa/adfa.h" - -namespace re2c -{ - -struct DFA; - -void dump_adfa(const DFA &dfa); - -} // namespace re2c - -#endif // _RE2C_ADFA_DUMP_ diff --git a/re2c/src/adfa/prepare.cc b/re2c/src/adfa/prepare.cc index 0b29c0ad..b4e09879 100644 --- a/re2c/src/adfa/prepare.cc +++ b/re2c/src/adfa/prepare.cc @@ -11,10 +11,10 @@ #include "src/code/go.h" #include "src/conf/msg.h" #include "src/conf/opt.h" +#include "src/debug/debug.h" #include "src/dfa/tcmd.h" #include "src/re/rule.h" #include "src/util/allocate.h" -#include "src/util/debug.h" namespace re2c { diff --git a/re2c/src/ast/scanner.cc b/re2c/src/ast/scanner.cc index d639c96a..5b87776c 100644 --- a/re2c/src/ast/scanner.cc +++ b/re2c/src/ast/scanner.cc @@ -2,7 +2,7 @@ #include "src/ast/scanner.h" #include "src/conf/msg.h" -#include "src/util/debug.h" +#include "src/debug/debug.h" namespace re2c { diff --git a/re2c/src/code/emit_action.cc b/re2c/src/code/emit_action.cc index bf41a867..2195967d 100644 --- a/re2c/src/code/emit_action.cc +++ b/re2c/src/code/emit_action.cc @@ -15,12 +15,12 @@ #include "src/code/label.h" #include "src/code/output.h" #include "src/conf/opt.h" +#include "src/debug/debug.h" #include "src/dfa/tcmd.h" #include "src/re/rule.h" #include "src/re/tag.h" #include "src/skeleton/skeleton.h" #include "src/util/string_utils.h" -#include "src/util/debug.h" namespace re2c { diff --git a/re2c/src/code/go_construct.cc b/re2c/src/code/go_construct.cc index b925150a..ee25ed33 100644 --- a/re2c/src/code/go_construct.cc +++ b/re2c/src/code/go_construct.cc @@ -9,9 +9,9 @@ #include "src/code/bitmap.h" #include "src/code/go.h" #include "src/conf/opt.h" +#include "src/debug/debug.h" #include "src/dfa/tcmd.h" #include "src/util/allocate.h" -#include "src/util/debug.h" namespace re2c { diff --git a/re2c/src/code/input_api.cc b/re2c/src/code/input_api.cc index fe1c6ce7..204bd595 100644 --- a/re2c/src/code/input_api.cc +++ b/re2c/src/code/input_api.cc @@ -3,7 +3,7 @@ #include "src/code/emit.h" #include "src/code/input_api.h" #include "src/conf/opt.h" -#include "src/util/debug.h" +#include "src/debug/debug.h" namespace re2c { diff --git a/re2c/src/compile.cc b/re2c/src/compile.cc index bac17719..3966c00e 100644 --- a/re2c/src/compile.cc +++ b/re2c/src/compile.cc @@ -6,7 +6,6 @@ #include #include "src/adfa/adfa.h" -#include "src/adfa/dump.h" #include "src/ast/ast.h" #include "src/ast/parser.h" #include "src/ast/scanner.h" @@ -14,8 +13,8 @@ #include "src/code/output.h" #include "src/compile.h" #include "src/conf/opt.h" +#include "src/debug/debug.h" #include "src/dfa/dfa.h" -#include "src/dfa/dump.h" #include "src/nfa/nfa.h" #include "src/re/encoding/range_suffix.h" #include "src/re/re.h" diff --git a/re2c/src/dfa/dump.h b/re2c/src/debug/debug.h similarity index 63% rename from re2c/src/dfa/dump.h rename to re2c/src/debug/debug.h index 8d39c815..c542b13a 100644 --- a/re2c/src/dfa/dump.h +++ b/re2c/src/debug/debug.h @@ -1,22 +1,51 @@ -#ifndef _RE2C_DFA_DUMP_ -#define _RE2C_DFA_DUMP_ +#ifndef _RE2C_DEBUG_DEBUG_ +#define _RE2C_DEBUG_DEBUG_ -#include + +#ifndef RE2C_DEBUG + +namespace re2c { + +struct opt_t; + +struct closure_stats_t {}; +struct dump_dfa_t { dump_dfa_t(const opt_t *) {} }; + +#define DASSERT(x) +#define DDUMP_NFA(opts, nfa) +#define DDUMP_DFA_RAW(ctx, isnew) +#define DDUMP_DFA_DET(opts, dfa) +#define DDUMP_DFA_TAGOPT(opts, dfa) +#define DDUMP_DFA_MIN(opts, dfa) +#define DDUMP_ADFA(opts, adfa) +#define DDUMP_CLSTATS(ctx) +#define DINCCOUNT_CLSCANS(ctx) +#define DINCCOUNT_CLPREC(ctx) +#define DINCCOUNT_CLLENGTH(ctx, len) +#define DRESET_CLSTATS(ctx) + +} // namespace re2c + +#else // RE2C_DEBUG + +#include #include "src/util/c99_stdint.h" -namespace re2c -{ +namespace re2c { +struct DFA; +struct cfg_t; struct determ_context_t; struct dfa_t; +struct nfa_t; struct opt_t; struct tcmd_t; struct closure_stats_t { - uint32_t nscans; // number of configuration scans - uint32_t nprec; // number of POSIX comparisons of configurations - size_t length; // total length of compared histories + uint32_t nscans; // number of configuration scans + uint32_t nprec; // number of POSIX comparisons of configurations + size_t length; // total length of compared histories }; struct dump_dfa_t @@ -29,28 +58,9 @@ struct dump_dfa_t void state(const determ_context_t &, bool); }; -void dump_dfa(const dfa_t &dfa); -void dump_tcmd(const tcmd_t *p); - - -#ifndef RE2C_DEBUG - -#define DDUMP_NFA(opts, nfa) -#define DDUMP_DFA_RAW(opts, dfa) -#define DDUMP_DFA_DET(opts, dfa) -#define DDUMP_DFA_TAGOPT(opts, dfa) -#define DDUMP_DFA_MIN(opts, dfa) -#define DDUMP_ADFA(opts, adfa) -#define DDUMP_CLSTATS(ctx) -#define DINCCOUNT_CLSCANS(ctx) -#define DINCCOUNT_CLPREC(ctx) -#define DINCCOUNT_CLLENGTH(ctx, len) -#define DRESET_CLSTATS(ctx) - -#else // RE2C_DEBUG - +#define DASSERT(x) assert(x) #define DDUMP_NFA(opts, nfa) if (opts->dump_nfa) dump_nfa(nfa) -#define DDUMP_DFA_RAW(opts, dfa) if (opts->dump_dfa_raw) dump_dfa(dfa) +#define DDUMP_DFA_RAW(ctx, isnew) ctx.dc_dump.state(ctx, is_new); #define DDUMP_DFA_DET(opts, dfa) if (opts->dump_dfa_det) dump_dfa(dfa) #define DDUMP_DFA_TAGOPT(opts, dfa) if (opts->dump_dfa_tagopt) dump_dfa(dfa) #define DDUMP_DFA_MIN(opts, dfa) if (opts->dump_dfa_min) dump_dfa(dfa) @@ -61,12 +71,17 @@ void dump_tcmd(const tcmd_t *p); #define DINCCOUNT_CLLENGTH(ctx, len) ctx.dc_clstats.length += len #define DRESET_CLSTATS(ctx) reset_clstats(ctx) -void reset_clstats(determ_context_t &); +void dump_nfa(const nfa_t &); +void dump_dfa(const dfa_t &); +void dump_adfa(const DFA &); +void dump_cfg(const cfg_t &, const bool *); +void dump_interf(const cfg_t &, const bool *); void dump_clstats(const determ_context_t &); - -#endif // RE2C_DEBUG - +void dump_tcmd(const tcmd_t *); +void reset_clstats(determ_context_t &); } // namespace re2c -#endif // _RE2C_DFA_DUMP_ +#endif // RE2C_DEBUG + +#endif // _RE2C_DEBUG_DEBUG_ diff --git a/re2c/src/adfa/dump.cc b/re2c/src/debug/dump_adfa.cc similarity index 97% rename from re2c/src/adfa/dump.cc rename to re2c/src/debug/dump_adfa.cc index 771c3561..fb3d1e24 100644 --- a/re2c/src/adfa/dump.cc +++ b/re2c/src/debug/dump_adfa.cc @@ -1,3 +1,5 @@ +#ifdef RE2C_DEBUG + #include "src/util/c99_stdint.h" #include #include @@ -7,9 +9,8 @@ #include "src/adfa/action.h" #include "src/adfa/adfa.h" -#include "src/adfa/dump.h" #include "src/code/go.h" -#include "src/dfa/dump.h" +#include "src/debug/debug.h" #include "src/dfa/tcmd.h" #include "src/re/rule.h" #include "src/re/tag.h" @@ -99,3 +100,5 @@ void dump_adfa(const DFA &dfa) } } // namespace re2c + +#endif // RE2C_DEBUG diff --git a/re2c/src/dfa/cfg/dump.cc b/re2c/src/debug/dump_cfg.cc similarity index 82% rename from re2c/src/dfa/cfg/dump.cc rename to re2c/src/debug/dump_cfg.cc index 02f54b8f..8511dc43 100644 --- a/re2c/src/dfa/cfg/dump.cc +++ b/re2c/src/debug/dump_cfg.cc @@ -1,3 +1,5 @@ +#ifdef RE2C_DEBUG + #include #include "src/dfa/cfg/cfg.h" @@ -66,20 +68,6 @@ void dump_cfg(const cfg_t &cfg, const bool *live) fprintf(stderr, "}\n"); } -void dump_interf(const cfg_t &cfg, const bool *interf) -{ - const tagver_t nver = cfg.dfa.maxtagver + 1; - for (tagver_t y = 1; y < nver; ++y) { - fprintf(stderr, "%2d ", y); - } - fprintf(stderr, "\n"); - for (tagver_t x = 1; x < nver; ++x) { - for (tagver_t y = 1; y < nver; ++y) { - fprintf(stderr, "%2c ", interf[x * nver + y] ? '*' : '.'); - } - fprintf(stderr, "\n"); - } -} - } // namespace re2c +#endif // RE2C_DEBUG diff --git a/re2c/src/dfa/dump.cc b/re2c/src/debug/dump_dfa.cc similarity index 99% rename from re2c/src/dfa/dump.cc rename to re2c/src/debug/dump_dfa.cc index 9fa708be..4d31847e 100644 --- a/re2c/src/dfa/dump.cc +++ b/re2c/src/debug/dump_dfa.cc @@ -1,3 +1,5 @@ +#ifdef RE2C_DEBUG + #include #include #include @@ -5,16 +7,15 @@ #include #include "src/conf/opt.h" +#include "src/debug/debug.h" #include "src/dfa/dfa.h" #include "src/dfa/determinization.h" -#include "src/dfa/dump.h" #include "src/dfa/tag_history.h" #include "src/dfa/tagver_table.h" #include "src/dfa/tcmd.h" #include "src/nfa/nfa.h" #include "src/re/rule.h" #include "src/re/tag.h" -#include "src/util/debug.h" namespace re2c { @@ -304,7 +305,6 @@ void dump_tags(const tagver_table_t &tagvertbl, const tag_history_t &taghistory, } -#ifdef RE2C_DEBUG void reset_clstats(determ_context_t &ctx) { @@ -323,6 +323,6 @@ void dump_clstats(const determ_context_t &ctx) } } -#endif // RE2C_DEBUG - } // namespace re2c + +#endif // RE2C_DEBUG diff --git a/re2c/src/debug/dump_interf.cc b/re2c/src/debug/dump_interf.cc new file mode 100644 index 00000000..45240d5a --- /dev/null +++ b/re2c/src/debug/dump_interf.cc @@ -0,0 +1,29 @@ +#ifdef RE2C_DEBUG + +#include + +#include "src/dfa/cfg/cfg.h" +#include "src/dfa/dfa.h" +#include "src/dfa/tcmd.h" + +namespace re2c +{ + +void dump_interf(const cfg_t &cfg, const bool *interf) +{ + const tagver_t nver = cfg.dfa.maxtagver + 1; + for (tagver_t y = 1; y < nver; ++y) { + fprintf(stderr, "%2d ", y); + } + fprintf(stderr, "\n"); + for (tagver_t x = 1; x < nver; ++x) { + for (tagver_t y = 1; y < nver; ++y) { + fprintf(stderr, "%2c ", interf[x * nver + y] ? '*' : '.'); + } + fprintf(stderr, "\n"); + } +} + +} // namespace re2c + +#endif // RE2C_DEBUG diff --git a/re2c/src/nfa/dump.cc b/re2c/src/debug/dump_nfa.cc similarity index 98% rename from re2c/src/nfa/dump.cc rename to re2c/src/debug/dump_nfa.cc index 13f6142f..f921d53a 100644 --- a/re2c/src/nfa/dump.cc +++ b/re2c/src/debug/dump_nfa.cc @@ -1,3 +1,5 @@ +#ifdef RE2C_DEBUG + #include "src/util/c99_stdint.h" #include #include @@ -79,3 +81,5 @@ void dump_nfa(const nfa_t &nfa) } } // namespace re2c + +#endif // RE2C_DEBUG diff --git a/re2c/src/dfa/cfg/cfg.h b/re2c/src/dfa/cfg/cfg.h index c95825c6..5fd8fbfb 100644 --- a/re2c/src/dfa/cfg/cfg.h +++ b/re2c/src/dfa/cfg/cfg.h @@ -49,9 +49,6 @@ struct cfg_t FORBID_COPY(cfg_t); }; -void dump_cfg(const cfg_t &cfg, const bool *live); -void dump_interf(const cfg_t &cfg, const bool *interf); - } // namespace re2c #endif // _RE2C_DFA_CFG_CFG_ diff --git a/re2c/src/dfa/cfg/liveanal.cc b/re2c/src/dfa/cfg/liveanal.cc index f570cf26..b5bfd803 100644 --- a/re2c/src/dfa/cfg/liveanal.cc +++ b/re2c/src/dfa/cfg/liveanal.cc @@ -1,12 +1,12 @@ #include #include +#include "src/debug/debug.h" #include "src/dfa/cfg/cfg.h" #include "src/dfa/dfa.h" #include "src/dfa/tcmd.h" #include "src/re/rule.h" #include "src/re/tag.h" -#include "src/util/debug.h" namespace re2c { diff --git a/re2c/src/dfa/cfg/normalize.cc b/re2c/src/dfa/cfg/normalize.cc index bbf2d2fd..344b6aca 100644 --- a/re2c/src/dfa/cfg/normalize.cc +++ b/re2c/src/dfa/cfg/normalize.cc @@ -2,11 +2,11 @@ #include #include +#include "src/debug/debug.h" #include "src/dfa/cfg/cfg.h" #include "src/dfa/dfa.h" #include "src/dfa/tcmd.h" #include "src/re/tag.h" -#include "src/util/debug.h" namespace re2c { diff --git a/re2c/src/dfa/determinization.cc b/re2c/src/dfa/determinization.cc index cd3aa0cf..c5f8c884 100644 --- a/re2c/src/dfa/determinization.cc +++ b/re2c/src/dfa/determinization.cc @@ -9,14 +9,13 @@ #include "src/conf/opt.h" #include "src/conf/warn.h" +#include "src/debug/debug.h" #include "src/dfa/dfa.h" #include "src/dfa/determinization.h" -#include "src/dfa/dump.h" #include "src/dfa/tcmd.h" #include "src/nfa/nfa.h" #include "src/re/rule.h" #include "src/re/tag.h" -#include "src/util/debug.h" #include "src/util/range.h" diff --git a/re2c/src/dfa/determinization.h b/re2c/src/dfa/determinization.h index 054392d0..cd90298f 100644 --- a/re2c/src/dfa/determinization.h +++ b/re2c/src/dfa/determinization.h @@ -9,7 +9,7 @@ #include #include "src/nfa/nfa.h" -#include "src/dfa/dump.h" +#include "src/debug/debug.h" #include "src/dfa/tagver_table.h" #include "src/dfa/tag_history.h" #include "src/util/forbid_copy.h" diff --git a/re2c/src/dfa/find_state.cc b/re2c/src/dfa/find_state.cc index 10abd136..bac2cb6b 100644 --- a/re2c/src/dfa/find_state.cc +++ b/re2c/src/dfa/find_state.cc @@ -2,12 +2,12 @@ #include #include +#include "src/debug/debug.h" #include "src/dfa/determinization.h" #include "src/dfa/dfa.h" #include "src/dfa/tcmd.h" #include "src/nfa/nfa.h" #include "src/re/rule.h" -#include "src/util/debug.h" #include "src/util/hash32.h" @@ -133,7 +133,7 @@ void find_state(determ_context_t &ctx) s->tcmd[ctx.dc_symbol] = ctx.dc_actions; } - ctx.dc_dump.state(ctx, is_new); + DDUMP_DFA_RAW(ctx, is_new); } diff --git a/re2c/src/dfa/posix_precedence.cc b/re2c/src/dfa/posix_precedence.cc index 069df8b2..d1199449 100644 --- a/re2c/src/dfa/posix_precedence.cc +++ b/re2c/src/dfa/posix_precedence.cc @@ -1,8 +1,8 @@ #include +#include "src/debug/debug.h" #include "src/dfa/determinization.h" #include "src/dfa/tag_history.h" -#include "src/util/debug.h" namespace re2c diff --git a/re2c/src/dfa/tcmd.cc b/re2c/src/dfa/tcmd.cc index a8a1f7f5..d18f9796 100644 --- a/re2c/src/dfa/tcmd.cc +++ b/re2c/src/dfa/tcmd.cc @@ -1,7 +1,7 @@ #include +#include "src/debug/debug.h" #include "src/dfa/tcmd.h" -#include "src/util/debug.h" #include "src/util/hash32.h" namespace re2c diff --git a/re2c/src/nfa/nfa.h b/re2c/src/nfa/nfa.h index 4d3017ac..7ee812aa 100644 --- a/re2c/src/nfa/nfa.h +++ b/re2c/src/nfa/nfa.h @@ -119,7 +119,6 @@ struct nfa_t }; size_t estimate_size(const std::vector &res); -void dump_nfa(const nfa_t &nfa); } // namespace re2c diff --git a/re2c/src/re/re.h b/re2c/src/re/re.h index 8fb50f28..a75b56bf 100644 --- a/re2c/src/re/re.h +++ b/re2c/src/re/re.h @@ -1,11 +1,11 @@ #ifndef _RE2C_RE_RE_ #define _RE2C_RE_RE_ -#include "src/conf/opt.h" #include "src/ast/ast.h" +#include "src/conf/opt.h" +#include "src/debug/debug.h" #include "src/re/rule.h" #include "src/util/c99_stdint.h" -#include "src/util/debug.h" #include "src/util/forbid_copy.h" #include "src/util/range.h" #include "src/util/slab_allocator.h" diff --git a/re2c/src/skeleton/generate_data.cc b/re2c/src/skeleton/generate_data.cc index 8db1946f..ba37d3f9 100644 --- a/re2c/src/skeleton/generate_data.cc +++ b/re2c/src/skeleton/generate_data.cc @@ -10,13 +10,13 @@ #include "src/conf/msg.h" #include "src/conf/opt.h" +#include "src/debug/debug.h" #include "src/dfa/tcmd.h" #include "src/re/encoding/enc.h" #include "src/re/rule.h" #include "src/re/tag.h" #include "src/skeleton/path.h" #include "src/skeleton/skeleton.h" -#include "src/util/debug.h" #include "src/util/forbid_copy.h" #include "src/util/u32lim.h" #include "src/util/wrap_iter.h" diff --git a/re2c/src/skeleton/maxpath.cc b/re2c/src/skeleton/maxpath.cc index bf5e2104..0280e638 100644 --- a/re2c/src/skeleton/maxpath.cc +++ b/re2c/src/skeleton/maxpath.cc @@ -8,8 +8,8 @@ #include #include "src/conf/msg.h" +#include "src/debug/debug.h" #include "src/skeleton/skeleton.h" -#include "src/util/debug.h" namespace re2c { diff --git a/re2c/src/skeleton/skeleton.cc b/re2c/src/skeleton/skeleton.cc index a3148082..71e50abf 100644 --- a/re2c/src/skeleton/skeleton.cc +++ b/re2c/src/skeleton/skeleton.cc @@ -1,8 +1,8 @@ #include +#include "src/debug/debug.h" #include "src/dfa/dfa.h" #include "src/skeleton/skeleton.h" -#include "src/util/debug.h" namespace re2c { diff --git a/re2c/src/util/debug.h b/re2c/src/util/debug.h deleted file mode 100644 index 76d7ef6c..00000000 --- a/re2c/src/util/debug.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _RE2C_UTIL_DEBUG_ -#define _RE2C_UTIL_DEBUG_ - -#ifdef RE2C_DEBUG - -#include - -#define DEBUG(x) x -#define DASSERT(x) assert(x) - -#else // RE2C_DEBUG - -#define DEBUG(x) -#define DASSERT(x) - -#endif // RE2C_DEBUG - -#endif // _RE2C_UTIL_DEBUG_ diff --git a/re2c/src/util/lookup.h b/re2c/src/util/lookup.h index 0d2ccd9a..4dc19d65 100644 --- a/re2c/src/util/lookup.h +++ b/re2c/src/util/lookup.h @@ -7,7 +7,7 @@ #include #include -#include "src/util/debug.h" +#include "src/debug/debug.h" namespace re2c { diff --git a/re2c/src/util/range.h b/re2c/src/util/range.h index ba893c7b..d547c932 100644 --- a/re2c/src/util/range.h +++ b/re2c/src/util/range.h @@ -4,8 +4,8 @@ #include // NULL #include "src/util/c99_stdint.h" +#include "src/debug/debug.h" #include "src/test/range/test.h" -#include "src/util/debug.h" #include "src/util/forbid_copy.h" #include "src/util/free_list.h" -- 2.40.0