diff options
| author | 2023-06-05 09:32:17 +0200 | |
|---|---|---|
| committer | 2023-06-05 09:32:17 +0200 | |
| commit | efc0cf8039cbff5e0f0d52fd7414c7186129b6ac (patch) | |
| tree | 27aabd39ebe1c778f052edaf7088eded379f0108 /parse.c | |
| parent | 6ce2ac20e1d9095281a233aeb778d0fa2c82dd74 (diff) | |
command line switch for debug options
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2582,7 +2582,6 @@ parse(struct parser *pr) } continue; } - if (decl.name) efmt("%s : %tq\n", decl.name, decl.ty, decl.qual); if (st.funcdef) { const struct typedata *td = &typedata[decl.ty.dat]; struct function fn = { pr->fnarena, decl.name, .globl = decl.scls != SCSTATIC }; @@ -2591,7 +2590,8 @@ parse(struct parser *pr) putdecl(pr, &decl); irinit(&fn); function(pr, &fn, st.pnames, st.pspans); - /* if (!nerror) irdump(&fn, decl.name); */ + if (!nerror && ccopt.dbg.p) + irdump(&fn, decl.name); irfini(&fn); } else if (decl.name) { putdecl(pr, &decl); @@ -2603,6 +2603,9 @@ parse(struct parser *pr) if (!eval(&ini, EVSTATICINI)) error(&ini.span, "cannot evaluate expression statically"); } + if (ccopt.dbg.p) efmt("var %s : %tq\n", decl.name, decl.ty, decl.qual); + } else { + if (ccopt.dbg.p) efmt("type %ty\n", decl.ty); } freearena(pr->fnarena); freearena(pr->exarena); |