mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-22 02:31:28 +00:00
Push definitions when -O0
This commit is contained in:
parent
d27c06ea7f
commit
aebab8b68a
3 changed files with 7 additions and 1 deletions
1
gmqcc.h
1
gmqcc.h
|
@ -1192,6 +1192,7 @@ typedef struct {
|
|||
uint32_t warn_backup [1 + (COUNT_WARNINGS / 32)];
|
||||
uint32_t werror_backup[1 + (COUNT_WARNINGS / 32)];
|
||||
uint32_t optimization [1 + (COUNT_OPTIMIZATIONS / 32)];
|
||||
bool optimizeoff; /* True when -O0 */
|
||||
} opts_cmd_t;
|
||||
|
||||
extern opts_cmd_t opts;
|
||||
|
|
4
ir.c
4
ir.c
|
@ -3327,7 +3327,9 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc
|
|||
size_t i;
|
||||
int32_t *iptr;
|
||||
prog_section_def def;
|
||||
bool pushdef = false;
|
||||
bool pushdef = opts.optimizeoff;
|
||||
|
||||
printf("STATUS: %s\n", (pushdef) ? "OFF" : "ON");
|
||||
|
||||
def.type = global->vtype;
|
||||
def.offset = vec_size(code_globals);
|
||||
|
|
3
opts.c
3
opts.c
|
@ -142,6 +142,9 @@ void opts_setoptimlevel(unsigned int level) {
|
|||
size_t i;
|
||||
for (i = 0; i < COUNT_OPTIMIZATIONS; ++i)
|
||||
opts_set(opts.optimization, i, level >= opts_opt_oflag[i]);
|
||||
|
||||
if (!level)
|
||||
opts.optimizeoff = true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue