# HG changeset patch # User Lost Wizard (lost@starbug3) # Date 1306372413 21600 # Node ID 428068681cbf2260f93b8159ac9f44bb75813417 # Parent 585cd68253f003efe1bc5a4f5e6e7a7798bcef2d Added nolist pragma to suppress listing output of non-code generating lines diff -r 585cd68253f0 -r 428068681cbf lwasm/list.c --- a/lwasm/list.c Wed May 18 20:09:33 2011 -0600 +++ b/lwasm/list.c Wed May 25 19:13:33 2011 -0600 @@ -58,6 +58,11 @@ for (cl = as -> line_head; cl; cl = nl) { nl = cl -> next; + if (CURPRAGMA(cl, PRAGMA_NOLIST)) + { + if (cl -> outputl <= 0) + continue; + } if (cl -> noexpand_start) { obytelen = 0; diff -r 585cd68253f0 -r 428068681cbf lwasm/lwasm.h --- a/lwasm/lwasm.h Wed May 18 20:09:33 2011 -0600 +++ b/lwasm/lwasm.h Wed May 25 19:13:33 2011 -0600 @@ -78,7 +78,8 @@ PRAGMA_CESCAPES = 0x0008, // allow C style escapes in fcc, fcs, fcn, etc. PRAGMA_IMPORTUNDEFEXPORT = 0x0010, // imports symbol if undefined upon export PRAGMA_PCASPCR = 0x0020, // treats ,PC as ,PCR instead of constant offset - PRAGMA_SHADOW = 0x0040 // allow macros to shadow builtin operations + PRAGMA_SHADOW = 0x0040, // allow macros to shadow builtin operations + PRAGMA_NOLIST = 0x0080 // don't show line in listing }; @@ -185,6 +186,7 @@ { symbol_flag_set = 1, // symbol was used with "set" symbol_flag_nocheck = 2, // do not check symbol characters + symbol_flag_nolist = 4, // no not show symbol in symbol table symbol_flag_none = 0 // no flags }; diff -r 585cd68253f0 -r 428068681cbf lwasm/pragma.c --- a/lwasm/pragma.c Wed May 18 20:09:33 2011 -0600 +++ b/lwasm/pragma.c Wed May 25 19:13:33 2011 -0600 @@ -43,6 +43,7 @@ { "importundefexport", PRAGMA_IMPORTUNDEFEXPORT }, { "pcaspcr", PRAGMA_PCASPCR }, { "shadow", PRAGMA_SHADOW }, + { "nolist", PRAGMA_NOLIST }, { 0, 0 } }; @@ -55,6 +56,7 @@ { "noimportundefexport", PRAGMA_IMPORTUNDEFEXPORT }, { "nopcaspcr", PRAGMA_PCASPCR }, { "noshadow", PRAGMA_SHADOW }, + { "list", PRAGMA_NOLIST }, { 0, 0 } }; @@ -113,6 +115,8 @@ { lwasm_register_error(as, l, "Unrecognized pragma string"); } + if (as -> pragmas & PRAGMA_NOLIST) + l -> pragmas |= PRAGMA_NOLIST; lw_free(ps); } @@ -130,5 +134,7 @@ // *pragma must NEVER throw an error parse_pragma_string(as, ps, 1); + if (as -> pragmas & PRAGMA_NOLIST) + l -> pragmas |= PRAGMA_NOLIST; lw_free(ps); }