]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Only erase functions
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 12 May 2018 04:14:12 +0000 (14:14 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 12 May 2018 04:14:12 +0000 (14:14 +1000)
ir.cpp

diff --git a/ir.cpp b/ir.cpp
index facbc33fccaeaaf9829a4fcf72fd18a2e409f6d7..5e6cfaa7490012fb9bb647a54b619138d7b43dcd 100644 (file)
--- a/ir.cpp
+++ b/ir.cpp
@@ -3322,7 +3322,7 @@ bool ir_builder::generateGlobal(ir_value *global, bool islocal)
          * if we're eraseable and the function isn't referenced ignore outputting
          * the function.
          */
-        if (global->m_flags & IR_FLAG_ERASABLE && global->m_reads.empty()) {
+        if (global->m_flags & IR_FLAG_ERASABLE && global->m_reads.empty() && global->m_vtype == TYPE_FUNCTION) {
             return true;
         }