mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-22 10:41:43 +00:00
-Ostrip-constant-names
This commit is contained in:
parent
d3568627e9
commit
6a93b72ea5
3 changed files with 13 additions and 1 deletions
|
@ -362,6 +362,11 @@ variable which is not 'alive' at that point can be used to keep the
|
|||
result. This can reduce the size of the global section.
|
||||
This will not have declared variables overlap, even if it was
|
||||
possible.
|
||||
.TP
|
||||
.B -Ostrip-constant-names
|
||||
Don't generate defs for immediate values or even declared constants.
|
||||
Meaning variables which are implicitly constant or qualified as such
|
||||
using the 'const' keyword.
|
||||
.SH CONFIG
|
||||
The configuration file is similar to regular .ini files. Comments
|
||||
start with hashtags or semicolons, sections are written in square
|
||||
|
|
8
ir.c
8
ir.c
|
@ -3120,7 +3120,13 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc
|
|||
def.type = global->vtype;
|
||||
def.offset = vec_size(code_globals);
|
||||
|
||||
if (global->name) {
|
||||
if (OPTS_OPTIMIZATION(OPTIM_STRIP_CONSTANT_NAMES) &&
|
||||
(global->name[0] == '#' || global->cvq == CV_CONST))
|
||||
{
|
||||
pushdef = false;
|
||||
}
|
||||
|
||||
if (pushdef && global->name) {
|
||||
if (global->name[0] == '#') {
|
||||
if (!self->str_immediate)
|
||||
self->str_immediate = code_genstring("IMMEDIATE");
|
||||
|
|
1
opts.def
1
opts.def
|
@ -83,6 +83,7 @@
|
|||
GMQCC_DEFINE_FLAG(TAIL_RECURSION, 1)
|
||||
GMQCC_DEFINE_FLAG(TAIL_CALLS, 2)
|
||||
GMQCC_DEFINE_FLAG(OVERLAP_LOCALS, 3)
|
||||
GMQCC_DEFINE_FLAG(STRIP_CONSTANT_NAMES, 1)
|
||||
#endif
|
||||
|
||||
/* some cleanup so we don't have to */
|
||||
|
|
Loading…
Reference in a new issue