mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-17 09:02:25 +00:00
Same on the cleanup branch
This commit is contained in:
parent
90b5a6538a
commit
fa21d85820
1 changed files with 4 additions and 0 deletions
4
ir.cpp
4
ir.cpp
|
@ -3433,6 +3433,8 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc
|
||||||
{
|
{
|
||||||
ir_value_code_setaddr(global, self->m_code->globals.size());
|
ir_value_code_setaddr(global, self->m_code->globals.size());
|
||||||
if (global->m_hasvalue) {
|
if (global->m_hasvalue) {
|
||||||
|
if (global->m_cvq == CV_CONST && global->m_reads.empty())
|
||||||
|
return true;
|
||||||
iptr = (int32_t*)&global->m_constval.ivec[0];
|
iptr = (int32_t*)&global->m_constval.ivec[0];
|
||||||
self->m_code->globals.push_back(*iptr);
|
self->m_code->globals.push_back(*iptr);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3448,6 +3450,8 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc
|
||||||
{
|
{
|
||||||
ir_value_code_setaddr(global, self->m_code->globals.size());
|
ir_value_code_setaddr(global, self->m_code->globals.size());
|
||||||
if (global->m_hasvalue) {
|
if (global->m_hasvalue) {
|
||||||
|
if (global->m_cvq == CV_CONST && global->m_reads.empty())
|
||||||
|
return true;
|
||||||
uint32_t load = code_genstring(self->m_code.get(), global->m_constval.vstring);
|
uint32_t load = code_genstring(self->m_code.get(), global->m_constval.vstring);
|
||||||
self->m_code->globals.push_back(load);
|
self->m_code->globals.push_back(load);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue