X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=main.c;h=57e7a3065836f7d7ce59e031d4503068fc0b0f54;hb=e102c1632bb64c097ff2cbba8b4198ce2d74fe94;hp=205cf0486fab79e744707321d6e68bb2e673f2fd;hpb=a890589031b1b62e249c71745b6a2182c4fc082a;p=xonotic%2Fgmqcc.git diff --git a/main.c b/main.c index 205cf04..57e7a30 100644 --- a/main.c +++ b/main.c @@ -27,6 +27,9 @@ uint32_t opts_flags[1 + (COUNT_FLAGS / 32)]; uint32_t opts_optimization[1 + (COUNT_OPTIMIZATIONS / 32)]; +/* counter increased in ir.c */ +unsigned int optimization_count[COUNT_OPTIMIZATIONS]; + uint32_t opts_O = 1; const char *opts_output = "progs.dat"; int opts_standard = COMPILER_GMQCC; @@ -36,7 +39,7 @@ bool opts_dumpfin = false; bool opts_dump = false; bool opts_forcecrc = false; bool opts_pp_only = false; -size_t opts_max_array_size = 1024; +size_t opts_max_array_size = (1024 << 3); uint16_t opts_forced_crc; @@ -375,7 +378,7 @@ static bool options_parse(int argc, char **argv) { con_out("Possible optimizations:\n"); for (itr = 0; itr < COUNT_OPTIMIZATIONS; ++itr) { util_strtononcmd(opts_opt_list[itr].name, buffer, sizeof(buffer)); - con_out(" -O%s\n", buffer); + con_out(" -O%-20s (-O%u)\n", buffer, opts_opt_oflag[itr]); } exit(0); } @@ -652,9 +655,11 @@ srcdone: goto cleanup; } data = ftepp_get(); - if (!parser_compile_string_len(items[itr].filename, data, vec_size(data)-1)) { - retval = 1; - goto cleanup; + if (vec_size(data)) { + if (!parser_compile_string_len(items[itr].filename, data, vec_size(data))) { + retval = 1; + goto cleanup; + } } ftepp_flush(); } @@ -683,6 +688,14 @@ srcdone: /* stuff */ + if (!opts_pp_only) { + for (itr = 0; itr < COUNT_OPTIMIZATIONS; ++itr) { + if (optimization_count[itr]) { + con_out("%s: %u\n", opts_opt_list[itr].name, (unsigned int)optimization_count[itr]); + } + } + } + cleanup: util_debug("COM", "cleaning ...\n"); ftepp_finish();