-Ostrip-constant-names

This commit is contained in:
Wolfgang Bumiller 2012-12-23 22:58:46 +01:00
parent d3568627e9
commit 6a93b72ea5
3 changed files with 13 additions and 1 deletions

View file

@ -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
View file

@ -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");

View file

@ -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 */