a whole lotta 'm_'s
authorWolfgang Bumiller <wry.git@bumiller.com>
Sat, 24 Jan 2015 11:25:46 +0000 (12:25 +0100)
committerWolfgang Bumiller <wry.git@bumiller.com>
Sat, 24 Jan 2015 11:25:46 +0000 (12:25 +0100)
ast.cpp
ast.h
fold.cpp
intrin.cpp
ir.cpp
ir.h
parser.cpp

diff --git a/ast.cpp b/ast.cpp
index 10356be..bb3d9db 100644 (file)
--- a/ast.cpp
+++ b/ast.cpp
 
 #include "algo.h"
 
-#define ast_instantiate(T, ctx, destroyfn)                          \
-    T* self = (T*)mem_a(sizeof(T));                                 \
-    if (!self) {                                                    \
-        return nullptr;                                                \
-    }                                                               \
-    new (self) T();                                                 \
-    ast_node_init((ast_node*)self, ctx, TYPE_##T);                  \
-    ( (ast_node*)self )->destroy = (ast_node_delete*)destroyfn
+#define ast_instantiate(T, ctx, destroyfn) \
+    T* self = new T;                       \
+    if (!self) return nullptr;             \
+    ast_node_init(self, ctx, TYPE_##T);    \
+    self->m_destroy = (ast_node_delete*)destroyfn
 
 /*
  * forward declarations, these need not be in ast.h for obvious
@@ -71,18 +68,18 @@ static GMQCC_NORETURN void _ast_node_destroy(ast_node *self)
 /* Initialize main ast node aprts */
 static void ast_node_init(ast_node *self, lex_ctx_t ctx, int node_type)
 {
-    self->context = ctx;
-    self->destroy      = &_ast_node_destroy;
-    self->keep_node    = false;
-    self->node_type    = node_type;
-    self->side_effects = false;
+    self->m_context = ctx;
+    self->m_destroy      = &_ast_node_destroy;
+    self->m_keep_node    = false;
+    self->m_node_type    = node_type;
+    self->m_side_effects = false;
 }
 
 /* weight and side effects */
 static void _ast_propagate_effects(ast_node *self, ast_node *other)
 {
-    if (ast_side_effects(other))
-        ast_side_effects(self) = true;
+    if (other->m_side_effects)
+      self->m_side_effects = true;
 }
 #define ast_propagate_effects(s,o) _ast_propagate_effects(((ast_node*)(s)), ((ast_node*)(o)))
 
@@ -90,26 +87,26 @@ static void _ast_propagate_effects(ast_node *self, ast_node *other)
 static void ast_expression_init(ast_expression *self,
                                 ast_expression_codegen *codegen)
 {
-    self->codegen  = codegen;
-    self->vtype    = TYPE_VOID;
-    self->next     = nullptr;
-    self->outl     = nullptr;
-    self->outr     = nullptr;
-    self->count    = 0;
-    self->varparam = nullptr;
-    self->flags    = 0;
+    self->m_codegen  = codegen;
+    self->m_vtype    = TYPE_VOID;
+    self->m_next     = nullptr;
+    self->m_outl     = nullptr;
+    self->m_outr     = nullptr;
+    self->m_count    = 0;
+    self->m_varparam = nullptr;
+    self->m_flags    = 0;
     if (OPTS_OPTION_BOOL(OPTION_COVERAGE))
-        self->flags |= AST_FLAG_BLOCK_COVERAGE;
+        self->m_flags |= AST_FLAG_BLOCK_COVERAGE;
 }
 
 static void ast_expression_delete(ast_expression *self)
 {
-    if (self->next)
-        ast_delete(self->next);
-    for (auto &it : self->type_params)
+    if (self->m_next)
+        ast_delete(self->m_next);
+    for (auto &it : self->m_type_params)
         ast_delete(it);
-    if (self->varparam)
-        ast_delete(self->varparam);
+    if (self->m_varparam)
+        ast_delete(self->m_varparam);
 }
 
 static void ast_expression_delete_full(ast_expression *self)
@@ -120,17 +117,17 @@ static void ast_expression_delete_full(ast_expression *self)
 
 ast_value* ast_value_copy(const ast_value *self)
 {
-    ast_value *cp = ast_value_new(self->context, self->name, self->vtype);
-    if (self->next) {
-        cp->next = ast_type_copy(self->context, self->next);
+    ast_value *cp = ast_value_new(self->m_context, self->m_name, self->m_vtype);
+    if (self->m_next) {
+        cp->m_next = ast_type_copy(self->m_context, self->m_next);
     }
     const ast_expression *fromex = self;
     ast_expression *selfex = cp;
-    selfex->count = fromex->count;
-    selfex->flags = fromex->flags;
-    for (auto &it : fromex->type_params) {
+    selfex->m_count = fromex->m_count;
+    selfex->m_flags = fromex->m_flags;
+    for (auto &it : fromex->m_type_params) {
         ast_value *v = ast_value_copy(it);
-        selfex->type_params.push_back(v);
+        selfex->m_type_params.push_back(v);
     }
     return cp;
 }
@@ -139,17 +136,17 @@ void ast_type_adopt_impl(ast_expression *self, const ast_expression *other)
 {
     const ast_expression *fromex;
     ast_expression *selfex;
-    self->vtype = other->vtype;
-    if (other->next) {
-        self->next = (ast_expression*)ast_type_copy(ast_ctx(self), other->next);
+    self->m_vtype = other->m_vtype;
+    if (other->m_next) {
+        self->m_next = (ast_expression*)ast_type_copy(self->m_context, other->m_next);
     }
     fromex = other;
     selfex = self;
-    selfex->count = fromex->count;
-    selfex->flags = fromex->flags;
-    for (auto &it : fromex->type_params) {
+    selfex->m_count = fromex->m_count;
+    selfex->m_flags = fromex->m_flags;
+    for (auto &it : fromex->m_type_params) {
         ast_value *v = ast_value_copy(it);
-        selfex->type_params.push_back(v);
+        selfex->m_type_params.push_back(v);
     }
 }
 
@@ -157,9 +154,9 @@ static ast_expression* ast_shallow_type(lex_ctx_t ctx, qc_type vtype)
 {
     ast_instantiate(ast_expression, ctx, ast_expression_delete_full);
     ast_expression_init(self, nullptr);
-    self->codegen = nullptr;
-    self->next    = nullptr;
-    self->vtype   = vtype;
+    self->m_codegen = nullptr;
+    self->m_next    = nullptr;
+    self->m_vtype   = vtype;
     return self;
 }
 
@@ -179,19 +176,19 @@ ast_expression* ast_type_copy(lex_ctx_t ctx, const ast_expression *ex)
         selfex = self;
 
         /* This may never be codegen()d */
-        selfex->codegen = nullptr;
+        selfex->m_codegen = nullptr;
 
-        selfex->vtype = fromex->vtype;
-        if (fromex->next)
-            selfex->next = ast_type_copy(ctx, fromex->next);
+        selfex->m_vtype = fromex->m_vtype;
+        if (fromex->m_next)
+            selfex->m_next = ast_type_copy(ctx, fromex->m_next);
         else
-            selfex->next = nullptr;
+            selfex->m_next = nullptr;
 
-        selfex->count = fromex->count;
-        selfex->flags = fromex->flags;
-        for (auto &it : fromex->type_params) {
+        selfex->m_count = fromex->m_count;
+        selfex->m_flags = fromex->m_flags;
+        for (auto &it : fromex->m_type_params) {
             ast_value *v = ast_value_copy(it);
-            selfex->type_params.push_back(v);
+            selfex->m_type_params.push_back(v);
         }
 
         return self;
@@ -200,30 +197,30 @@ ast_expression* ast_type_copy(lex_ctx_t ctx, const ast_expression *ex)
 
 bool ast_compare_type(ast_expression *a, ast_expression *b)
 {
-    if (a->vtype == TYPE_NIL ||
-        b->vtype == TYPE_NIL)
+    if (a->m_vtype == TYPE_NIL ||
+        b->m_vtype == TYPE_NIL)
         return true;
-    if (a->vtype != b->vtype)
+    if (a->m_vtype != b->m_vtype)
         return false;
-    if (!a->next != !b->next)
+    if (!a->m_next != !b->m_next)
         return false;
-    if (a->type_params.size() != b->type_params.size())
+    if (a->m_type_params.size() != b->m_type_params.size())
         return false;
-    if ((a->flags & AST_FLAG_TYPE_MASK) !=
-        (b->flags & AST_FLAG_TYPE_MASK) )
+    if ((a->m_flags & AST_FLAG_TYPE_MASK) !=
+        (b->m_flags & AST_FLAG_TYPE_MASK) )
     {
         return false;
     }
-    if (a->type_params.size()) {
+    if (a->m_type_params.size()) {
         size_t i;
-        for (i = 0; i < a->type_params.size(); ++i) {
-            if (!ast_compare_type((ast_expression*)a->type_params[i],
-                                  (ast_expression*)b->type_params[i]))
+        for (i = 0; i < a->m_type_params.size(); ++i) {
+            if (!ast_compare_type((ast_expression*)a->m_type_params[i],
+                                  (ast_expression*)b->m_type_params[i]))
                 return false;
         }
     }
-    if (a->next)
-        return ast_compare_type(a->next, b->next);
+    if (a->m_next)
+        return ast_compare_type(a->m_next, b->m_next);
     return true;
 }
 
@@ -243,43 +240,43 @@ static size_t ast_type_to_string_impl(ast_expression *e, char *buf, size_t bufsi
     if (pos + 1 >= bufsize)
         goto full;
 
-    switch (e->vtype) {
+    switch (e->m_vtype) {
         case TYPE_VARIANT:
             util_strncpy(buf + pos, "(variant)", 9);
             return pos + 9;
 
         case TYPE_FIELD:
             buf[pos++] = '.';
-            return ast_type_to_string_impl(e->next, buf, bufsize, pos);
+            return ast_type_to_string_impl(e->m_next, buf, bufsize, pos);
 
         case TYPE_POINTER:
             if (pos + 3 >= bufsize)
                 goto full;
             buf[pos++] = '*';
             buf[pos++] = '(';
-            pos = ast_type_to_string_impl(e->next, buf, bufsize, pos);
+            pos = ast_type_to_string_impl(e->m_next, buf, bufsize, pos);
             if (pos + 1 >= bufsize)
                 goto full;
             buf[pos++] = ')';
             return pos;
 
         case TYPE_FUNCTION:
-            pos = ast_type_to_string_impl(e->next, buf, bufsize, pos);
+            pos = ast_type_to_string_impl(e->m_next, buf, bufsize, pos);
             if (pos + 2 >= bufsize)
                 goto full;
-            if (e->type_params.empty()) {
+            if (e->m_type_params.empty()) {
                 buf[pos++] = '(';
                 buf[pos++] = ')';
                 return pos;
             }
             buf[pos++] = '(';
-            pos = ast_type_to_string_impl((ast_expression*)(e->type_params[0]), buf, bufsize, pos);
-            for (i = 1; i < e->type_params.size(); ++i) {
+            pos = ast_type_to_string_impl((ast_expression*)(e->m_type_params[0]), buf, bufsize, pos);
+            for (i = 1; i < e->m_type_params.size(); ++i) {
                 if (pos + 2 >= bufsize)
                     goto full;
                 buf[pos++] = ',';
                 buf[pos++] = ' ';
-                pos = ast_type_to_string_impl((ast_expression*)(e->type_params[i]), buf, bufsize, pos);
+                pos = ast_type_to_string_impl((ast_expression*)(e->m_type_params[i]), buf, bufsize, pos);
             }
             if (pos + 1 >= bufsize)
                 goto full;
@@ -287,18 +284,18 @@ static size_t ast_type_to_string_impl(ast_expression *e, char *buf, size_t bufsi
             return pos;
 
         case TYPE_ARRAY:
-            pos = ast_type_to_string_impl(e->next, buf, bufsize, pos);
+            pos = ast_type_to_string_impl(e->m_next, buf, bufsize, pos);
             if (pos + 1 >= bufsize)
                 goto full;
             buf[pos++] = '[';
-            pos += util_snprintf(buf + pos, bufsize - pos - 1, "%i", (int)e->count);
+            pos += util_snprintf(buf + pos, bufsize - pos - 1, "%i", (int)e->m_count);
             if (pos + 1 >= bufsize)
                 goto full;
             buf[pos++] = ']';
             return pos;
 
         default:
-            typestr = type_name[e->vtype];
+            typestr = type_name[e->m_vtype];
             typelen = strlen(typestr);
             if (pos + typelen >= bufsize)
                 goto full;
@@ -325,48 +322,48 @@ ast_value* ast_value_new(lex_ctx_t ctx, const char *name, qc_type t)
     ast_instantiate(ast_value, ctx, ast_value_delete);
     ast_expression_init((ast_expression*)self,
                         (ast_expression_codegen*)&ast_value_codegen);
-    self->keep_node = true; /* keep */
-
-    self->name = name ? util_strdup(name) : nullptr;
-    self->vtype    = t;
-    self->next     = nullptr;
-    self->isfield  = false;
-    self->cvq      = CV_NONE;
-    self->hasvalue = false;
-    self->isimm    = false;
-    self->inexact  = false;
-    self->uses     = 0;
-    memset(&self->constval, 0, sizeof(self->constval));
-
-    self->ir_v           = nullptr;
-    self->ir_values      = nullptr;
-    self->ir_value_count = 0;
-
-    self->setter = nullptr;
-    self->getter = nullptr;
-    self->desc   = nullptr;
-
-    self->argcounter = nullptr;
-    self->intrinsic = false;
+    self->m_keep_node = true; /* keep */
+
+    self->m_name = name ? util_strdup(name) : nullptr;
+    self->m_vtype    = t;
+    self->m_next     = nullptr;
+    self->m_isfield  = false;
+    self->m_cvq      = CV_NONE;
+    self->m_hasvalue = false;
+    self->m_isimm    = false;
+    self->m_inexact  = false;
+    self->m_uses     = 0;
+    memset(&self->m_constval, 0, sizeof(self->m_constval));
+
+    self->m_ir_v           = nullptr;
+    self->m_ir_values      = nullptr;
+    self->m_ir_value_count = 0;
+
+    self->m_setter = nullptr;
+    self->m_getter = nullptr;
+    self->m_desc   = nullptr;
+
+    self->m_argcounter = nullptr;
+    self->m_intrinsic = false;
 
     return self;
 }
 
 void ast_value_delete(ast_value* self)
 {
-    if (self->name)
-        mem_d((void*)self->name);
-    if (self->argcounter)
-        mem_d((void*)self->argcounter);
-    if (self->hasvalue) {
-        switch (self->vtype)
+    if (self->m_name)
+        mem_d((void*)self->m_name);
+    if (self->m_argcounter)
+        mem_d((void*)self->m_argcounter);
+    if (self->m_hasvalue) {
+        switch (self->m_vtype)
         {
         case TYPE_STRING:
-            mem_d((void*)self->constval.vstring);
+            mem_d((void*)self->m_constval.vstring);
             break;
         case TYPE_FUNCTION:
             /* unlink us from the function node */
-            self->constval.vfunc->function_type = nullptr;
+            self->m_constval.vfunc->m_function_type = nullptr;
             break;
         /* NOTE: delete function? currently collected in
          * the parser structure
@@ -375,15 +372,15 @@ void ast_value_delete(ast_value* self)
             break;
         }
     }
-    if (self->ir_values)
-        mem_d(self->ir_values);
+    if (self->m_ir_values)
+        mem_d(self->m_ir_values);
 
-    if (self->desc)
-        mem_d(self->desc);
+    if (self->m_desc)
+        mem_d(self->m_desc);
 
     // initlist imples an array which implies .next in the expression exists.
-    if (self->initlist.size() && self->next->vtype == TYPE_STRING) {
-        for (auto &it : self->initlist)
+    if (self->m_initlist.size() && self->m_next->m_vtype == TYPE_STRING) {
+        for (auto &it : self->m_initlist)
             if (it.vstring)
                 mem_d(it.vstring);
     }
@@ -395,15 +392,15 @@ void ast_value_delete(ast_value* self)
 
 void ast_value_params_add(ast_value *self, ast_value *p)
 {
-    self->type_params.push_back(p);
+    self->m_type_params.push_back(p);
 }
 
 bool ast_value_set_name(ast_value *self, const char *name)
 {
-    if (self->name)
-        mem_d((void*)self->name);
-    self->name = util_strdup(name);
-    return !!self->name;
+    if (self->m_name)
+        mem_d((void*)self->m_name);
+    self->m_name = util_strdup(name);
+    return !!self->m_name;
 }
 
 ast_binary* ast_binary_new(lex_ctx_t ctx, int op,
@@ -414,10 +411,10 @@ ast_binary* ast_binary_new(lex_ctx_t ctx, int op,
 
     if (ast_istype(right, ast_unary) && OPTS_OPTIMIZATION(OPTIM_PEEPHOLE)) {
         ast_unary      *unary  = ((ast_unary*)right);
-        ast_expression *normal = unary->operand;
+        ast_expression *normal = unary->m_operand;
 
         /* make a-(-b) => a + b */
-        if (unary->op == VINSTR_NEG_F || unary->op == VINSTR_NEG_V) {
+        if (unary->m_op == VINSTR_NEG_F || unary->m_op == VINSTR_NEG_V) {
             if (op == INSTR_SUB_F) {
                 op = INSTR_ADD_F;
                 right = normal;
@@ -430,41 +427,41 @@ ast_binary* ast_binary_new(lex_ctx_t ctx, int op,
         }
     }
 
-    self->op = op;
-    self->left = left;
-    self->right = right;
-    self->right_first = false;
+    self->m_op = op;
+    self->m_left = left;
+    self->m_right = right;
+    self->m_right_first = false;
 
     ast_propagate_effects(self, left);
     ast_propagate_effects(self, right);
 
     if (op >= INSTR_EQ_F && op <= INSTR_GT)
-        self->vtype = TYPE_FLOAT;
+        self->m_vtype = TYPE_FLOAT;
     else if (op == INSTR_AND || op == INSTR_OR) {
         if (OPTS_FLAG(PERL_LOGIC))
             ast_type_adopt(self, right);
         else
-            self->vtype = TYPE_FLOAT;
+            self->m_vtype = TYPE_FLOAT;
     }
     else if (op == INSTR_BITAND || op == INSTR_BITOR)
-        self->vtype = TYPE_FLOAT;
+        self->m_vtype = TYPE_FLOAT;
     else if (op == INSTR_MUL_VF || op == INSTR_MUL_FV)
-        self->vtype = TYPE_VECTOR;
+        self->m_vtype = TYPE_VECTOR;
     else if (op == INSTR_MUL_V)
-        self->vtype = TYPE_FLOAT;
+        self->m_vtype = TYPE_FLOAT;
     else
-        self->vtype = left->vtype;
+        self->m_vtype = left->m_vtype;
 
     /* references all */
-    self->refs = AST_REF_ALL;
+    self->m_refs = AST_REF_ALL;
 
     return self;
 }
 
 void ast_binary_delete(ast_binary *self)
 {
-    if (self->refs & AST_REF_LEFT)  ast_unref(self->left);
-    if (self->refs & AST_REF_RIGHT) ast_unref(self->right);
+    if (self->m_refs & AST_REF_LEFT)  ast_unref(self->m_left);
+    if (self->m_refs & AST_REF_RIGHT) ast_unref(self->m_right);
 
     ast_expression_delete((ast_expression*)self);
     self->~ast_binary();
@@ -477,14 +474,14 @@ ast_binstore* ast_binstore_new(lex_ctx_t ctx, int storop, int op,
     ast_instantiate(ast_binstore, ctx, ast_binstore_delete);
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_binstore_codegen);
 
-    ast_side_effects(self) = true;
+    self->m_side_effects = true;
 
-    self->opstore = storop;
-    self->opbin   = op;
-    self->dest    = left;
-    self->source  = right;
+    self->m_opstore = storop;
+    self->m_opbin   = op;
+    self->m_dest    = left;
+    self->m_source  = right;
 
-    self->keep_dest = false;
+    self->m_keep_dest = false;
 
     ast_type_adopt(self, left);
     return self;
@@ -492,9 +489,9 @@ ast_binstore* ast_binstore_new(lex_ctx_t ctx, int storop, int op,
 
 void ast_binstore_delete(ast_binstore *self)
 {
-    if (!self->keep_dest)
-        ast_unref(self->dest);
-    ast_unref(self->source);
+    if (!self->m_keep_dest)
+        ast_unref(self->m_dest);
+    ast_unref(self->m_source);
     ast_expression_delete((ast_expression*)self);
     self->~ast_binstore();
     mem_d(self);
@@ -506,16 +503,16 @@ ast_unary* ast_unary_new(lex_ctx_t ctx, int op,
     ast_instantiate(ast_unary, ctx, ast_unary_delete);
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_unary_codegen);
 
-    self->op      = op;
-    self->operand = expr;
+    self->m_op      = op;
+    self->m_operand = expr;
 
 
     if (ast_istype(expr, ast_unary) && OPTS_OPTIMIZATION(OPTIM_PEEPHOLE)) {
-        ast_unary *prev = (ast_unary*)((ast_unary*)expr)->operand;
+        ast_unary *prev = (ast_unary*)((ast_unary*)expr)->m_operand;
 
         /* Handle for double negation */
-        if (((ast_unary*)expr)->op == op)
-            prev = (ast_unary*)((ast_unary*)expr)->operand;
+        if (((ast_unary*)expr)->m_op == op)
+            prev = (ast_unary*)((ast_unary*)expr)->m_operand;
 
         if (ast_istype(prev, ast_unary)) {
             ast_expression_delete((ast_expression*)self);
@@ -528,9 +525,9 @@ ast_unary* ast_unary_new(lex_ctx_t ctx, int op,
     ast_propagate_effects(self, expr);
 
     if ((op >= INSTR_NOT_F && op <= INSTR_NOT_FNC) || op == VINSTR_NEG_F) {
-        self->vtype = TYPE_FLOAT;
+        self->m_vtype = TYPE_FLOAT;
     } else if (op == VINSTR_NEG_V) {
-        self->vtype = TYPE_VECTOR;
+        self->m_vtype = TYPE_VECTOR;
     } else {
         compile_error(ctx, "cannot determine type of unary operation %s", util_instr_str[op]);
     }
@@ -540,7 +537,7 @@ ast_unary* ast_unary_new(lex_ctx_t ctx, int op,
 
 void ast_unary_delete(ast_unary *self)
 {
-    if (self->operand) ast_unref(self->operand);
+    if (self->m_operand) ast_unref(self->m_operand);
     ast_expression_delete((ast_expression*)self);
     self->~ast_unary();
     mem_d(self);
@@ -551,7 +548,7 @@ ast_return* ast_return_new(lex_ctx_t ctx, ast_expression *expr)
     ast_instantiate(ast_return, ctx, ast_return_delete);
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_return_codegen);
 
-    self->operand = expr;
+    self->m_operand = expr;
 
     if (expr)
         ast_propagate_effects(self, expr);
@@ -561,8 +558,8 @@ ast_return* ast_return_new(lex_ctx_t ctx, ast_expression *expr)
 
 void ast_return_delete(ast_return *self)
 {
-    if (self->operand)
-        ast_unref(self->operand);
+    if (self->m_operand)
+        ast_unref(self->m_operand);
     ast_expression_delete((ast_expression*)self);
     self->~ast_return();
     mem_d(self);
@@ -570,11 +567,11 @@ void ast_return_delete(ast_return *self)
 
 ast_entfield* ast_entfield_new(lex_ctx_t ctx, ast_expression *entity, ast_expression *field)
 {
-    if (field->vtype != TYPE_FIELD) {
+    if (field->m_vtype != TYPE_FIELD) {
         compile_error(ctx, "ast_entfield_new with expression not of type field");
         return nullptr;
     }
-    return ast_entfield_new_force(ctx, entity, field, field->next);
+    return ast_entfield_new_force(ctx, entity, field, field->m_next);
 }
 
 ast_entfield* ast_entfield_new_force(lex_ctx_t ctx, ast_expression *entity, ast_expression *field, const ast_expression *outtype)
@@ -589,8 +586,8 @@ ast_entfield* ast_entfield_new_force(lex_ctx_t ctx, ast_expression *entity, ast_
 
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_entfield_codegen);
 
-    self->entity = entity;
-    self->field  = field;
+    self->m_entity = entity;
+    self->m_field  = field;
     ast_propagate_effects(self, entity);
     ast_propagate_effects(self, field);
 
@@ -600,8 +597,8 @@ ast_entfield* ast_entfield_new_force(lex_ctx_t ctx, ast_expression *entity, ast_
 
 void ast_entfield_delete(ast_entfield *self)
 {
-    ast_unref(self->entity);
-    ast_unref(self->field);
+    ast_unref(self->m_entity);
+    ast_unref(self->m_field);
     ast_expression_delete((ast_expression*)self);
     self->~ast_entfield();
     mem_d(self);
@@ -615,33 +612,33 @@ ast_member* ast_member_new(lex_ctx_t ctx, ast_expression *owner, unsigned int fi
         return nullptr;
     }
 
-    if (owner->vtype != TYPE_VECTOR &&
-        owner->vtype != TYPE_FIELD) {
-        compile_error(ctx, "member-access on an invalid owner of type %s", type_name[owner->vtype]);
+    if (owner->m_vtype != TYPE_VECTOR &&
+        owner->m_vtype != TYPE_FIELD) {
+        compile_error(ctx, "member-access on an invalid owner of type %s", type_name[owner->m_vtype]);
         mem_d(self);
         return nullptr;
     }
 
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_member_codegen);
-    self->keep_node = true; /* keep */
+    self->m_keep_node = true; /* keep */
 
-    if (owner->vtype == TYPE_VECTOR) {
-        self->vtype = TYPE_FLOAT;
-        self->next  = nullptr;
+    if (owner->m_vtype == TYPE_VECTOR) {
+        self->m_vtype = TYPE_FLOAT;
+        self->m_next  = nullptr;
     } else {
-        self->vtype = TYPE_FIELD;
-        self->next = ast_shallow_type(ctx, TYPE_FLOAT);
+        self->m_vtype = TYPE_FIELD;
+        self->m_next = ast_shallow_type(ctx, TYPE_FLOAT);
     }
 
-    self->rvalue = false;
-    self->owner  = owner;
+    self->m_rvalue = false;
+    self->m_owner  = owner;
     ast_propagate_effects(self, owner);
 
-    self->field = field;
+    self->m_field = field;
     if (name)
-        self->name = util_strdup(name);
+        self->m_name = util_strdup(name);
     else
-        self->name = nullptr;
+        self->m_name = nullptr;
 
     return self;
 }
@@ -651,23 +648,23 @@ void ast_member_delete(ast_member *self)
     /* The owner is always an ast_value, which has .keep_node=true,
      * also: ast_members are usually deleted after the owner, thus
      * this will cause invalid access
-    ast_unref(self->owner);
+    ast_unref(self->m_owner);
      * once we allow (expression).x to access a vector-member, we need
      * to change this: preferably by creating an alternate ast node for this
      * purpose that is not garbage-collected.
     */
     ast_expression_delete((ast_expression*)self);
-    mem_d(self->name);
+    mem_d(self->m_name);
     self->~ast_member();
     mem_d(self);
 }
 
 bool ast_member_set_name(ast_member *self, const char *name)
 {
-    if (self->name)
-        mem_d((void*)self->name);
-    self->name = util_strdup(name);
-    return !!self->name;
+    if (self->m_name)
+        mem_d((void*)self->m_name);
+    self->m_name = util_strdup(name);
+    return !!self->m_name;
 }
 
 ast_array_index* ast_array_index_new(lex_ctx_t ctx, ast_expression *array, ast_expression *index)
@@ -675,7 +672,7 @@ ast_array_index* ast_array_index_new(lex_ctx_t ctx, ast_expression *array, ast_e
     ast_expression *outtype;
     ast_instantiate(ast_array_index, ctx, ast_array_index_delete);
 
-    outtype = array->next;
+    outtype = array->m_next;
     if (!outtype) {
         mem_d(self);
         /* Error: field has no type... */
@@ -684,20 +681,20 @@ ast_array_index* ast_array_index_new(lex_ctx_t ctx, ast_expression *array, ast_e
 
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_array_index_codegen);
 
-    self->array = array;
-    self->index = index;
+    self->m_array = array;
+    self->m_index = index;
     ast_propagate_effects(self, array);
     ast_propagate_effects(self, index);
 
     ast_type_adopt(self, outtype);
-    if (array->vtype == TYPE_FIELD && outtype->vtype == TYPE_ARRAY) {
-        if (self->vtype != TYPE_ARRAY) {
-            compile_error(ast_ctx(self), "array_index node on type");
+    if (array->m_vtype == TYPE_FIELD && outtype->m_vtype == TYPE_ARRAY) {
+        if (self->m_vtype != TYPE_ARRAY) {
+            compile_error(self->m_context, "array_index node on type");
             ast_array_index_delete(self);
             return nullptr;
         }
-        self->array = outtype;
-        self->vtype = TYPE_FIELD;
+        self->m_array = outtype;
+        self->m_vtype = TYPE_FIELD;
     }
 
     return self;
@@ -705,10 +702,10 @@ ast_array_index* ast_array_index_new(lex_ctx_t ctx, ast_expression *array, ast_e
 
 void ast_array_index_delete(ast_array_index *self)
 {
-    if (self->array)
-        ast_unref(self->array);
-    if (self->index)
-        ast_unref(self->index);
+    if (self->m_array)
+        ast_unref(self->m_array);
+    if (self->m_index)
+        ast_unref(self->m_index);
     ast_expression_delete((ast_expression*)self);
     mem_d(self);
 }
@@ -717,15 +714,15 @@ ast_argpipe* ast_argpipe_new(lex_ctx_t ctx, ast_expression *index)
 {
     ast_instantiate(ast_argpipe, ctx, ast_argpipe_delete);
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_argpipe_codegen);
-    self->index = index;
-    self->vtype = TYPE_NOEXPR;
+    self->m_index = index;
+    self->m_vtype = TYPE_NOEXPR;
     return self;
 }
 
 void ast_argpipe_delete(ast_argpipe *self)
 {
-    if (self->index)
-        ast_unref(self->index);
+    if (self->m_index)
+        ast_unref(self->m_index);
     ast_expression_delete((ast_expression*)self);
     self->~ast_argpipe();
     mem_d(self);
@@ -741,9 +738,9 @@ ast_ifthen* ast_ifthen_new(lex_ctx_t ctx, ast_expression *cond, ast_expression *
     }
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_ifthen_codegen);
 
-    self->cond     = cond;
-    self->on_true  = ontrue;
-    self->on_false = onfalse;
+    self->m_cond     = cond;
+    self->m_on_true  = ontrue;
+    self->m_on_false = onfalse;
     ast_propagate_effects(self, cond);
     if (ontrue)
         ast_propagate_effects(self, ontrue);
@@ -755,11 +752,11 @@ ast_ifthen* ast_ifthen_new(lex_ctx_t ctx, ast_expression *cond, ast_expression *
 
 void ast_ifthen_delete(ast_ifthen *self)
 {
-    ast_unref(self->cond);
-    if (self->on_true)
-        ast_unref(self->on_true);
-    if (self->on_false)
-        ast_unref(self->on_false);
+    ast_unref(self->m_cond);
+    if (self->m_on_true)
+        ast_unref(self->m_on_true);
+    if (self->m_on_false)
+        ast_unref(self->m_on_false);
     ast_expression_delete((ast_expression*)self);
     self->~ast_ifthen();
     mem_d(self);
@@ -776,14 +773,14 @@ ast_ternary* ast_ternary_new(lex_ctx_t ctx, ast_expression *cond, ast_expression
     }
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_ternary_codegen);
 
-    self->cond     = cond;
-    self->on_true  = ontrue;
-    self->on_false = onfalse;
+    self->m_cond     = cond;
+    self->m_on_true  = ontrue;
+    self->m_on_false = onfalse;
     ast_propagate_effects(self, cond);
     ast_propagate_effects(self, ontrue);
     ast_propagate_effects(self, onfalse);
 
-    if (ontrue->vtype == TYPE_NIL)
+    if (ontrue->m_vtype == TYPE_NIL)
         exprtype = onfalse;
     ast_type_adopt(self, exprtype);
 
@@ -795,9 +792,9 @@ void ast_ternary_delete(ast_ternary *self)
     /* the if()s are only there because computed-gotos can set them
      * to nullptr
      */
-    if (self->cond)     ast_unref(self->cond);
-    if (self->on_true)  ast_unref(self->on_true);
-    if (self->on_false) ast_unref(self->on_false);
+    if (self->m_cond)     ast_unref(self->m_cond);
+    if (self->m_on_true)  ast_unref(self->m_on_true);
+    if (self->m_on_false) ast_unref(self->m_on_false);
     ast_expression_delete((ast_expression*)self);
     self->~ast_ternary();
     mem_d(self);
@@ -813,14 +810,14 @@ ast_loop* ast_loop_new(lex_ctx_t ctx,
     ast_instantiate(ast_loop, ctx, ast_loop_delete);
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_loop_codegen);
 
-    self->initexpr  = initexpr;
-    self->precond   = precond;
-    self->postcond  = postcond;
-    self->increment = increment;
-    self->body      = body;
+    self->m_initexpr  = initexpr;
+    self->m_precond   = precond;
+    self->m_postcond  = postcond;
+    self->m_increment = increment;
+    self->m_body      = body;
 
-    self->pre_not   = pre_not;
-    self->post_not  = post_not;
+    self->m_pre_not   = pre_not;
+    self->m_post_not  = post_not;
 
     if (initexpr)
         ast_propagate_effects(self, initexpr);
@@ -838,16 +835,16 @@ ast_loop* ast_loop_new(lex_ctx_t ctx,
 
 void ast_loop_delete(ast_loop *self)
 {
-    if (self->initexpr)
-        ast_unref(self->initexpr);
-    if (self->precond)
-        ast_unref(self->precond);
-    if (self->postcond)
-        ast_unref(self->postcond);
-    if (self->increment)
-        ast_unref(self->increment);
-    if (self->body)
-        ast_unref(self->body);
+    if (self->m_initexpr)
+        ast_unref(self->m_initexpr);
+    if (self->m_precond)
+        ast_unref(self->m_precond);
+    if (self->m_postcond)
+        ast_unref(self->m_postcond);
+    if (self->m_increment)
+        ast_unref(self->m_increment);
+    if (self->m_body)
+        ast_unref(self->m_body);
     ast_expression_delete((ast_expression*)self);
     self->~ast_loop();
     mem_d(self);
@@ -858,8 +855,8 @@ ast_breakcont* ast_breakcont_new(lex_ctx_t ctx, bool iscont, unsigned int levels
     ast_instantiate(ast_breakcont, ctx, ast_breakcont_delete);
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_breakcont_codegen);
 
-    self->is_continue = iscont;
-    self->levels      = levels;
+    self->m_is_continue = iscont;
+    self->m_levels      = levels;
 
     return self;
 }
@@ -876,7 +873,7 @@ ast_switch* ast_switch_new(lex_ctx_t ctx, ast_expression *op)
     ast_instantiate(ast_switch, ctx, ast_switch_delete);
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_switch_codegen);
 
-    self->operand = op;
+    self->m_operand = op;
 
     ast_propagate_effects(self, op);
 
@@ -885,12 +882,12 @@ ast_switch* ast_switch_new(lex_ctx_t ctx, ast_expression *op)
 
 void ast_switch_delete(ast_switch *self)
 {
-    ast_unref(self->operand);
+    ast_unref(self->m_operand);
 
-    for (auto &it : self->cases) {
-        if (it.value)
-            ast_unref(it.value);
-        ast_unref(it.code);
+    for (auto &it : self->m_cases) {
+        if (it.m_value)
+            ast_unref(it.m_value);
+        ast_unref(it.m_code);
     }
 
     ast_expression_delete((ast_expression*)self);
@@ -903,18 +900,18 @@ ast_label* ast_label_new(lex_ctx_t ctx, const char *name, bool undefined)
     ast_instantiate(ast_label, ctx, ast_label_delete);
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_label_codegen);
 
-    self->vtype = TYPE_NOEXPR;
+    self->m_vtype = TYPE_NOEXPR;
 
-    self->name      = util_strdup(name);
-    self->irblock   = nullptr;
-    self->undefined = undefined;
+    self->m_name      = util_strdup(name);
+    self->m_irblock   = nullptr;
+    self->m_undefined = undefined;
 
     return self;
 }
 
 void ast_label_delete(ast_label *self)
 {
-    mem_d((void*)self->name);
+    mem_d((void*)self->m_name);
     ast_expression_delete((ast_expression*)self);
     self->~ast_label();
     mem_d(self);
@@ -922,7 +919,7 @@ void ast_label_delete(ast_label *self)
 
 static void ast_label_register_goto(ast_label *self, ast_goto *g)
 {
-   self->gotos.push_back(g);
+   self->m_gotos.push_back(g);
 }
 
 ast_goto* ast_goto_new(lex_ctx_t ctx, const char *name)
@@ -930,16 +927,16 @@ ast_goto* ast_goto_new(lex_ctx_t ctx, const char *name)
     ast_instantiate(ast_goto, ctx, ast_goto_delete);
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_goto_codegen);
 
-    self->name    = util_strdup(name);
-    self->target  = nullptr;
-    self->irblock_from = nullptr;
+    self->m_name    = util_strdup(name);
+    self->m_target  = nullptr;
+    self->m_irblock_from = nullptr;
 
     return self;
 }
 
 void ast_goto_delete(ast_goto *self)
 {
-    mem_d((void*)self->name);
+    mem_d((void*)self->m_name);
     ast_expression_delete((ast_expression*)self);
     self->~ast_goto();
     mem_d(self);
@@ -947,24 +944,24 @@ void ast_goto_delete(ast_goto *self)
 
 void ast_goto_set_label(ast_goto *self, ast_label *label)
 {
-    self->target = label;
+    self->m_target = label;
 }
 
 ast_state* ast_state_new(lex_ctx_t ctx, ast_expression *frame, ast_expression *think)
 {
     ast_instantiate(ast_state, ctx, ast_state_delete);
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_state_codegen);
-    self->framenum  = frame;
-    self->nextthink = think;
+    self->m_framenum  = frame;
+    self->m_nextthink = think;
     return self;
 }
 
 void ast_state_delete(ast_state *self)
 {
-    if (self->framenum)
-        ast_unref(self->framenum);
-    if (self->nextthink)
-        ast_unref(self->nextthink);
+    if (self->m_framenum)
+        ast_unref(self->m_framenum);
+    if (self->m_nextthink)
+        ast_unref(self->m_nextthink);
 
     ast_expression_delete((ast_expression*)self);
     self->~ast_state();
@@ -975,33 +972,33 @@ ast_call* ast_call_new(lex_ctx_t ctx,
                        ast_expression *funcexpr)
 {
     ast_instantiate(ast_call, ctx, ast_call_delete);
-    if (!funcexpr->next) {
+    if (!funcexpr->m_next) {
         compile_error(ctx, "not a function");
         mem_d(self);
         return nullptr;
     }
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_call_codegen);
 
-    ast_side_effects(self) = true;
+    self->m_side_effects = true;
 
-    self->func     = funcexpr;
-    self->va_count = nullptr;
+    self->m_func     = funcexpr;
+    self->m_va_count = nullptr;
 
-    ast_type_adopt(self, funcexpr->next);
+    ast_type_adopt(self, funcexpr->m_next);
 
     return self;
 }
 
 void ast_call_delete(ast_call *self)
 {
-    for (auto &it : self->params)
+    for (auto &it : self->m_params)
         ast_unref(it);
 
-    if (self->func)
-        ast_unref(self->func);
+    if (self->m_func)
+        ast_unref(self->m_func);
 
-    if (self->va_count)
-        ast_unref(self->va_count);
+    if (self->m_va_count)
+        ast_unref(self->m_va_count);
 
     ast_expression_delete((ast_expression*)self);
     self->~ast_call();
@@ -1021,12 +1018,12 @@ static bool ast_call_check_vararg(ast_call *self, ast_expression *va_type, ast_e
             ast_type_to_string(va_type,  tgot, sizeof(tgot));
             ast_type_to_string(exp_type, texp, sizeof(texp));
             if (OPTS_FLAG(UNSAFE_VARARGS)) {
-                if (compile_warning(ast_ctx(self), WARN_UNSAFE_TYPES,
+                if (compile_warning(self->m_context, WARN_UNSAFE_TYPES,
                                     "piped variadic argument differs in type: constrained to type %s, expected type %s",
                                     tgot, texp))
                     return false;
             } else {
-                compile_error(ast_ctx(self),
+                compile_error(self->m_context,
                               "piped variadic argument differs in type: constrained to type %s, expected type %s",
                               tgot, texp);
                 return false;
@@ -1036,12 +1033,12 @@ static bool ast_call_check_vararg(ast_call *self, ast_expression *va_type, ast_e
         {
             ast_type_to_string(exp_type, texp, sizeof(texp));
             if (OPTS_FLAG(UNSAFE_VARARGS)) {
-                if (compile_warning(ast_ctx(self), WARN_UNSAFE_TYPES,
+                if (compile_warning(self->m_context, WARN_UNSAFE_TYPES,
                                     "piped variadic argument may differ in type: expected type %s",
                                     texp))
                     return false;
             } else {
-                compile_error(ast_ctx(self),
+                compile_error(self->m_context,
                               "piped variadic argument may differ in type: expected type %s",
                               texp);
                 return false;
@@ -1057,48 +1054,48 @@ bool ast_call_check_types(ast_call *self, ast_expression *va_type)
     char tgot[1024];
     size_t i;
     bool retval = true;
-    const ast_expression *func = self->func;
-    size_t count = self->params.size();
-    if (count > func->type_params.size())
-        count = func->type_params.size();
+    const ast_expression *func = self->m_func;
+    size_t count = self->m_params.size();
+    if (count > func->m_type_params.size())
+        count = func->m_type_params.size();
 
     for (i = 0; i < count; ++i) {
-        if (ast_istype(self->params[i], ast_argpipe)) {
+        if (ast_istype(self->m_params[i], ast_argpipe)) {
             /* warn about type safety instead */
             if (i+1 != count) {
-                compile_error(ast_ctx(self), "argpipe must be the last parameter to a function call");
+                compile_error(self->m_context, "argpipe must be the last parameter to a function call");
                 return false;
             }
-            if (!ast_call_check_vararg(self, va_type, (ast_expression*)func->type_params[i]))
+            if (!ast_call_check_vararg(self, va_type, (ast_expression*)func->m_type_params[i]))
                 retval = false;
         }
-        else if (!ast_compare_type(self->params[i], (ast_expression*)(func->type_params[i])))
+        else if (!ast_compare_type(self->m_params[i], (ast_expression*)(func->m_type_params[i])))
         {
-            ast_type_to_string(self->params[i], tgot, sizeof(tgot));
-            ast_type_to_string((ast_expression*)func->type_params[i], texp, sizeof(texp));
-            compile_error(ast_ctx(self), "invalid type for parameter %u in function call: expected %s, got %s",
+            ast_type_to_string(self->m_params[i], tgot, sizeof(tgot));
+            ast_type_to_string((ast_expression*)func->m_type_params[i], texp, sizeof(texp));
+            compile_error(self->m_context, "invalid type for parameter %u in function call: expected %s, got %s",
                      (unsigned int)(i+1), texp, tgot);
             /* we don't immediately return */
             retval = false;
         }
     }
-    count = self->params.size();
-    if (count > func->type_params.size() && func->varparam) {
+    count = self->m_params.size();
+    if (count > func->m_type_params.size() && func->m_varparam) {
         for (; i < count; ++i) {
-            if (ast_istype(self->params[i], ast_argpipe)) {
+            if (ast_istype(self->m_params[i], ast_argpipe)) {
                 /* warn about type safety instead */
                 if (i+1 != count) {
-                    compile_error(ast_ctx(self), "argpipe must be the last parameter to a function call");
+                    compile_error(self->m_context, "argpipe must be the last parameter to a function call");
                     return false;
                 }
-                if (!ast_call_check_vararg(self, va_type, func->varparam))
+                if (!ast_call_check_vararg(self, va_type, func->m_varparam))
                     retval = false;
             }
-            else if (!ast_compare_type(self->params[i], func->varparam))
+            else if (!ast_compare_type(self->m_params[i], func->m_varparam))
             {
-                ast_type_to_string(self->params[i], tgot, sizeof(tgot));
-                ast_type_to_string(func->varparam, texp, sizeof(texp));
-                compile_error(ast_ctx(self), "invalid type for variadic parameter %u in function call: expected %s, got %s",
+                ast_type_to_string(self->m_params[i], tgot, sizeof(tgot));
+                ast_type_to_string(func->m_varparam, texp, sizeof(texp));
+                compile_error(self->m_context, "invalid type for variadic parameter %u in function call: expected %s, got %s",
                          (unsigned int)(i+1), texp, tgot);
                 /* we don't immediately return */
                 retval = false;
@@ -1114,11 +1111,11 @@ ast_store* ast_store_new(lex_ctx_t ctx, int op,
     ast_instantiate(ast_store, ctx, ast_store_delete);
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_store_codegen);
 
-    ast_side_effects(self) = true;
+    self->m_side_effects = true;
 
-    self->op = op;
-    self->dest = dest;
-    self->source = source;
+    self->m_op = op;
+    self->m_dest = dest;
+    self->m_source = source;
 
     ast_type_adopt(self, dest);
 
@@ -1127,8 +1124,8 @@ ast_store* ast_store_new(lex_ctx_t ctx, int op,
 
 void ast_store_delete(ast_store *self)
 {
-    ast_unref(self->dest);
-    ast_unref(self->source);
+    ast_unref(self->m_dest);
+    ast_unref(self->m_source);
     ast_expression_delete((ast_expression*)self);
     self->~ast_store();
     mem_d(self);
@@ -1145,10 +1142,10 @@ ast_block* ast_block_new(lex_ctx_t ctx)
 bool ast_block_add_expr(ast_block *self, ast_expression *e)
 {
     ast_propagate_effects(self, e);
-    self->exprs.push_back(e);
-    if (self->next) {
-        ast_delete(self->next);
-        self->next = nullptr;
+    self->m_exprs.push_back(e);
+    if (self->m_next) {
+        ast_delete(self->m_next);
+        self->m_next = nullptr;
     }
     ast_type_adopt(self, e);
     return true;
@@ -1156,15 +1153,15 @@ bool ast_block_add_expr(ast_block *self, ast_expression *e)
 
 void ast_block_collect(ast_block *self, ast_expression *expr)
 {
-    self->collect.push_back(expr);
-    expr->keep_node = true;
+    self->m_collect.push_back(expr);
+    expr->m_keep_node = true;
 }
 
 void ast_block_delete(ast_block *self)
 {
-    for (auto &it : self->exprs) ast_unref(it);
-    for (auto &it : self->locals) ast_delete(it);
-    for (auto &it : self->collect) ast_delete(it);
+    for (auto &it : self->m_exprs) ast_unref(it);
+    for (auto &it : self->m_locals) ast_delete(it);
+    for (auto &it : self->m_collect) ast_delete(it);
     ast_expression_delete((ast_expression*)self);
     self->~ast_block();
     mem_d(self);
@@ -1172,8 +1169,8 @@ void ast_block_delete(ast_block *self)
 
 void ast_block_set_type(ast_block *self, ast_expression *from)
 {
-    if (self->next)
-        ast_delete(self->next);
+    if (self->m_next)
+        ast_delete(self->m_next);
     ast_type_adopt(self, from);
 }
 
@@ -1182,33 +1179,33 @@ ast_function* ast_function_new(lex_ctx_t ctx, const char *name, ast_value *vtype
     ast_instantiate(ast_function, ctx, ast_function_delete);
 
     if (!vtype) {
-        compile_error(ast_ctx(self), "internal error: ast_function_new condition 0");
+        compile_error(self->m_context, "internal error: ast_function_new condition 0");
         goto cleanup;
-    } else if (vtype->hasvalue || vtype->vtype != TYPE_FUNCTION) {
-        compile_error(ast_ctx(self), "internal error: ast_function_new condition %i %i type=%i (probably 2 bodies?)",
+    } else if (vtype->m_hasvalue || vtype->m_vtype != TYPE_FUNCTION) {
+        compile_error(self->m_context, "internal error: ast_function_new condition %i %i type=%i (probably 2 bodies?)",
                  (int)!vtype,
-                 (int)vtype->hasvalue,
-                 vtype->vtype);
+                 (int)vtype->m_hasvalue,
+                 vtype->m_vtype);
         goto cleanup;
     }
 
-    self->function_type = vtype;
-    self->name          = name ? util_strdup(name) : nullptr;
+    self->m_function_type = vtype;
+    self->m_name          = name ? util_strdup(name) : nullptr;
 
-    self->labelcount = 0;
-    self->builtin = 0;
+    self->m_labelcount = 0;
+    self->m_builtin = 0;
 
-    self->ir_func = nullptr;
-    self->curblock = nullptr;
+    self->m_ir_func = nullptr;
+    self->m_curblock = nullptr;
 
-    vtype->hasvalue = true;
-    vtype->constval.vfunc = self;
+    vtype->m_hasvalue = true;
+    vtype->m_constval.vfunc = self;
 
-    self->varargs          = nullptr;
-    self->argc             = nullptr;
-    self->fixedparams      = nullptr;
-    self->return_value     = nullptr;
-    self->static_count     = 0;
+    self->m_varargs          = nullptr;
+    self->m_argc             = nullptr;
+    self->m_fixedparams      = nullptr;
+    self->m_return_value     = nullptr;
+    self->m_static_count     = 0;
 
     return self;
 
@@ -1219,30 +1216,30 @@ cleanup:
 
 void ast_function_delete(ast_function *self)
 {
-    if (self->name)
-        mem_d((void*)self->name);
-    if (self->function_type) {
-        /* ast_value_delete(self->function_type); */
-        self->function_type->hasvalue = false;
-        self->function_type->constval.vfunc = nullptr;
+    if (self->m_name)
+        mem_d((void*)self->m_name);
+    if (self->m_function_type) {
+        /* ast_value_delete(self->m_function_type); */
+        self->m_function_type->m_hasvalue = false;
+        self->m_function_type->m_constval.vfunc = nullptr;
         /* We use unref - if it was stored in a global table it is supposed
          * to be deleted from *there*
          */
-        ast_unref(self->function_type);
+        ast_unref(self->m_function_type);
     }
-    for (auto &it : self->static_names)
+    for (auto &it : self->m_static_names)
         mem_d(it);
     // FIXME::DELME:: unique_ptr used on ast_block
-    //for (auto &it : self->blocks)
+    //for (auto &it : self->m_blocks)
     //    ast_delete(it);
-    if (self->varargs)
-        ast_delete(self->varargs);
-    if (self->argc)
-        ast_delete(self->argc);
-    if (self->fixedparams)
-        ast_unref(self->fixedparams);
-    if (self->return_value)
-        ast_unref(self->return_value);
+    if (self->m_varargs)
+        ast_delete(self->m_varargs);
+    if (self->m_argc)
+        ast_delete(self->m_argc);
+    if (self->m_fixedparams)
+        ast_unref(self->m_fixedparams);
+    if (self->m_return_value)
+        ast_unref(self->m_return_value);
     self->~ast_function();
     mem_d(self);
 }
@@ -1260,10 +1257,10 @@ const char* ast_function_label(ast_function *self, const char *prefix)
         return nullptr;
     }
 
-    id  = (self->labelcount++);
+    id  = (self->m_labelcount++);
     len = strlen(prefix);
 
-    from = self->labelbuf + sizeof(self->labelbuf)-1;
+    from = self->m_labelbuf + sizeof(self->m_labelbuf)-1;
     *from-- = 0;
     do {
         *from-- = (id%10) + '0';
@@ -1283,10 +1280,10 @@ const char* ast_function_label(ast_function *self, const char *prefix)
 
 static void _ast_codegen_output_type(ast_expression *self, ir_value *out)
 {
-    if (out->vtype == TYPE_FIELD)
-        out->fieldtype = self->next->vtype;
-    if (out->vtype == TYPE_FUNCTION)
-        out->outtype = self->next->vtype;
+    if (out->m_vtype == TYPE_FIELD)
+        out->m_fieldtype = self->m_next->m_vtype;
+    if (out->m_vtype == TYPE_FUNCTION)
+        out->m_outtype = self->m_next->m_vtype;
 }
 
 #define codegen_output_type(a,o) (_ast_codegen_output_type(static_cast<ast_expression*>((a)),(o)))
@@ -1295,8 +1292,8 @@ bool ast_value_codegen(ast_value *self, ast_function *func, bool lvalue, ir_valu
 {
     (void)func;
     (void)lvalue;
-    if (self->vtype == TYPE_NIL) {
-        *out = func->ir_func->owner->nil;
+    if (self->m_vtype == TYPE_NIL) {
+        *out = func->m_ir_func->m_owner->m_nil;
         return true;
     }
     /* NOTE: This is the codegen for a variable used in an 
@@ -1306,67 +1303,67 @@ bool ast_value_codegen(ast_value *self, ast_function *func, bool lvalue, ir_valu
      * and the ast-user should take care of ast_global_codegen to be used
      * on all the globals.
      */
-    if (!self->ir_v) {
+    if (!self->m_ir_v) {
         char tname[1024]; /* typename is reserved in C++ */
         ast_type_to_string((ast_expression*)self, tname, sizeof(tname));
-        compile_error(ast_ctx(self), "ast_value used before generated %s %s", tname, self->name);
+        compile_error(self->m_context, "ast_value used before generated %s %s", tname, self->m_name);
         return false;
     }
-    *out = self->ir_v;
+    *out = self->m_ir_v;
     return true;
 }
 
 static bool ast_global_array_set(ast_value *self)
 {
-    size_t count = self->initlist.size();
+    size_t count = self->m_initlist.size();
     size_t i;
 
-    if (count > self->count) {
-        compile_error(ast_ctx(self), "too many elements in initializer");
-        count = self->count;
+    if (count > self->m_count) {
+        compile_error(self->m_context, "too many elements in initializer");
+        count = self->m_count;
     }
-    else if (count < self->count) {
+    else if (count < self->m_count) {
         /* add this?
-        compile_warning(ast_ctx(self), "not all elements are initialized");
+        compile_warning(self->m_context, "not all elements are initialized");
         */
     }
 
     for (i = 0; i != count; ++i) {
-        switch (self->next->vtype) {
+        switch (self->m_next->m_vtype) {
             case TYPE_FLOAT:
-                if (!ir_value_set_float(self->ir_values[i], self->initlist[i].vfloat))
+                if (!ir_value_set_float(self->m_ir_values[i], self->m_initlist[i].vfloat))
                     return false;
                 break;
             case TYPE_VECTOR:
-                if (!ir_value_set_vector(self->ir_values[i], self->initlist[i].vvec))
+                if (!ir_value_set_vector(self->m_ir_values[i], self->m_initlist[i].vvec))
                     return false;
                 break;
             case TYPE_STRING:
-                if (!ir_value_set_string(self->ir_values[i], self->initlist[i].vstring))
+                if (!ir_value_set_string(self->m_ir_values[i], self->m_initlist[i].vstring))
                     return false;
                 break;
             case TYPE_ARRAY:
                 /* we don't support them in any other place yet either */
-                compile_error(ast_ctx(self), "TODO: nested arrays");
+                compile_error(self->m_context, "TODO: nested arrays");
                 return false;
             case TYPE_FUNCTION:
                 /* this requiers a bit more work - similar to the fields I suppose */
-                compile_error(ast_ctx(self), "global of type function not properly generated");
+                compile_error(self->m_context, "global of type function not properly generated");
                 return false;
             case TYPE_FIELD:
-                if (!self->initlist[i].vfield) {
-                    compile_error(ast_ctx(self), "field constant without vfield set");
+                if (!self->m_initlist[i].vfield) {
+                    compile_error(self->m_context, "field constant without vfield set");
                     return false;
                 }
-                if (!self->initlist[i].vfield->ir_v) {
-                    compile_error(ast_ctx(self), "field constant generated before its field");
+                if (!self->m_initlist[i].vfield->m_ir_v) {
+                    compile_error(self->m_context, "field constant generated before its field");
                     return false;
                 }
-                if (!ir_value_set_field(self->ir_values[i], self->initlist[i].vfield->ir_v))
+                if (!ir_value_set_field(self->m_ir_values[i], self->m_initlist[i].vfield->m_ir_v))
                     return false;
                 break;
             default:
-                compile_error(ast_ctx(self), "TODO: global constant type %i", self->vtype);
+                compile_error(self->m_context, "TODO: global constant type %i", self->m_vtype);
                 break;
         }
     }
@@ -1375,13 +1372,13 @@ static bool ast_global_array_set(ast_value *self)
 
 static bool check_array(ast_value *self, ast_value *array)
 {
-    if (array->flags & AST_FLAG_ARRAY_INIT && array->initlist.empty()) {
-        compile_error(ast_ctx(self), "array without size: %s", self->name);
+    if (array->m_flags & AST_FLAG_ARRAY_INIT && array->m_initlist.empty()) {
+        compile_error(self->m_context, "array without size: %s", self->m_name);
         return false;
     }
     /* we are lame now - considering the way QC works we won't tolerate arrays > 1024 elements */
-    if (!array->count || array->count > OPTS_OPTION_U32(OPTION_MAX_ARRAY_SIZE)) {
-        compile_error(ast_ctx(self), "Invalid array of size %lu", (unsigned long)array->count);
+    if (!array->m_count || array->m_count > OPTS_OPTION_U32(OPTION_MAX_ARRAY_SIZE)) {
+        compile_error(self->m_context, "Invalid array of size %lu", (unsigned long)array->m_count);
         return false;
     }
     return true;
@@ -1391,40 +1388,40 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir, bool isfield)
 {
     ir_value *v = nullptr;
 
-    if (self->vtype == TYPE_NIL) {
-        compile_error(ast_ctx(self), "internal error: trying to generate a variable of TYPE_NIL");
+    if (self->m_vtype == TYPE_NIL) {
+        compile_error(self->m_context, "internal error: trying to generate a variable of TYPE_NIL");
         return false;
     }
 
-    if (self->hasvalue && self->vtype == TYPE_FUNCTION)
+    if (self->m_hasvalue && self->m_vtype == TYPE_FUNCTION)
     {
-        ir_function *func = ir_builder_create_function(ir, self->name, self->next->vtype);
+        ir_function *func = ir_builder_create_function(ir, self->m_name, self->m_next->m_vtype);
         if (!func)
             return false;
-        func->context = ast_ctx(self);
-        func->value->context = ast_ctx(self);
-
-        self->constval.vfunc->ir_func = func;
-        self->ir_v = func->value;
-        if (self->flags & AST_FLAG_INCLUDE_DEF)
-            self->ir_v->flags |= IR_FLAG_INCLUDE_DEF;
-        if (self->flags & AST_FLAG_ERASEABLE)
-            self->ir_v->flags |= IR_FLAG_ERASABLE;
-        if (self->flags & AST_FLAG_BLOCK_COVERAGE)
-            func->flags |= IR_FLAG_BLOCK_COVERAGE;
+        func->m_context = self->m_context;
+        func->m_value->m_context = self->m_context;
+
+        self->m_constval.vfunc->m_ir_func = func;
+        self->m_ir_v = func->m_value;
+        if (self->m_flags & AST_FLAG_INCLUDE_DEF)
+            self->m_ir_v->m_flags |= IR_FLAG_INCLUDE_DEF;
+        if (self->m_flags & AST_FLAG_ERASEABLE)
+            self->m_ir_v->m_flags |= IR_FLAG_ERASABLE;
+        if (self->m_flags & AST_FLAG_BLOCK_COVERAGE)
+            func->m_flags |= IR_FLAG_BLOCK_COVERAGE;
         /* The function is filled later on ast_function_codegen... */
         return true;
     }
 
-    if (isfield && self->vtype == TYPE_FIELD) {
-        ast_expression *fieldtype = self->next;
+    if (isfield && self->m_vtype == TYPE_FIELD) {
+        ast_expression *fieldtype = self->m_next;
 
-        if (self->hasvalue) {
-            compile_error(ast_ctx(self), "TODO: constant field pointers with value");
+        if (self->m_hasvalue) {
+            compile_error(self->m_context, "TODO: constant field pointers with value");
             goto error;
         }
 
-        if (fieldtype->vtype == TYPE_ARRAY) {
+        if (fieldtype->m_vtype == TYPE_ARRAY) {
             size_t ai;
             char   *name;
             size_t  namelen;
@@ -1434,79 +1431,79 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir, bool isfield)
             ast_value      *array = (ast_value*)fieldtype;
 
             if (!ast_istype(fieldtype, ast_value)) {
-                compile_error(ast_ctx(self), "internal error: ast_value required");
+                compile_error(self->m_context, "internal error: ast_value required");
                 return false;
             }
 
             if (!check_array(self, array))
                 return false;
 
-            elemtype = array->next;
-            vtype = elemtype->vtype;
+            elemtype = array->m_next;
+            vtype = elemtype->m_vtype;
 
-            v = ir_builder_create_field(ir, self->name, vtype);
+            v = ir_builder_create_field(ir, self->m_name, vtype);
             if (!v) {
-                compile_error(ast_ctx(self), "ir_builder_create_global failed on `%s`", self->name);
+                compile_error(self->m_context, "ir_builder_create_global failed on `%s`", self->m_name);
                 return false;
             }
-            v->context = ast_ctx(self);
-            v->unique_life = true;
-            v->locked      = true;
-            array->ir_v = self->ir_v = v;
+            v->m_context = self->m_context;
+            v->m_unique_life = true;
+            v->m_locked      = true;
+            array->m_ir_v = self->m_ir_v = v;
 
-            if (self->flags & AST_FLAG_INCLUDE_DEF)
-                self->ir_v->flags |= IR_FLAG_INCLUDE_DEF;
-            if (self->flags & AST_FLAG_ERASEABLE)
-                self->ir_v->flags |= IR_FLAG_ERASABLE;
+            if (self->m_flags & AST_FLAG_INCLUDE_DEF)
+                self->m_ir_v->m_flags |= IR_FLAG_INCLUDE_DEF;
+            if (self->m_flags & AST_FLAG_ERASEABLE)
+                self->m_ir_v->m_flags |= IR_FLAG_ERASABLE;
 
-            namelen = strlen(self->name);
+            namelen = strlen(self->m_name);
             name    = (char*)mem_a(namelen + 16);
-            util_strncpy(name, self->name, namelen);
+            util_strncpy(name, self->m_name, namelen);
 
-            array->ir_values = (ir_value**)mem_a(sizeof(array->ir_values[0]) * array->count);
-            array->ir_values[0] = v;
-            for (ai = 1; ai < array->count; ++ai) {
+            array->m_ir_values = (ir_value**)mem_a(sizeof(array->m_ir_values[0]) * array->m_count);
+            array->m_ir_values[0] = v;
+            for (ai = 1; ai < array->m_count; ++ai) {
                 util_snprintf(name + namelen, 16, "[%u]", (unsigned int)ai);
-                array->ir_values[ai] = ir_builder_create_field(ir, name, vtype);
-                if (!array->ir_values[ai]) {
+                array->m_ir_values[ai] = ir_builder_create_field(ir, name, vtype);
+                if (!array->m_ir_values[ai]) {
                     mem_d(name);
-                    compile_error(ast_ctx(self), "ir_builder_create_global failed on `%s`", name);
+                    compile_error(self->m_context, "ir_builder_create_global failed on `%s`", name);
                     return false;
                 }
-                array->ir_values[ai]->context = ast_ctx(self);
-                array->ir_values[ai]->unique_life = true;
-                array->ir_values[ai]->locked      = true;
-                if (self->flags & AST_FLAG_INCLUDE_DEF)
-                    self->ir_values[ai]->flags |= IR_FLAG_INCLUDE_DEF;
+                array->m_ir_values[ai]->m_context = self->m_context;
+                array->m_ir_values[ai]->m_unique_life = true;
+                array->m_ir_values[ai]->m_locked      = true;
+                if (self->m_flags & AST_FLAG_INCLUDE_DEF)
+                    self->m_ir_values[ai]->m_flags |= IR_FLAG_INCLUDE_DEF;
             }
             mem_d(name);
         }
         else
         {
-            v = ir_builder_create_field(ir, self->name, self->next->vtype);
+            v = ir_builder_create_field(ir, self->m_name, self->m_next->m_vtype);
             if (!v)
                 return false;
-            v->context = ast_ctx(self);
-            self->ir_v = v;
-            if (self->flags & AST_FLAG_INCLUDE_DEF)
-                self->ir_v->flags |= IR_FLAG_INCLUDE_DEF;
+            v->m_context = self->m_context;
+            self->m_ir_v = v;
+            if (self->m_flags & AST_FLAG_INCLUDE_DEF)
+                self->m_ir_v->m_flags |= IR_FLAG_INCLUDE_DEF;
 
-            if (self->flags & AST_FLAG_ERASEABLE)
-                self->ir_v->flags |= IR_FLAG_ERASABLE;
+            if (self->m_flags & AST_FLAG_ERASEABLE)
+                self->m_ir_v->m_flags |= IR_FLAG_ERASABLE;
         }
         return true;
     }
 
-    if (self->vtype == TYPE_ARRAY) {
+    if (self->m_vtype == TYPE_ARRAY) {
         size_t ai;
         char   *name;
         size_t  namelen;
 
-        ast_expression *elemtype = self->next;
-        qc_type vtype = elemtype->vtype;
+        ast_expression *elemtype = self->m_next;
+        qc_type vtype = elemtype->m_vtype;
 
-        if (self->flags & AST_FLAG_ARRAY_INIT && !self->count) {
-            compile_error(ast_ctx(self), "array `%s' has no size", self->name);
+        if (self->m_flags & AST_FLAG_ARRAY_INIT && !self->m_count) {
+            compile_error(self->m_context, "array `%s' has no size", self->m_name);
             return false;
         }
 
@@ -1514,39 +1511,39 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir, bool isfield)
         if (!check_array(self, self))
             return false;
 
-        v = ir_builder_create_global(ir, self->name, vtype);
+        v = ir_builder_create_global(ir, self->m_name, vtype);
         if (!v) {
-            compile_error(ast_ctx(self), "ir_builder_create_global failed `%s`", self->name);
+            compile_error(self->m_context, "ir_builder_create_global failed `%s`", self->m_name);
             return false;
         }
-        v->context = ast_ctx(self);
-        v->unique_life = true;
-        v->locked      = true;
+        v->m_context = self->m_context;
+        v->m_unique_life = true;
+        v->m_locked      = true;
 
-        if (self->flags & AST_FLAG_INCLUDE_DEF)
-            v->flags |= IR_FLAG_INCLUDE_DEF;
-        if (self->flags & AST_FLAG_ERASEABLE)
-            self->ir_v->flags |= IR_FLAG_ERASABLE;
+        if (self->m_flags & AST_FLAG_INCLUDE_DEF)
+            v->m_flags |= IR_FLAG_INCLUDE_DEF;
+        if (self->m_flags & AST_FLAG_ERASEABLE)
+            self->m_ir_v->m_flags |= IR_FLAG_ERASABLE;
 
-        namelen = strlen(self->name);
+        namelen = strlen(self->m_name);
         name    = (char*)mem_a(namelen + 16);
-        util_strncpy(name, self->name, namelen);
+        util_strncpy(name, self->m_name, namelen);
 
-        self->ir_values = (ir_value**)mem_a(sizeof(self->ir_values[0]) * self->count);
-        self->ir_values[0] = v;
-        for (ai = 1; ai < self->count; ++ai) {
+        self->m_ir_values = (ir_value**)mem_a(sizeof(self->m_ir_values[0]) * self->m_count);
+        self->m_ir_values[0] = v;
+        for (ai = 1; ai < self->m_count; ++ai) {
             util_snprintf(name + namelen, 16, "[%u]", (unsigned int)ai);
-            self->ir_values[ai] = ir_builder_create_global(ir, name, vtype);
-            if (!self->ir_values[ai]) {
+            self->m_ir_values[ai] = ir_builder_create_global(ir, name, vtype);
+            if (!self->m_ir_values[ai]) {
                 mem_d(name);
-                compile_error(ast_ctx(self), "ir_builder_create_global failed `%s`", name);
+                compile_error(self->m_context, "ir_builder_create_global failed `%s`", name);
                 return false;
             }
-            self->ir_values[ai]->context = ast_ctx(self);
-            self->ir_values[ai]->unique_life = true;
-            self->ir_values[ai]->locked      = true;
-            if (self->flags & AST_FLAG_INCLUDE_DEF)
-                self->ir_values[ai]->flags |= IR_FLAG_INCLUDE_DEF;
+            self->m_ir_values[ai]->m_context = self->m_context;
+            self->m_ir_values[ai]->m_unique_life = true;
+            self->m_ir_values[ai]->m_locked      = true;
+            if (self->m_flags & AST_FLAG_INCLUDE_DEF)
+                self->m_ir_values[ai]->m_flags |= IR_FLAG_INCLUDE_DEF;
         }
         mem_d(name);
     }
@@ -1555,63 +1552,63 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir, bool isfield)
         /* Arrays don't do this since there's no "array" value which spans across the
          * whole thing.
          */
-        v = ir_builder_create_global(ir, self->name, self->vtype);
+        v = ir_builder_create_global(ir, self->m_name, self->m_vtype);
         if (!v) {
-            compile_error(ast_ctx(self), "ir_builder_create_global failed on `%s`", self->name);
+            compile_error(self->m_context, "ir_builder_create_global failed on `%s`", self->m_name);
             return false;
         }
         codegen_output_type(self, v);
-        v->context = ast_ctx(self);
+        v->m_context = self->m_context;
     }
 
     /* link us to the ir_value */
-    v->cvq = self->cvq;
-    self->ir_v = v;
+    v->m_cvq = self->m_cvq;
+    self->m_ir_v = v;
 
-    if (self->flags & AST_FLAG_INCLUDE_DEF)
-        self->ir_v->flags |= IR_FLAG_INCLUDE_DEF;
-    if (self->flags & AST_FLAG_ERASEABLE)
-        self->ir_v->flags |= IR_FLAG_ERASABLE;
+    if (self->m_flags & AST_FLAG_INCLUDE_DEF)
+        self->m_ir_v->m_flags |= IR_FLAG_INCLUDE_DEF;
+    if (self->m_flags & AST_FLAG_ERASEABLE)
+        self->m_ir_v->m_flags |= IR_FLAG_ERASABLE;
 
     /* initialize */
-    if (self->hasvalue) {
-        switch (self->vtype)
+    if (self->m_hasvalue) {
+        switch (self->m_vtype)
         {
             case TYPE_FLOAT:
-                if (!ir_value_set_float(v, self->constval.vfloat))
+                if (!ir_value_set_float(v, self->m_constval.vfloat))
                     goto error;
                 break;
             case TYPE_VECTOR:
-                if (!ir_value_set_vector(v, self->constval.vvec))
+                if (!ir_value_set_vector(v, self->m_constval.vvec))
                     goto error;
                 break;
             case TYPE_STRING:
-                if (!ir_value_set_string(v, self->constval.vstring))
+                if (!ir_value_set_string(v, self->m_constval.vstring))
                     goto error;
                 break;
             case TYPE_ARRAY:
                 ast_global_array_set(self);
                 break;
             case TYPE_FUNCTION:
-                compile_error(ast_ctx(self), "global of type function not properly generated");
+                compile_error(self->m_context, "global of type function not properly generated");
                 goto error;
                 /* Cannot generate an IR value for a function,
                  * need a pointer pointing to a function rather.
                  */
             case TYPE_FIELD:
-                if (!self->constval.vfield) {
-                    compile_error(ast_ctx(self), "field constant without vfield set");
+                if (!self->m_constval.vfield) {
+                    compile_error(self->m_context, "field constant without vfield set");
                     goto error;
                 }
-                if (!self->constval.vfield->ir_v) {
-                    compile_error(ast_ctx(self), "field constant generated before its field");
+                if (!self->m_constval.vfield->m_ir_v) {
+                    compile_error(self->m_context, "field constant generated before its field");
                     goto error;
                 }
-                if (!ir_value_set_field(v, self->constval.vfield->ir_v))
+                if (!ir_value_set_field(v, self->m_constval.vfield->m_ir_v))
                     goto error;
                 break;
             default:
-                compile_error(ast_ctx(self), "TODO: global constant type %i", self->vtype);
+                compile_error(self->m_context, "TODO: global constant type %i", self->m_vtype);
                 break;
         }
     }
@@ -1626,12 +1623,12 @@ static bool ast_local_codegen(ast_value *self, ir_function *func, bool param)
 {
     ir_value *v = nullptr;
 
-    if (self->vtype == TYPE_NIL) {
-        compile_error(ast_ctx(self), "internal error: trying to generate a variable of TYPE_NIL");
+    if (self->m_vtype == TYPE_NIL) {
+        compile_error(self->m_context, "internal error: trying to generate a variable of TYPE_NIL");
         return false;
     }
 
-    if (self->hasvalue && self->vtype == TYPE_FUNCTION)
+    if (self->m_hasvalue && self->m_vtype == TYPE_FUNCTION)
     {
         /* Do we allow local functions? I think not...
          * this is NOT a function pointer atm.
@@ -1639,18 +1636,18 @@ static bool ast_local_codegen(ast_value *self, ir_function *func, bool param)
         return false;
     }
 
-    if (self->vtype == TYPE_ARRAY) {
+    if (self->m_vtype == TYPE_ARRAY) {
         size_t ai;
         char   *name;
         size_t  namelen;
 
-        ast_expression *elemtype = self->next;
-        qc_type vtype = elemtype->vtype;
+        ast_expression *elemtype = self->m_next;
+        qc_type vtype = elemtype->m_vtype;
 
-        func->flags |= IR_FLAG_HAS_ARRAYS;
+        func->m_flags |= IR_FLAG_HAS_ARRAYS;
 
-        if (param && !(self->flags & AST_FLAG_IS_VARARG)) {
-            compile_error(ast_ctx(self), "array-parameters are not supported");
+        if (param && !(self->m_flags & AST_FLAG_IS_VARARG)) {
+            compile_error(self->m_context, "array-parameters are not supported");
             return false;
         }
 
@@ -1658,77 +1655,77 @@ static bool ast_local_codegen(ast_value *self, ir_function *func, bool param)
         if (!check_array(self, self))
             return false;
 
-        self->ir_values = (ir_value**)mem_a(sizeof(self->ir_values[0]) * self->count);
-        if (!self->ir_values) {
-            compile_error(ast_ctx(self), "failed to allocate array values");
+        self->m_ir_values = (ir_value**)mem_a(sizeof(self->m_ir_values[0]) * self->m_count);
+        if (!self->m_ir_values) {
+            compile_error(self->m_context, "failed to allocate array values");
             return false;
         }
 
-        v = ir_function_create_local(func, self->name, vtype, param);
+        v = ir_function_create_local(func, self->m_name, vtype, param);
         if (!v) {
-            compile_error(ast_ctx(self), "internal error: ir_function_create_local failed");
+            compile_error(self->m_context, "internal error: ir_function_create_local failed");
             return false;
         }
-        v->context = ast_ctx(self);
-        v->unique_life = true;
-        v->locked      = true;
+        v->m_context = self->m_context;
+        v->m_unique_life = true;
+        v->m_locked      = true;
 
-        namelen = strlen(self->name);
+        namelen = strlen(self->m_name);
         name    = (char*)mem_a(namelen + 16);
-        util_strncpy(name, self->name, namelen);
+        util_strncpy(name, self->m_name, namelen);
 
-        self->ir_values[0] = v;
-        for (ai = 1; ai < self->count; ++ai) {
+        self->m_ir_values[0] = v;
+        for (ai = 1; ai < self->m_count; ++ai) {
             util_snprintf(name + namelen, 16, "[%u]", (unsigned int)ai);
-            self->ir_values[ai] = ir_function_create_local(func, name, vtype, param);
-            if (!self->ir_values[ai]) {
-                compile_error(ast_ctx(self), "internal_error: ir_builder_create_global failed on `%s`", name);
+            self->m_ir_values[ai] = ir_function_create_local(func, name, vtype, param);
+            if (!self->m_ir_values[ai]) {
+                compile_error(self->m_context, "internal_error: ir_builder_create_global failed on `%s`", name);
                 return false;
             }
-            self->ir_values[ai]->context = ast_ctx(self);
-            self->ir_values[ai]->unique_life = true;
-            self->ir_values[ai]->locked      = true;
+            self->m_ir_values[ai]->m_context = self->m_context;
+            self->m_ir_values[ai]->m_unique_life = true;
+            self->m_ir_values[ai]->m_locked      = true;
         }
         mem_d(name);
     }
     else
     {
-        v = ir_function_create_local(func, self->name, self->vtype, param);
+        v = ir_function_create_local(func, self->m_name, self->m_vtype, param);
         if (!v)
             return false;
         codegen_output_type(self, v);
-        v->context = ast_ctx(self);
+        v->m_context = self->m_context;
     }
 
     /* A constant local... hmmm...
      * I suppose the IR will have to deal with this
      */
-    if (self->hasvalue) {
-        switch (self->vtype)
+    if (self->m_hasvalue) {
+        switch (self->m_vtype)
         {
             case TYPE_FLOAT:
-                if (!ir_value_set_float(v, self->constval.vfloat))
+                if (!ir_value_set_float(v, self->m_constval.vfloat))
                     goto error;
                 break;
             case TYPE_VECTOR:
-                if (!ir_value_set_vector(v, self->constval.vvec))
+                if (!ir_value_set_vector(v, self->m_constval.vvec))
                     goto error;
                 break;
             case TYPE_STRING:
-                if (!ir_value_set_string(v, self->constval.vstring))
+                if (!ir_value_set_string(v, self->m_constval.vstring))
                     goto error;
                 break;
             default:
-                compile_error(ast_ctx(self), "TODO: global constant type %i", self->vtype);
+                compile_error(self->m_context, "TODO: global constant type %i", self->m_vtype);
                 break;
         }
     }
 
     /* link us to the ir_value */
-    v->cvq = self->cvq;
-    self->ir_v = v;
+    v->m_cvq = self->m_cvq;
+    self->m_ir_v = v;
 
-    if (!ast_generate_accessors(self, func->owner))
+    if (!ast_generate_accessors(self, func->m_owner))
         return false;
     return true;
 
@@ -1741,46 +1738,46 @@ bool ast_generate_accessors(ast_value *self, ir_builder *ir)
 {
     size_t i;
     bool warn = OPTS_WARN(WARN_USED_UNINITIALIZED);
-    if (!self->setter || !self->getter)
+    if (!self->m_setter || !self->m_getter)
         return true;
-    for (i = 0; i < self->count; ++i) {
-        if (!self->ir_values) {
-            compile_error(ast_ctx(self), "internal error: no array values generated for `%s`", self->name);
+    for (i = 0; i < self->m_count; ++i) {
+        if (!self->m_ir_values) {
+            compile_error(self->m_context, "internal error: no array values generated for `%s`", self->m_name);
             return false;
         }
-        if (!self->ir_values[i]) {
-            compile_error(ast_ctx(self), "internal error: not all array values have been generated for `%s`", self->name);
+        if (!self->m_ir_values[i]) {
+            compile_error(self->m_context, "internal error: not all array values have been generated for `%s`", self->m_name);
             return false;
         }
-        if (!self->ir_values[i]->life.empty()) {
-            compile_error(ast_ctx(self), "internal error: function containing `%s` already generated", self->name);
+        if (!self->m_ir_values[i]->m_life.empty()) {
+            compile_error(self->m_context, "internal error: function containing `%s` already generated", self->m_name);
             return false;
         }
     }
 
     opts_set(opts.warn, WARN_USED_UNINITIALIZED, false);
-    if (self->setter) {
-        if (!ast_global_codegen  (self->setter, ir, false) ||
-            !ast_function_codegen(self->setter->constval.vfunc, ir) ||
-            !ir_function_finalize(self->setter->constval.vfunc->ir_func))
+    if (self->m_setter) {
+        if (!ast_global_codegen  (self->m_setter, ir, false) ||
+            !ast_function_codegen(self->m_setter->m_constval.vfunc, ir) ||
+            !ir_function_finalize(self->m_setter->m_constval.vfunc->m_ir_func))
         {
-            compile_error(ast_ctx(self), "internal error: failed to generate setter for `%s`", self->name);
+            compile_error(self->m_context, "internal error: failed to generate setter for `%s`", self->m_name);
             opts_set(opts.warn, WARN_USED_UNINITIALIZED, warn);
             return false;
         }
     }
-    if (self->getter) {
-        if (!ast_global_codegen  (self->getter, ir, false) ||
-            !ast_function_codegen(self->getter->constval.vfunc, ir) ||
-            !ir_function_finalize(self->getter->constval.vfunc->ir_func))
+    if (self->m_getter) {
+        if (!ast_global_codegen  (self->m_getter, ir, false) ||
+            !ast_function_codegen(self->m_getter->m_constval.vfunc, ir) ||
+            !ir_function_finalize(self->m_getter->m_constval.vfunc->m_ir_func))
         {
-            compile_error(ast_ctx(self), "internal error: failed to generate getter for `%s`", self->name);
+            compile_error(self->m_context, "internal error: failed to generate getter for `%s`", self->m_name);
             opts_set(opts.warn, WARN_USED_UNINITIALIZED, warn);
             return false;
         }
     }
-    for (i = 0; i < self->count; ++i)
-        self->ir_values[i]->life.clear();
+    for (i = 0; i < self->m_count; ++i)
+        self->m_ir_values[i]->m_life.clear();
     opts_set(opts.warn, WARN_USED_UNINITIALIZED, warn);
     return true;
 }
@@ -1794,106 +1791,106 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir)
 
     (void)ir;
 
-    irf = self->ir_func;
+    irf = self->m_ir_func;
     if (!irf) {
-        compile_error(ast_ctx(self), "internal error: ast_function's related ast_value was not generated yet");
+        compile_error(self->m_context, "internal error: ast_function's related ast_value was not generated yet");
         return false;
     }
 
     /* fill the parameter list */
-    ec = self->function_type;
-    for (auto &it : ec->type_params) {
-        if (it->vtype == TYPE_FIELD)
-            vec_push(irf->params, it->next->vtype);
+    ec = self->m_function_type;
+    for (auto &it : ec->m_type_params) {
+        if (it->m_vtype == TYPE_FIELD)
+            vec_push(irf->m_params, it->m_next->m_vtype);
         else
-            vec_push(irf->params, it->vtype);
-        if (!self->builtin) {
-            if (!ast_local_codegen(it, self->ir_func, true))
+            vec_push(irf->m_params, it->m_vtype);
+        if (!self->m_builtin) {
+            if (!ast_local_codegen(it, self->m_ir_func, true))
                 return false;
         }
     }
 
-    if (self->varargs) {
-        if (!ast_local_codegen(self->varargs, self->ir_func, true))
+    if (self->m_varargs) {
+        if (!ast_local_codegen(self->m_varargs, self->m_ir_func, true))
             return false;
-        irf->max_varargs = self->varargs->count;
+        irf->m_max_varargs = self->m_varargs->m_count;
     }
 
-    if (self->builtin) {
-        irf->builtin = self->builtin;
+    if (self->m_builtin) {
+        irf->m_builtin = self->m_builtin;
         return true;
     }
 
     /* have a local return value variable? */
-    if (self->return_value) {
-        if (!ast_local_codegen(self->return_value, self->ir_func, false))
+    if (self->m_return_value) {
+        if (!ast_local_codegen(self->m_return_value, self->m_ir_func, false))
             return false;
     }
 
-    if (self->blocks.empty()) {
-        compile_error(ast_ctx(self), "function `%s` has no body", self->name);
+    if (self->m_blocks.empty()) {
+        compile_error(self->m_context, "function `%s` has no body", self->m_name);
         return false;
     }
 
-    irf->first = self->curblock = ir_function_create_block(ast_ctx(self), irf, "entry");
-    if (!self->curblock) {
-        compile_error(ast_ctx(self), "failed to allocate entry block for `%s`", self->name);
+    irf->m_first = self->m_curblock = ir_function_create_block(self->m_context, irf, "entry");
+    if (!self->m_curblock) {
+        compile_error(self->m_context, "failed to allocate entry block for `%s`", self->m_name);
         return false;
     }
 
-    if (self->argc) {
+    if (self->m_argc) {
         ir_value *va_count;
         ir_value *fixed;
         ir_value *sub;
-        if (!ast_local_codegen(self->argc, self->ir_func, true))
+        if (!ast_local_codegen(self->m_argc, self->m_ir_func, true))
             return false;
-        cgen = self->argc->codegen;
-        if (!(*cgen)((ast_expression*)(self->argc), self, false, &va_count))
+        cgen = self->m_argc->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_argc), self, false, &va_count))
             return false;
-        cgen = self->fixedparams->codegen;
-        if (!(*cgen)((ast_expression*)(self->fixedparams), self, false, &fixed))
+        cgen = self->m_fixedparams->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_fixedparams), self, false, &fixed))
             return false;
-        sub = ir_block_create_binop(self->curblock, ast_ctx(self),
+        sub = ir_block_create_binop(self->m_curblock, self->m_context,
                                     ast_function_label(self, "va_count"), INSTR_SUB_F,
                                     ir_builder_get_va_count(ir), fixed);
         if (!sub)
             return false;
-        if (!ir_block_create_store_op(self->curblock, ast_ctx(self), INSTR_STORE_F,
+        if (!ir_block_create_store_op(self->m_curblock, self->m_context, INSTR_STORE_F,
                                       va_count, sub))
         {
             return false;
         }
     }
 
-    for (auto &it : self->blocks) {
-        cgen = it->codegen;
+    for (auto &it : self->m_blocks) {
+        cgen = it->m_codegen;
         if (!(*cgen)(it.get(), self, false, &dummy))
             return false;
     }
 
     /* TODO: check return types */
-    if (!self->curblock->final)
+    if (!self->m_curblock->m_final)
     {
-        if (!self->function_type->next ||
-            self->function_type->next->vtype == TYPE_VOID)
+        if (!self->m_function_type->m_next ||
+            self->m_function_type->m_next->m_vtype == TYPE_VOID)
         {
-            return ir_block_create_return(self->curblock, ast_ctx(self), nullptr);
+            return ir_block_create_return(self->m_curblock, self->m_context, nullptr);
         }
-        else if (vec_size(self->curblock->entries) || self->curblock == irf->first)
+        else if (vec_size(self->m_curblock->m_entries) || self->m_curblock == irf->m_first)
         {
-            if (self->return_value) {
-                cgen = self->return_value->codegen;
-                if (!(*cgen)((ast_expression*)(self->return_value), self, false, &dummy))
+            if (self->m_return_value) {
+                cgen = self->m_return_value->m_codegen;
+                if (!(*cgen)((ast_expression*)(self->m_return_value), self, false, &dummy))
                     return false;
-                return ir_block_create_return(self->curblock, ast_ctx(self), dummy);
+                return ir_block_create_return(self->m_curblock, self->m_context, dummy);
             }
-            else if (compile_warning(ast_ctx(self), WARN_MISSING_RETURN_VALUES,
+            else if (compile_warning(self->m_context, WARN_MISSING_RETURN_VALUES,
                                 "control reaches end of non-void function (`%s`) via %s",
-                                self->name, self->curblock->label.c_str()))
+                                self->m_name, self->m_curblock->m_label.c_str()))
             {
                 return false;
             }
-            return ir_block_create_return(self->curblock, ast_ctx(self), nullptr);
+            return ir_block_create_return(self->m_curblock, self->m_context, nullptr);
         }
     }
     return true;
@@ -1903,7 +1900,7 @@ static bool starts_a_label(ast_expression *ex)
 {
     while (ex && ast_istype(ex, ast_block)) {
         ast_block *b = (ast_block*)ex;
-        ex = b->exprs[0];
+        ex = b->m_exprs[0];
     }
     if (!ex)
         return false;
@@ -1923,12 +1920,12 @@ bool ast_block_codegen(ast_block *self, ast_function *func, bool lvalue, ir_valu
      * of the form: (a, b, c) = x should not assign to c...
      */
     if (lvalue) {
-        compile_error(ast_ctx(self), "not an l-value (code-block)");
+        compile_error(self->m_context, "not an l-value (code-block)");
         return false;
     }
 
-    if (self->outr) {
-        *out = self->outr;
+    if (self->m_outr) {
+        *out = self->m_outr;
         return true;
     }
 
@@ -1941,27 +1938,27 @@ bool ast_block_codegen(ast_block *self, ast_function *func, bool lvalue, ir_valu
     *out = nullptr;
 
     /* generate locals */
-    for (auto &it : self->locals) {
-        if (!ast_local_codegen(it, func->ir_func, false)) {
+    for (auto &it : self->m_locals) {
+        if (!ast_local_codegen(it, func->m_ir_func, false)) {
             if (OPTS_OPTION_BOOL(OPTION_DEBUG))
-                compile_error(ast_ctx(self), "failed to generate local `%s`", it->name);
+                compile_error(self->m_context, "failed to generate local `%s`", it->m_name);
             return false;
         }
     }
 
-    for (auto &it : self->exprs) {
+    for (auto &it : self->m_exprs) {
         ast_expression_codegen *gen;
-        if (func->curblock->final && !starts_a_label(it)) {
-            if (compile_warning(ast_ctx(it), WARN_UNREACHABLE_CODE, "unreachable statement"))
+        if (func->m_curblock->m_final && !starts_a_label(it)) {
+            if (compile_warning(it->m_context, WARN_UNREACHABLE_CODE, "unreachable statement"))
                 return false;
             continue;
         }
-        gen = it->codegen;
+        gen = it->m_codegen;
         if (!(*gen)(it, func, false, out))
             return false;
     }
 
-    self->outr = *out;
+    self->m_outr = *out;
 
     return true;
 }
@@ -1976,23 +1973,23 @@ bool ast_store_codegen(ast_store *self, ast_function *func, bool lvalue, ir_valu
     ast_value       *idx = 0;
     ast_array_index *ai = nullptr;
 
-    if (lvalue && self->outl) {
-        *out = self->outl;
+    if (lvalue && self->m_outl) {
+        *out = self->m_outl;
         return true;
     }
 
-    if (!lvalue && self->outr) {
-        *out = self->outr;
+    if (!lvalue && self->m_outr) {
+        *out = self->m_outr;
         return true;
     }
 
-    if (ast_istype(self->dest, ast_array_index))
+    if (ast_istype(self->m_dest, ast_array_index))
     {
 
-        ai = (ast_array_index*)self->dest;
-        idx = (ast_value*)ai->index;
+        ai = (ast_array_index*)self->m_dest;
+        idx = (ast_value*)ai->m_index;
 
-        if (ast_istype(ai->index, ast_value) && idx->hasvalue && idx->cvq == CV_CONST)
+        if (ast_istype(ai->m_index, ast_value) && idx->m_hasvalue && idx->m_cvq == CV_CONST)
             ai = nullptr;
     }
 
@@ -2002,53 +1999,53 @@ bool ast_store_codegen(ast_store *self, ast_function *func, bool lvalue, ir_valu
         ir_instr  *call;
 
         if (lvalue) {
-            compile_error(ast_ctx(self), "array-subscript assignment cannot produce lvalues");
+            compile_error(self->m_context, "array-subscript assignment cannot produce lvalues");
             return false;
         }
 
-        arr = (ast_value*)ai->array;
-        if (!ast_istype(ai->array, ast_value) || !arr->setter) {
-            compile_error(ast_ctx(self), "value has no setter (%s)", arr->name);
+        arr = (ast_value*)ai->m_array;
+        if (!ast_istype(ai->m_array, ast_value) || !arr->m_setter) {
+            compile_error(self->m_context, "value has no setter (%s)", arr->m_name);
             return false;
         }
 
-        cgen = idx->codegen;
+        cgen = idx->m_codegen;
         if (!(*cgen)((ast_expression*)(idx), func, false, &iridx))
             return false;
 
-        cgen = arr->setter->codegen;
-        if (!(*cgen)((ast_expression*)(arr->setter), func, true, &funval))
+        cgen = arr->m_setter->m_codegen;
+        if (!(*cgen)((ast_expression*)(arr->m_setter), func, true, &funval))
             return false;
 
-        cgen = self->source->codegen;
-        if (!(*cgen)((ast_expression*)(self->source), func, false, &right))
+        cgen = self->m_source->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_source), func, false, &right))
             return false;
 
-        call = ir_block_create_call(func->curblock, ast_ctx(self), ast_function_label(func, "store"), funval, false);
+        call = ir_block_create_call(func->m_curblock, self->m_context, ast_function_label(func, "store"), funval, false);
         if (!call)
             return false;
         ir_call_param(call, iridx);
         ir_call_param(call, right);
-        self->outr = right;
+        self->m_outr = right;
     }
     else
     {
         /* regular code */
 
-        cgen = self->dest->codegen;
+        cgen = self->m_dest->m_codegen;
         /* lvalue! */
-        if (!(*cgen)((ast_expression*)(self->dest), func, true, &left))
+        if (!(*cgen)((ast_expression*)(self->m_dest), func, true, &left))
             return false;
-        self->outl = left;
+        self->m_outl = left;
 
-        cgen = self->source->codegen;
+        cgen = self->m_source->m_codegen;
         /* rvalue! */
-        if (!(*cgen)((ast_expression*)(self->source), func, false, &right))
+        if (!(*cgen)((ast_expression*)(self->m_source), func, false, &right))
             return false;
 
-        if (!ir_block_create_store_op(func->curblock, ast_ctx(self), self->op, left, right))
+        if (!ir_block_create_store_op(func->m_curblock, self->m_context, self->m_op, left, right))
             return false;
-        self->outr = right;
+        self->m_outr = right;
     }
 
     /* Theoretically, an assinment returns its left side as an
@@ -2070,17 +2067,17 @@ bool ast_binary_codegen(ast_binary *self, ast_function *func, bool lvalue, ir_va
 
     /* A binary operation cannot yield an l-value */
     if (lvalue) {
-        compile_error(ast_ctx(self), "not an l-value (binop)");
+        compile_error(self->m_context, "not an l-value (binop)");
         return false;
     }
 
-    if (self->outr) {
-        *out = self->outr;
+    if (self->m_outr) {
+        *out = self->m_outr;
         return true;
     }
 
     if ((OPTS_FLAG(SHORT_LOGIC) || OPTS_FLAG(PERL_LOGIC)) &&
-        (self->op == INSTR_AND || self->op == INSTR_OR))
+        (self->m_op == INSTR_AND || self->m_op == INSTR_OR))
     {
         /* NOTE: The short-logic path will ignore right_first */
 
@@ -2091,54 +2088,54 @@ bool ast_binary_codegen(ast_binary *self, ast_function *func, bool lvalue, ir_va
         size_t    merge_id;
 
         /* prepare end-block */
-        merge_id = func->ir_func->blocks.size();
-        merge    = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "sce_merge"));
+        merge_id = func->m_ir_func->m_blocks.size();
+        merge    = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "sce_merge"));
 
         /* generate the left expression */
-        cgen = self->left->codegen;
-        if (!(*cgen)((ast_expression*)(self->left), func, false, &left))
+        cgen = self->m_left->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_left), func, false, &left))
             return false;
         /* remember the block */
-        from_left = func->curblock;
+        from_left = func->m_curblock;
 
         /* create a new block for the right expression */
-        other = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "sce_other"));
-        if (self->op == INSTR_AND) {
+        other = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "sce_other"));
+        if (self->m_op == INSTR_AND) {
             /* on AND: left==true -> other */
-            if (!ir_block_create_if(func->curblock, ast_ctx(self), left, other, merge))
+            if (!ir_block_create_if(func->m_curblock, self->m_context, left, other, merge))
                 return false;
         } else {
             /* on OR: left==false -> other */
-            if (!ir_block_create_if(func->curblock, ast_ctx(self), left, merge, other))
+            if (!ir_block_create_if(func->m_curblock, self->m_context, left, merge, other))
                 return false;
         }
         /* use the likely flag */
-        vec_last(func->curblock->instr)->likely = true;
+        vec_last(func->m_curblock->m_instr)->m_likely = true;
 
         /* enter the right-expression's block */
-        func->curblock = other;
+        func->m_curblock = other;
         /* generate */
-        cgen = self->right->codegen;
-        if (!(*cgen)((ast_expression*)(self->right), func, false, &right))
+        cgen = self->m_right->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_right), func, false, &right))
             return false;
         /* remember block */
-        from_right = func->curblock;
+        from_right = func->m_curblock;
 
         /* jump to the merge block */
-        if (!ir_block_create_jump(func->curblock, ast_ctx(self), merge))
+        if (!ir_block_create_jump(func->m_curblock, self->m_context, merge))
             return false;
 
-        algo::shiftback(func->ir_func->blocks.begin() + merge_id,
-                        func->ir_func->blocks.end());
+        algo::shiftback(func->m_ir_func->m_blocks.begin() + merge_id,
+                        func->m_ir_func->m_blocks.end());
         // FIXME::DELME::
-        //func->ir_func->blocks[merge_id].release();
-        //func->ir_func->blocks.erase(func->ir_func->blocks.begin() + merge_id);
-        //func->ir_func->blocks.emplace_back(merge);
+        //func->m_ir_func->m_blocks[merge_id].release();
+        //func->m_ir_func->m_blocks.erase(func->m_ir_func->m_blocks.begin() + merge_id);
+        //func->m_ir_func->m_blocks.emplace_back(merge);
 
-        func->curblock = merge;
-        phi = ir_block_create_phi(func->curblock, ast_ctx(self),
+        func->m_curblock = merge;
+        phi = ir_block_create_phi(func->m_curblock, self->m_context,
                                   ast_function_label(func, "sce_value"),
-                                  self->vtype);
+                                  self->m_vtype);
         ir_phi_add(phi, from_left, left);
         ir_phi_add(phi, from_right, right);
         *out = ir_phi_value(phi);
@@ -2147,32 +2144,32 @@ bool ast_binary_codegen(ast_binary *self, ast_function *func, bool lvalue, ir_va
 
         if (!OPTS_FLAG(PERL_LOGIC)) {
             /* cast-to-bool */
-            if (OPTS_FLAG(CORRECT_LOGIC) && (*out)->vtype == TYPE_VECTOR) {
-                *out = ir_block_create_unary(func->curblock, ast_ctx(self),
+            if (OPTS_FLAG(CORRECT_LOGIC) && (*out)->m_vtype == TYPE_VECTOR) {
+                *out = ir_block_create_unary(func->m_curblock, self->m_context,
                                              ast_function_label(func, "sce_bool_v"),
                                              INSTR_NOT_V, *out);
                 if (!*out)
                     return false;
-                *out = ir_block_create_unary(func->curblock, ast_ctx(self),
+                *out = ir_block_create_unary(func->m_curblock, self->m_context,
                                              ast_function_label(func, "sce_bool"),
                                              INSTR_NOT_F, *out);
                 if (!*out)
                     return false;
             }
-            else if (OPTS_FLAG(FALSE_EMPTY_STRINGS) && (*out)->vtype == TYPE_STRING) {
-                *out = ir_block_create_unary(func->curblock, ast_ctx(self),
+            else if (OPTS_FLAG(FALSE_EMPTY_STRINGS) && (*out)->m_vtype == TYPE_STRING) {
+                *out = ir_block_create_unary(func->m_curblock, self->m_context,
                                              ast_function_label(func, "sce_bool_s"),
                                              INSTR_NOT_S, *out);
                 if (!*out)
                     return false;
-                *out = ir_block_create_unary(func->curblock, ast_ctx(self),
+                *out = ir_block_create_unary(func->m_curblock, self->m_context,
                                              ast_function_label(func, "sce_bool"),
                                              INSTR_NOT_F, *out);
                 if (!*out)
                     return false;
             }
             else {
-                *out = ir_block_create_binop(func->curblock, ast_ctx(self),
+                *out = ir_block_create_binop(func->m_curblock, self->m_context,
                                              ast_function_label(func, "sce_bool"),
                                              INSTR_AND, *out, *out);
                 if (!*out)
@@ -2180,32 +2177,32 @@ bool ast_binary_codegen(ast_binary *self, ast_function *func, bool lvalue, ir_va
             }
         }
 
-        self->outr = *out;
+        self->m_outr = *out;
         codegen_output_type(self, *out);
         return true;
     }
 
-    if (self->right_first) {
-        cgen = self->right->codegen;
-        if (!(*cgen)((ast_expression*)(self->right), func, false, &right))
+    if (self->m_right_first) {
+        cgen = self->m_right->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_right), func, false, &right))
             return false;
-        cgen = self->left->codegen;
-        if (!(*cgen)((ast_expression*)(self->left), func, false, &left))
+        cgen = self->m_left->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_left), func, false, &left))
             return false;
     } else {
-        cgen = self->left->codegen;
-        if (!(*cgen)((ast_expression*)(self->left), func, false, &left))
+        cgen = self->m_left->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_left), func, false, &left))
             return false;
-        cgen = self->right->codegen;
-        if (!(*cgen)((ast_expression*)(self->right), func, false, &right))
+        cgen = self->m_right->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_right), func, false, &right))
             return false;
     }
 
-    *out = ir_block_create_binop(func->curblock, ast_ctx(self), ast_function_label(func, "bin"),
-                                 self->op, left, right);
+    *out = ir_block_create_binop(func->m_curblock, self->m_context, ast_function_label(func, "bin"),
+                                 self->m_op, left, right);
     if (!*out)
         return false;
-    self->outr = *out;
+    self->m_outr = *out;
     codegen_output_type(self, *out);
 
     return true;
@@ -2221,46 +2218,46 @@ bool ast_binstore_codegen(ast_binstore *self, ast_function *func, bool lvalue, i
     ast_array_index *ai = nullptr;
     ir_value        *iridx = nullptr;
 
-    if (lvalue && self->outl) {
-        *out = self->outl;
+    if (lvalue && self->m_outl) {
+        *out = self->m_outl;
         return true;
     }
 
-    if (!lvalue && self->outr) {
-        *out = self->outr;
+    if (!lvalue && self->m_outr) {
+        *out = self->m_outr;
         return true;
     }
 
-    if (ast_istype(self->dest, ast_array_index))
+    if (ast_istype(self->m_dest, ast_array_index))
     {
 
-        ai = (ast_array_index*)self->dest;
-        idx = (ast_value*)ai->index;
+        ai = (ast_array_index*)self->m_dest;
+        idx = (ast_value*)ai->m_index;
 
-        if (ast_istype(ai->index, ast_value) && idx->hasvalue && idx->cvq == CV_CONST)
+        if (ast_istype(ai->m_index, ast_value) && idx->m_hasvalue && idx->m_cvq == CV_CONST)
             ai = nullptr;
     }
 
     /* for a binstore we need both an lvalue and an rvalue for the left side */
     /* rvalue of destination! */
     if (ai) {
-        cgen = idx->codegen;
+        cgen = idx->m_codegen;
         if (!(*cgen)((ast_expression*)(idx), func, false, &iridx))
             return false;
     }
-    cgen = self->dest->codegen;
-    if (!(*cgen)((ast_expression*)(self->dest), func, false, &leftr))
+    cgen = self->m_dest->m_codegen;
+    if (!(*cgen)((ast_expression*)(self->m_dest), func, false, &leftr))
         return false;
 
     /* source as rvalue only */
-    cgen = self->source->codegen;
-    if (!(*cgen)((ast_expression*)(self->source), func, false, &right))
+    cgen = self->m_source->m_codegen;
+    if (!(*cgen)((ast_expression*)(self->m_source), func, false, &right))
         return false;
 
     /* now the binary */
-    bin = ir_block_create_binop(func->curblock, ast_ctx(self), ast_function_label(func, "binst"),
-                                self->opbin, leftr, right);
-    self->outr = bin;
+    bin = ir_block_create_binop(func->m_curblock, self->m_context, ast_function_label(func, "binst"),
+                                self->m_opbin, leftr, right);
+    self->m_outr = bin;
 
     if (ai) {
         /* we need to call the setter */
@@ -2268,37 +2265,37 @@ bool ast_binstore_codegen(ast_binstore *self, ast_function *func, bool lvalue, i
         ir_instr  *call;
 
         if (lvalue) {
-            compile_error(ast_ctx(self), "array-subscript assignment cannot produce lvalues");
+            compile_error(self->m_context, "array-subscript assignment cannot produce lvalues");
             return false;
         }
 
-        arr = (ast_value*)ai->array;
-        if (!ast_istype(ai->array, ast_value) || !arr->setter) {
-            compile_error(ast_ctx(self), "value has no setter (%s)", arr->name);
+        arr = (ast_value*)ai->m_array;
+        if (!ast_istype(ai->m_array, ast_value) || !arr->m_setter) {
+            compile_error(self->m_context, "value has no setter (%s)", arr->m_name);
             return false;
         }
 
-        cgen = arr->setter->codegen;
-        if (!(*cgen)((ast_expression*)(arr->setter), func, true, &funval))
+        cgen = arr->m_setter->m_codegen;
+        if (!(*cgen)((ast_expression*)(arr->m_setter), func, true, &funval))
             return false;
 
-        call = ir_block_create_call(func->curblock, ast_ctx(self), ast_function_label(func, "store"), funval, false);
+        call = ir_block_create_call(func->m_curblock, self->m_context, ast_function_label(func, "store"), funval, false);
         if (!call)
             return false;
         ir_call_param(call, iridx);
         ir_call_param(call, bin);
-        self->outr = bin;
+        self->m_outr = bin;
     } else {
         /* now store them */
-        cgen = self->dest->codegen;
+        cgen = self->m_dest->m_codegen;
         /* lvalue of destination */
-        if (!(*cgen)((ast_expression*)(self->dest), func, true, &leftl))
+        if (!(*cgen)((ast_expression*)(self->m_dest), func, true, &leftl))
             return false;
-        self->outl = leftl;
+        self->m_outl = leftl;
 
-        if (!ir_block_create_store_op(func->curblock, ast_ctx(self), self->opstore, leftl, bin))
+        if (!ir_block_create_store_op(func->m_curblock, self->m_context, self->m_opstore, leftl, bin))
             return false;
-        self->outr = bin;
+        self->m_outr = bin;
     }
 
     /* Theoretically, an assinment returns its left side as an
@@ -2320,25 +2317,25 @@ bool ast_unary_codegen(ast_unary *self, ast_function *func, bool lvalue, ir_valu
 
     /* An unary operation cannot yield an l-value */
     if (lvalue) {
-        compile_error(ast_ctx(self), "not an l-value (binop)");
+        compile_error(self->m_context, "not an l-value (binop)");
         return false;
     }
 
-    if (self->outr) {
-        *out = self->outr;
+    if (self->m_outr) {
+        *out = self->m_outr;
         return true;
     }
 
-    cgen = self->operand->codegen;
+    cgen = self->m_operand->m_codegen;
     /* lvalue! */
-    if (!(*cgen)((ast_expression*)(self->operand), func, false, &operand))
+    if (!(*cgen)((ast_expression*)(self->m_operand), func, false, &operand))
         return false;
 
-    *out = ir_block_create_unary(func->curblock, ast_ctx(self), ast_function_label(func, "unary"),
-                                 self->op, operand);
+    *out = ir_block_create_unary(func->m_curblock, self->m_context, ast_function_label(func, "unary"),
+                                 self->m_op, operand);
     if (!*out)
         return false;
-    self->outr = *out;
+    self->m_outr = *out;
 
     return true;
 }
@@ -2354,26 +2351,26 @@ bool ast_return_codegen(ast_return *self, ast_function *func, bool lvalue, ir_va
      * anything...
      */
     if (lvalue) {
-        compile_error(ast_ctx(self), "return-expression is not an l-value");
+        compile_error(self->m_context, "return-expression is not an l-value");
         return false;
     }
 
-    if (self->outr) {
-        compile_error(ast_ctx(self), "internal error: ast_return cannot be reused, it bears no result!");
+    if (self->m_outr) {
+        compile_error(self->m_context, "internal error: ast_return cannot be reused, it bears no result!");
         return false;
     }
-    self->outr = (ir_value*)1;
+    self->m_outr = (ir_value*)1;
 
-    if (self->operand) {
-        cgen = self->operand->codegen;
+    if (self->m_operand) {
+        cgen = self->m_operand->m_codegen;
         /* lvalue! */
-        if (!(*cgen)((ast_expression*)(self->operand), func, false, &operand))
+        if (!(*cgen)((ast_expression*)(self->m_operand), func, false, &operand))
             return false;
 
-        if (!ir_block_create_return(func->curblock, ast_ctx(self), operand))
+        if (!ir_block_create_return(func->m_curblock, self->m_context, operand))
             return false;
     } else {
-        if (!ir_block_create_return(func->curblock, ast_ctx(self), nullptr))
+        if (!ir_block_create_return(func->m_curblock, self->m_context, nullptr))
             return false;
     }
 
@@ -2390,48 +2387,48 @@ bool ast_entfield_codegen(ast_entfield *self, ast_function *func, bool lvalue, i
      * value in a temp.
      */
 
-    if (lvalue && self->outl) {
-        *out = self->outl;
+    if (lvalue && self->m_outl) {
+        *out = self->m_outl;
         return true;
     }
 
-    if (!lvalue && self->outr) {
-        *out = self->outr;
+    if (!lvalue && self->m_outr) {
+        *out = self->m_outr;
         return true;
     }
 
-    cgen = self->entity->codegen;
-    if (!(*cgen)((ast_expression*)(self->entity), func, false, &ent))
+    cgen = self->m_entity->m_codegen;
+    if (!(*cgen)((ast_expression*)(self->m_entity), func, false, &ent))
         return false;
 
-    cgen = self->field->codegen;
-    if (!(*cgen)((ast_expression*)(self->field), func, false, &field))
+    cgen = self->m_field->m_codegen;
+    if (!(*cgen)((ast_expression*)(self->m_field), func, false, &field))
         return false;
 
     if (lvalue) {
         /* address! */
-        *out = ir_block_create_fieldaddress(func->curblock, ast_ctx(self), ast_function_label(func, "efa"),
+        *out = ir_block_create_fieldaddress(func->m_curblock, self->m_context, ast_function_label(func, "efa"),
                                             ent, field);
     } else {
-        *out = ir_block_create_load_from_ent(func->curblock, ast_ctx(self), ast_function_label(func, "efv"),
-                                             ent, field, self->vtype);
+        *out = ir_block_create_load_from_ent(func->m_curblock, self->m_context, ast_function_label(func, "efv"),
+                                             ent, field, self->m_vtype);
         /* Done AFTER error checking:
         codegen_output_type(self, *out);
         */
     }
     if (!*out) {
-        compile_error(ast_ctx(self), "failed to create %s instruction (output type %s)",
+        compile_error(self->m_context, "failed to create %s instruction (output type %s)",
                  (lvalue ? "ADDRESS" : "FIELD"),
-                 type_name[self->vtype]);
+                 type_name[self->m_vtype]);
         return false;
     }
     if (!lvalue)
         codegen_output_type(self, *out);
 
     if (lvalue)
-        self->outl = *out;
+        self->m_outl = *out;
     else
-        self->outr = *out;
+        self->m_outr = *out;
 
     /* Hm that should be it... */
     return true;
@@ -2443,27 +2440,27 @@ bool ast_member_codegen(ast_member *self, ast_function *func, bool lvalue, ir_va
     ir_value *vec;
 
     /* in QC this is always an lvalue */
-    if (lvalue && self->rvalue) {
-        compile_error(ast_ctx(self), "not an l-value (member access)");
+    if (lvalue && self->m_rvalue) {
+        compile_error(self->m_context, "not an l-value (member access)");
         return false;
     }
-    if (self->outl) {
-        *out = self->outl;
+    if (self->m_outl) {
+        *out = self->m_outl;
         return true;
     }
 
-    cgen = self->owner->codegen;
-    if (!(*cgen)((ast_expression*)(self->owner), func, false, &vec))
+    cgen = self->m_owner->m_codegen;
+    if (!(*cgen)((ast_expression*)(self->m_owner), func, false, &vec))
         return false;
 
-    if (vec->vtype != TYPE_VECTOR &&
-        !(vec->vtype == TYPE_FIELD && self->owner->next->vtype == TYPE_VECTOR))
+    if (vec->m_vtype != TYPE_VECTOR &&
+        !(vec->m_vtype == TYPE_FIELD && self->m_owner->m_next->m_vtype == TYPE_VECTOR))
     {
         return false;
     }
 
-    *out = ir_value_vector_member(vec, self->field);
-    self->outl = *out;
+    *out = ir_value_vector_member(vec, self->m_field);
+    self->m_outl = *out;
 
     return (*out != nullptr);
 }
@@ -2473,17 +2470,17 @@ bool ast_array_index_codegen(ast_array_index *self, ast_function *func, bool lva
     ast_value *arr;
     ast_value *idx;
 
-    if (!lvalue && self->outr) {
-        *out = self->outr;
+    if (!lvalue && self->m_outr) {
+        *out = self->m_outr;
         return true;
     }
-    if (lvalue && self->outl) {
-        *out = self->outl;
+    if (lvalue && self->m_outl) {
+        *out = self->m_outl;
         return true;
     }
 
-    if (!ast_istype(self->array, ast_value)) {
-        compile_error(ast_ctx(self), "array indexing this way is not supported");
+    if (!ast_istype(self->m_array, ast_value)) {
+        compile_error(self->m_context, "array indexing this way is not supported");
         /* note this would actually be pointer indexing because the left side is
          * not an actual array but (hopefully) an indexable expression.
          * Once we get integer arithmetic, and GADDRESS/GSTORE/GLOAD instruction
@@ -2492,68 +2489,68 @@ bool ast_array_index_codegen(ast_array_index *self, ast_function *func, bool lva
         return false;
     }
 
-    arr = (ast_value*)self->array;
-    idx = (ast_value*)self->index;
+    arr = (ast_value*)self->m_array;
+    idx = (ast_value*)self->m_index;
 
-    if (!ast_istype(self->index, ast_value) || !idx->hasvalue || idx->cvq != CV_CONST) {
+    if (!ast_istype(self->m_index, ast_value) || !idx->m_hasvalue || idx->m_cvq != CV_CONST) {
         /* Time to use accessor functions */
         ast_expression_codegen *cgen;
         ir_value               *iridx, *funval;
         ir_instr               *call;
 
         if (lvalue) {
-            compile_error(ast_ctx(self), "(.2) array indexing here needs a compile-time constant");
+            compile_error(self->m_context, "(.2) array indexing here needs a compile-time constant");
             return false;
         }
 
-        if (!arr->getter) {
-            compile_error(ast_ctx(self), "value has no getter, don't know how to index it");
+        if (!arr->m_getter) {
+            compile_error(self->m_context, "value has no getter, don't know how to index it");
             return false;
         }
 
-        cgen = self->index->codegen;
-        if (!(*cgen)((ast_expression*)(self->index), func, false, &iridx))
+        cgen = self->m_index->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_index), func, false, &iridx))
             return false;
 
-        cgen = arr->getter->codegen;
-        if (!(*cgen)((ast_expression*)(arr->getter), func, true, &funval))
+        cgen = arr->m_getter->m_codegen;
+        if (!(*cgen)((ast_expression*)(arr->m_getter), func, true, &funval))
             return false;
 
-        call = ir_block_create_call(func->curblock, ast_ctx(self), ast_function_label(func, "fetch"), funval, false);
+        call = ir_block_create_call(func->m_curblock, self->m_context, ast_function_label(func, "fetch"), funval, false);
         if (!call)
             return false;
         ir_call_param(call, iridx);
 
         *out = ir_call_value(call);
-        self->outr = *out;
-        (*out)->vtype = self->vtype;
+        self->m_outr = *out;
+        (*out)->m_vtype = self->m_vtype;
         codegen_output_type(self, *out);
         return true;
     }
 
-    if (idx->vtype == TYPE_FLOAT) {
-        unsigned int arridx = idx->constval.vfloat;
-        if (arridx >= self->array->count)
+    if (idx->m_vtype == TYPE_FLOAT) {
+        unsigned int arridx = idx->m_constval.vfloat;
+        if (arridx >= self->m_array->m_count)
         {
-            compile_error(ast_ctx(self), "array index out of bounds: %i", arridx);
+            compile_error(self->m_context, "array index out of bounds: %i", arridx);
             return false;
         }
-        *out = arr->ir_values[arridx];
+        *out = arr->m_ir_values[arridx];
     }
-    else if (idx->vtype == TYPE_INTEGER) {
-        unsigned int arridx = idx->constval.vint;
-        if (arridx >= self->array->count)
+    else if (idx->m_vtype == TYPE_INTEGER) {
+        unsigned int arridx = idx->m_constval.vint;
+        if (arridx >= self->m_array->m_count)
         {
-            compile_error(ast_ctx(self), "array index out of bounds: %i", arridx);
+            compile_error(self->m_context, "array index out of bounds: %i", arridx);
             return false;
         }
-        *out = arr->ir_values[arridx];
+        *out = arr->m_ir_values[arridx];
     }
     else {
-        compile_error(ast_ctx(self), "array indexing here needs an integer constant");
+        compile_error(self->m_context, "array indexing here needs an integer constant");
         return false;
     }
-    (*out)->vtype = self->vtype;
+    (*out)->m_vtype = self->m_vtype;
     codegen_output_type(self, *out);
     return true;
 }
@@ -2562,12 +2559,12 @@ bool ast_argpipe_codegen(ast_argpipe *self, ast_function *func, bool lvalue, ir_
 {
     *out = nullptr;
     if (lvalue) {
-        compile_error(ast_ctx(self), "argpipe node: not an lvalue");
+        compile_error(self->m_context, "argpipe node: not an lvalue");
         return false;
     }
     (void)func;
     (void)out;
-    compile_error(ast_ctx(self), "TODO: argpipe codegen not implemented");
+    compile_error(self->m_context, "TODO: argpipe codegen not implemented");
     return false;
 }
 
@@ -2590,81 +2587,81 @@ bool ast_ifthen_codegen(ast_ifthen *self, ast_function *func, bool lvalue, ir_va
     (void)out;
     (void)lvalue;
 
-    if (self->outr) {
-        compile_error(ast_ctx(self), "internal error: ast_ifthen cannot be reused, it bears no result!");
+    if (self->m_outr) {
+        compile_error(self->m_context, "internal error: ast_ifthen cannot be reused, it bears no result!");
         return false;
     }
-    self->outr = (ir_value*)1;
+    self->m_outr = (ir_value*)1;
 
     /* generate the condition */
-    cgen = self->cond->codegen;
-    if (!(*cgen)((ast_expression*)(self->cond), func, false, &condval))
+    cgen = self->m_cond->m_codegen;
+    if (!(*cgen)((ast_expression*)(self->m_cond), func, false, &condval))
         return false;
     /* update the block which will get the jump - because short-logic or ternaries may have changed this */
-    cond = func->curblock;
+    cond = func->m_curblock;
 
     /* try constant folding away the condition */
     if ((folded = fold::cond_ifthen(condval, func, self)) != -1)
         return folded;
 
-    if (self->on_true) {
+    if (self->m_on_true) {
         /* create on-true block */
-        ontrue = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "ontrue"));
+        ontrue = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "ontrue"));
         if (!ontrue)
             return false;
 
         /* enter the block */
-        func->curblock = ontrue;
+        func->m_curblock = ontrue;
 
         /* generate */
-        cgen = self->on_true->codegen;
-        if (!(*cgen)((ast_expression*)(self->on_true), func, false, &dummy))
+        cgen = self->m_on_true->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_on_true), func, false, &dummy))
             return false;
 
         /* we now need to work from the current endpoint */
-        ontrue_endblock = func->curblock;
+        ontrue_endblock = func->m_curblock;
     } else
         ontrue = nullptr;
 
     /* on-false path */
-    if (self->on_false) {
+    if (self->m_on_false) {
         /* create on-false block */
-        onfalse = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "onfalse"));
+        onfalse = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "onfalse"));
         if (!onfalse)
             return false;
 
         /* enter the block */
-        func->curblock = onfalse;
+        func->m_curblock = onfalse;
 
         /* generate */
-        cgen = self->on_false->codegen;
-        if (!(*cgen)((ast_expression*)(self->on_false), func, false, &dummy))
+        cgen = self->m_on_false->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_on_false), func, false, &dummy))
             return false;
 
         /* we now need to work from the current endpoint */
-        onfalse_endblock = func->curblock;
+        onfalse_endblock = func->m_curblock;
     } else
         onfalse = nullptr;
 
     /* Merge block were they all merge in to */
-    if (!ontrue || !onfalse || !ontrue_endblock->final || !onfalse_endblock->final)
+    if (!ontrue || !onfalse || !ontrue_endblock->m_final || !onfalse_endblock->m_final)
     {
-        merge = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "endif"));
+        merge = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "endif"));
         if (!merge)
             return false;
         /* add jumps ot the merge block */
-        if (ontrue && !ontrue_endblock->final && !ir_block_create_jump(ontrue_endblock, ast_ctx(self), merge))
+        if (ontrue && !ontrue_endblock->m_final && !ir_block_create_jump(ontrue_endblock, self->m_context, merge))
             return false;
-        if (onfalse && !onfalse_endblock->final && !ir_block_create_jump(onfalse_endblock, ast_ctx(self), merge))
+        if (onfalse && !onfalse_endblock->m_final && !ir_block_create_jump(onfalse_endblock, self->m_context, merge))
             return false;
 
         /* Now enter the merge block */
-        func->curblock = merge;
+        func->m_curblock = merge;
     }
 
     /* we create the if here, that way all blocks are ordered :)
      */
-    if (!ir_block_create_if(cond, ast_ctx(self), condval,
+    if (!ir_block_create_if(cond, self->m_context, condval,
                             (ontrue  ? ontrue  : merge),
                             (onfalse ? onfalse : merge)))
     {
@@ -2682,7 +2679,7 @@ bool ast_ternary_codegen(ast_ternary *self, ast_function *func, bool lvalue, ir_
     ir_value *trueval, *falseval;
     ir_instr *phi;
 
-    ir_block *cond = func->curblock;
+    ir_block *cond = func->m_curblock;
     ir_block *cond_out = nullptr;
     ir_block *ontrue, *ontrue_out = nullptr;
     ir_block *onfalse, *onfalse_out = nullptr;
@@ -2698,95 +2695,95 @@ bool ast_ternary_codegen(ast_ternary *self, ast_function *func, bool lvalue, ir_
      * may still happen, thus we remember a created ir_value and simply return one
      * if it already exists.
      */
-    if (self->outr) {
-        *out = self->outr;
+    if (self->m_outr) {
+        *out = self->m_outr;
         return true;
     }
 
     /* In the following, contraty to ast_ifthen, we assume both paths exist. */
 
     /* generate the condition */
-    func->curblock = cond;
-    cgen = self->cond->codegen;
-    if (!(*cgen)((ast_expression*)(self->cond), func, false, &condval))
+    func->m_curblock = cond;
+    cgen = self->m_cond->m_codegen;
+    if (!(*cgen)((ast_expression*)(self->m_cond), func, false, &condval))
         return false;
-    cond_out = func->curblock;
+    cond_out = func->m_curblock;
 
     /* try constant folding away the condition */
     if ((folded = fold::cond_ternary(condval, func, self)) != -1)
         return folded;
 
     /* create on-true block */
-    ontrue = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "tern_T"));
+    ontrue = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "tern_T"));
     if (!ontrue)
         return false;
     else
     {
         /* enter the block */
-        func->curblock = ontrue;
+        func->m_curblock = ontrue;
 
         /* generate */
-        cgen = self->on_true->codegen;
-        if (!(*cgen)((ast_expression*)(self->on_true), func, false, &trueval))
+        cgen = self->m_on_true->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_on_true), func, false, &trueval))
             return false;
 
-        ontrue_out = func->curblock;
+        ontrue_out = func->m_curblock;
     }
 
     /* create on-false block */
-    onfalse = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "tern_F"));
+    onfalse = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "tern_F"));
     if (!onfalse)
         return false;
     else
     {
         /* enter the block */
-        func->curblock = onfalse;
+        func->m_curblock = onfalse;
 
         /* generate */
-        cgen = self->on_false->codegen;
-        if (!(*cgen)((ast_expression*)(self->on_false), func, false, &falseval))
+        cgen = self->m_on_false->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_on_false), func, false, &falseval))
             return false;
 
-        onfalse_out = func->curblock;
+        onfalse_out = func->m_curblock;
     }
 
     /* create merge block */
-    merge = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "tern_out"));
+    merge = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "tern_out"));
     if (!merge)
         return false;
     /* jump to merge block */
-    if (!ir_block_create_jump(ontrue_out, ast_ctx(self), merge))
+    if (!ir_block_create_jump(ontrue_out, self->m_context, merge))
         return false;
-    if (!ir_block_create_jump(onfalse_out, ast_ctx(self), merge))
+    if (!ir_block_create_jump(onfalse_out, self->m_context, merge))
         return false;
 
     /* create if instruction */
-    if (!ir_block_create_if(cond_out, ast_ctx(self), condval, ontrue, onfalse))
+    if (!ir_block_create_if(cond_out, self->m_context, condval, ontrue, onfalse))
         return false;
 
     /* Now enter the merge block */
-    func->curblock = merge;
+    func->m_curblock = merge;
 
     /* Here, now, we need a PHI node
      * but first some sanity checking...
      */
-    if (trueval->vtype != falseval->vtype && trueval->vtype != TYPE_NIL && falseval->vtype != TYPE_NIL) {
+    if (trueval->m_vtype != falseval->m_vtype && trueval->m_vtype != TYPE_NIL && falseval->m_vtype != TYPE_NIL) {
         /* error("ternary with different types on the two sides"); */
-        compile_error(ast_ctx(self), "internal error: ternary operand types invalid");
+        compile_error(self->m_context, "internal error: ternary operand types invalid");
         return false;
     }
 
     /* create PHI */
-    phi = ir_block_create_phi(merge, ast_ctx(self), ast_function_label(func, "phi"), self->vtype);
+    phi = ir_block_create_phi(merge, self->m_context, ast_function_label(func, "phi"), self->m_vtype);
     if (!phi) {
-        compile_error(ast_ctx(self), "internal error: failed to generate phi node");
+        compile_error(self->m_context, "internal error: failed to generate phi node");
         return false;
     }
     ir_phi_add(phi, ontrue_out,  trueval);
     ir_phi_add(phi, onfalse_out, falseval);
 
-    self->outr = ir_phi_value(phi);
-    *out = self->outr;
+    self->m_outr = ir_phi_value(phi);
+    *out = self->m_outr;
 
     codegen_output_type(self, *out);
 
@@ -2823,11 +2820,11 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
     (void)lvalue;
     (void)out;
 
-    if (self->outr) {
-        compile_error(ast_ctx(self), "internal error: ast_loop cannot be reused, it bears no result!");
+    if (self->m_outr) {
+        compile_error(self->m_context, "internal error: ast_loop cannot be reused, it bears no result!");
         return false;
     }
-    self->outr = (ir_value*)1;
+    self->m_outr = (ir_value*)1;
 
     /* NOTE:
      * Should we ever need some kind of block ordering, better make this function
@@ -2838,22 +2835,22 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
     /* initexpr doesn't get its own block, it's pointless, it could create more blocks
      * anyway if for example it contains a ternary.
      */
-    if (self->initexpr)
+    if (self->m_initexpr)
     {
-        cgen = self->initexpr->codegen;
-        if (!(*cgen)((ast_expression*)(self->initexpr), func, false, &dummy))
+        cgen = self->m_initexpr->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_initexpr), func, false, &dummy))
             return false;
     }
 
     /* Store the block from which we enter this chaos */
-    bin = func->curblock;
+    bin = func->m_curblock;
 
     /* The pre-loop condition needs its own block since we
      * need to be able to jump to the start of that expression.
      */
-    if (self->precond)
+    if (self->m_precond)
     {
-        bprecond = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "pre_loop_cond"));
+        bprecond = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "pre_loop_cond"));
         if (!bprecond)
             return false;
 
@@ -2861,14 +2858,14 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
         bcontinue = bprecond;
 
         /* enter */
-        func->curblock = bprecond;
+        func->m_curblock = bprecond;
 
         /* generate */
-        cgen = self->precond->codegen;
-        if (!(*cgen)((ast_expression*)(self->precond), func, false, &precond))
+        cgen = self->m_precond->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_precond), func, false, &precond))
             return false;
 
-        end_bprecond = func->curblock;
+        end_bprecond = func->m_curblock;
     } else {
         bprecond = end_bprecond = nullptr;
     }
@@ -2876,8 +2873,8 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
     /* Now the next blocks won't be ordered nicely, but we need to
      * generate them this early for 'break' and 'continue'.
      */
-    if (self->increment) {
-        bincrement = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "loop_increment"));
+    if (self->m_increment) {
+        bincrement = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "loop_increment"));
         if (!bincrement)
             return false;
         bcontinue = bincrement; /* increment comes before the pre-loop-condition */
@@ -2885,8 +2882,8 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
         bincrement = end_bincrement = nullptr;
     }
 
-    if (self->postcond) {
-        bpostcond = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "post_loop_cond"));
+    if (self->m_postcond) {
+        bpostcond = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "post_loop_cond"));
         if (!bpostcond)
             return false;
         bcontinue = bpostcond; /* postcond comes before the increment */
@@ -2894,70 +2891,70 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
         bpostcond = end_bpostcond = nullptr;
     }
 
-    bout_id = func->ir_func->blocks.size();
-    bout = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "after_loop"));
+    bout_id = func->m_ir_func->m_blocks.size();
+    bout = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "after_loop"));
     if (!bout)
         return false;
     bbreak = bout;
 
     /* The loop body... */
-    /* if (self->body) */
+    /* if (self->m_body) */
     {
-        bbody = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "loop_body"));
+        bbody = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "loop_body"));
         if (!bbody)
             return false;
 
         /* enter */
-        func->curblock = bbody;
+        func->m_curblock = bbody;
 
-        func->breakblocks.push_back(bbreak);
+        func->m_breakblocks.push_back(bbreak);
         if (bcontinue)
-            func->continueblocks.push_back(bcontinue);
+            func->m_continueblocks.push_back(bcontinue);
         else
-            func->continueblocks.push_back(bbody);
+            func->m_continueblocks.push_back(bbody);
 
         /* generate */
-        if (self->body) {
-            cgen = self->body->codegen;
-            if (!(*cgen)((ast_expression*)(self->body), func, false, &dummy))
+        if (self->m_body) {
+            cgen = self->m_body->m_codegen;
+            if (!(*cgen)((ast_expression*)(self->m_body), func, false, &dummy))
                 return false;
         }
 
-        end_bbody = func->curblock;
-        func->breakblocks.pop_back();
-        func->continueblocks.pop_back();
+        end_bbody = func->m_curblock;
+        func->m_breakblocks.pop_back();
+        func->m_continueblocks.pop_back();
     }
 
     /* post-loop-condition */
-    if (self->postcond)
+    if (self->m_postcond)
     {
         /* enter */
-        func->curblock = bpostcond;
+        func->m_curblock = bpostcond;
 
         /* generate */
-        cgen = self->postcond->codegen;
-        if (!(*cgen)((ast_expression*)(self->postcond), func, false, &postcond))
+        cgen = self->m_postcond->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_postcond), func, false, &postcond))
             return false;
 
-        end_bpostcond = func->curblock;
+        end_bpostcond = func->m_curblock;
     }
 
     /* The incrementor */
-    if (self->increment)
+    if (self->m_increment)
     {
         /* enter */
-        func->curblock = bincrement;
+        func->m_curblock = bincrement;
 
         /* generate */
-        cgen = self->increment->codegen;
-        if (!(*cgen)((ast_expression*)(self->increment), func, false, &dummy))
+        cgen = self->m_increment->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_increment), func, false, &dummy))
             return false;
 
-        end_bincrement = func->curblock;
+        end_bincrement = func->m_curblock;
     }
 
     /* In any case now, we continue from the outgoing block */
-    func->curblock = bout;
+    func->m_curblock = bout;
 
     /* Now all blocks are in place */
     /* From 'bin' we jump to whatever comes first */
@@ -2969,7 +2966,7 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
     else                 tmpblock = bout;
     */
 
-    if (!ir_block_create_jump(bin, ast_ctx(self), tmpblock))
+    if (!ir_block_create_jump(bin, self->m_context, tmpblock))
         return false;
 
     /* From precond */
@@ -2984,12 +2981,12 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
         */
 
         onfalse = bout;
-        if (self->pre_not) {
+        if (self->m_pre_not) {
             tmpblock = ontrue;
             ontrue   = onfalse;
             onfalse  = tmpblock;
         }
-        if (!ir_block_create_if(end_bprecond, ast_ctx(self), precond, ontrue, onfalse))
+        if (!ir_block_create_if(end_bprecond, self->m_context, precond, ontrue, onfalse))
             return false;
     }
 
@@ -3000,7 +2997,7 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
         else if (bpostcond)  tmpblock = bpostcond;
         else if (bprecond)   tmpblock = bprecond;
         else                 tmpblock = bbody;
-        if (!end_bbody->final && !ir_block_create_jump(end_bbody, ast_ctx(self), tmpblock))
+        if (!end_bbody->m_final && !ir_block_create_jump(end_bbody, self->m_context, tmpblock))
             return false;
     }
 
@@ -3011,7 +3008,7 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
         else if (bprecond)   tmpblock = bprecond;
         else if (bbody)      tmpblock = bbody;
         else                 tmpblock = bout;
-        if (!ir_block_create_jump(end_bincrement, ast_ctx(self), tmpblock))
+        if (!ir_block_create_jump(end_bincrement, self->m_context, tmpblock))
             return false;
     }
 
@@ -3028,22 +3025,22 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
         */
 
         onfalse = bout;
-        if (self->post_not) {
+        if (self->m_post_not) {
             tmpblock = ontrue;
             ontrue   = onfalse;
             onfalse  = tmpblock;
         }
-        if (!ir_block_create_if(end_bpostcond, ast_ctx(self), postcond, ontrue, onfalse))
+        if (!ir_block_create_if(end_bpostcond, self->m_context, postcond, ontrue, onfalse))
             return false;
     }
 
     /* Move 'bout' to the end */
-    algo::shiftback(func->ir_func->blocks.begin() + bout_id,
-                    func->ir_func->blocks.end());
+    algo::shiftback(func->m_ir_func->m_blocks.begin() + bout_id,
+                    func->m_ir_func->m_blocks.end());
     // FIXME::DELME::
-    //func->ir_func->blocks[bout_id].release(); // it's a vector<unique_ptr<>>
-    //func->ir_func->blocks.erase(func->ir_func->blocks.begin() + bout_id);
-    //func->ir_func->blocks.emplace_back(bout);
+    //func->m_ir_func->m_blocks[bout_id].release(); // it's a vector<unique_ptr<>>
+    //func->m_ir_func->m_blocks.erase(func->m_ir_func->m_blocks.begin() + bout_id);
+    //func->m_ir_func->m_blocks.emplace_back(bout);
 
     return true;
 }
@@ -3055,27 +3052,27 @@ bool ast_breakcont_codegen(ast_breakcont *self, ast_function *func, bool lvalue,
     *out = nullptr;
 
     if (lvalue) {
-        compile_error(ast_ctx(self), "break/continue expression is not an l-value");
+        compile_error(self->m_context, "break/continue expression is not an l-value");
         return false;
     }
 
-    if (self->outr) {
-        compile_error(ast_ctx(self), "internal error: ast_breakcont cannot be reused!");
+    if (self->m_outr) {
+        compile_error(self->m_context, "internal error: ast_breakcont cannot be reused!");
         return false;
     }
-    self->outr = (ir_value*)1;
+    self->m_outr = (ir_value*)1;
 
-    if (self->is_continue)
-        target = func->continueblocks[func->continueblocks.size()-1-self->levels];
+    if (self->m_is_continue)
+        target = func->m_continueblocks[func->m_continueblocks.size()-1-self->m_levels];
     else
-        target = func->breakblocks[func->breakblocks.size()-1-self->levels];
+        target = func->m_breakblocks[func->m_breakblocks.size()-1-self->m_levels];
 
     if (!target) {
-        compile_error(ast_ctx(self), "%s is lacking a target block", (self->is_continue ? "continue" : "break"));
+        compile_error(self->m_context, "%s is lacking a target block", (self->m_is_continue ? "continue" : "break"));
         return false;
     }
 
-    if (!ir_block_create_jump(func->curblock, ast_ctx(self), target))
+    if (!ir_block_create_jump(func->m_curblock, self->m_context, target))
         return false;
     return true;
 }
@@ -3099,95 +3096,95 @@ bool ast_switch_codegen(ast_switch *self, ast_function *func, bool lvalue, ir_va
     uint16_t  cmpinstr;
 
     if (lvalue) {
-        compile_error(ast_ctx(self), "switch expression is not an l-value");
+        compile_error(self->m_context, "switch expression is not an l-value");
         return false;
     }
 
-    if (self->outr) {
-        compile_error(ast_ctx(self), "internal error: ast_switch cannot be reused!");
+    if (self->m_outr) {
+        compile_error(self->m_context, "internal error: ast_switch cannot be reused!");
         return false;
     }
-    self->outr = (ir_value*)1;
+    self->m_outr = (ir_value*)1;
 
     (void)lvalue;
     (void)out;
 
-    cgen = self->operand->codegen;
-    if (!(*cgen)((ast_expression*)(self->operand), func, false, &irop))
+    cgen = self->m_operand->m_codegen;
+    if (!(*cgen)((ast_expression*)(self->m_operand), func, false, &irop))
         return false;
 
-    if (self->cases.empty())
+    if (self->m_cases.empty())
         return true;
 
-    cmpinstr = type_eq_instr[irop->vtype];
+    cmpinstr = type_eq_instr[irop->m_vtype];
     if (cmpinstr >= VINSTR_END) {
-        ast_type_to_string(self->operand, typestr, sizeof(typestr));
-        compile_error(ast_ctx(self), "invalid type to perform a switch on: %s", typestr);
+        ast_type_to_string(self->m_operand, typestr, sizeof(typestr));
+        compile_error(self->m_context, "invalid type to perform a switch on: %s", typestr);
         return false;
     }
 
-    bout_id = func->ir_func->blocks.size();
-    bout = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "after_switch"));
+    bout_id = func->m_ir_func->m_blocks.size();
+    bout = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "after_switch"));
     if (!bout)
         return false;
 
     /* setup the break block */
-    func->breakblocks.push_back(bout);
+    func->m_breakblocks.push_back(bout);
 
     /* Now create all cases */
-    for (auto &it : self->cases) {
+    for (auto &it : self->m_cases) {
         ir_value *cond, *val;
         ir_block *bcase, *bnot;
         size_t bnot_id;
 
         ast_switch_case *swcase = &it;
 
-        if (swcase->value) {
+        if (swcase->m_value) {
             /* A regular case */
             /* generate the condition operand */
-            cgen = swcase->value->codegen;
-            if (!(*cgen)((ast_expression*)(swcase->value), func, false, &val))
+            cgen = swcase->m_value->m_codegen;
+            if (!(*cgen)((ast_expression*)(swcase->m_value), func, false, &val))
                 return false;
             /* generate the condition */
-            cond = ir_block_create_binop(func->curblock, ast_ctx(self), ast_function_label(func, "switch_eq"), cmpinstr, irop, val);
+            cond = ir_block_create_binop(func->m_curblock, self->m_context, ast_function_label(func, "switch_eq"), cmpinstr, irop, val);
             if (!cond)
                 return false;
 
-            bcase = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "case"));
-            bnot_id = func->ir_func->blocks.size();
-            bnot = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "not_case"));
+            bcase = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "case"));
+            bnot_id = func->m_ir_func->m_blocks.size();
+            bnot = ir_function_create_block(self->m_context, func->m_ir_func, ast_function_label(func, "not_case"));
             if (!bcase || !bnot)
                 return false;
             if (set_def_bfall_to) {
                 set_def_bfall_to = false;
                 def_bfall_to = bcase;
             }
-            if (!ir_block_create_if(func->curblock, ast_ctx(self), cond, bcase, bnot))
+            if (!ir_block_create_if(func->m_curblock, self->m_context, cond, bcase, bnot))
                 return false;
 
             /* Make the previous case-end fall through */
-            if (bfall && !bfall->final) {
-                if (!ir_block_create_jump(bfall, ast_ctx(self), bcase))
+            if (bfall && !bfall->m_final) {
+                if (!ir_block_create_jump(bfall, self->m_context, bcase))
                     return false;
             }
 
             /* enter the case */
-            func->curblock = bcase;
-            cgen = swcase->code->codegen;
-            if (!(*cgen)((ast_expression*)swcase->code, func, false, &dummy))
+            func->m_curblock = bcase;
+            cgen = swcase->m_code->m_codegen;
+            if (!(*cgen)((ast_expression*)swcase->m_code, func, false, &dummy))
                 return false;
 
             /* remember this block to fall through from */
-            bfall = func->curblock;
+            bfall = func->m_curblock;
 
             /* enter the else and move it down */
-            func->curblock = bnot;
-            algo::shiftback(func->ir_func->blocks.begin() + bnot_id,
-                            func->ir_func->blocks.end());
+            func->m_curblock = bnot;
+            algo::shiftback(func->m_ir_func->m_blocks.begin() + bnot_id,
+                            func->m_ir_func->m_blocks.end());
             // FIXME::DELME::
-            //func->ir_func->blocks[bnot_id].release();
-            //func->ir_func->blocks.erase(func->ir_func->blocks.begin() + bnot_id);
-            //func->ir_func->blocks.emplace_back(bnot);
+            //func->m_ir_func->m_blocks[bnot_id].release();
+            //func->m_ir_func->m_blocks.erase(func->m_ir_func->m_blocks.begin() + bnot_id);
+            //func->m_ir_func->m_blocks.emplace_back(bnot);
         } else {
             /* The default case */
             /* Remember where to fall through from: */
@@ -3201,9 +3198,9 @@ bool ast_switch_codegen(ast_switch *self, ast_function *func, bool lvalue, ir_va
     }
 
     /* Jump from the last bnot to bout */
-    if (bfall && !bfall->final && !ir_block_create_jump(bfall, ast_ctx(self), bout)) {
+    if (bfall && !bfall->m_final && !ir_block_create_jump(bfall, self->m_context, bout)) {
         /*
-        astwarning(ast_ctx(bfall), WARN_???, "missing break after last case");
+        astwarning(bfall->m_context, WARN_???, "missing break after last case");
         */
         return false;
     }
@@ -3213,43 +3210,43 @@ bool ast_switch_codegen(ast_switch *self, ast_function *func, bool lvalue, ir_va
         ir_block *bcase;
 
         /* No need to create an extra block */
-        bcase = func->curblock;
+        bcase = func->m_curblock;
 
         /* Insert the fallthrough jump */
-        if (def_bfall && !def_bfall->final) {
-            if (!ir_block_create_jump(def_bfall, ast_ctx(self), bcase))
+        if (def_bfall && !def_bfall->m_final) {
+            if (!ir_block_create_jump(def_bfall, self->m_context, bcase))
                 return false;
         }
 
         /* Now generate the default code */
-        cgen = def_case->code->codegen;
-        if (!(*cgen)((ast_expression*)def_case->code, func, false, &dummy))
+        cgen = def_case->m_code->m_codegen;
+        if (!(*cgen)((ast_expression*)def_case->m_code, func, false, &dummy))
             return false;
 
         /* see if we need to fall through */
-        if (def_bfall_to && !func->curblock->final)
+        if (def_bfall_to && !func->m_curblock->m_final)
         {
-            if (!ir_block_create_jump(func->curblock, ast_ctx(self), def_bfall_to))
+            if (!ir_block_create_jump(func->m_curblock, self->m_context, def_bfall_to))
                 return false;
         }
     }
 
     /* Jump from the last bnot to bout */
-    if (!func->curblock->final && !ir_block_create_jump(func->curblock, ast_ctx(self), bout))
+    if (!func->m_curblock->m_final && !ir_block_create_jump(func->m_curblock, self->m_context, bout))
         return false;
     /* enter the outgoing block */
-    func->curblock = bout;
+    func->m_curblock = bout;
 
     /* restore the break block */
-    func->breakblocks.pop_back();
+    func->m_breakblocks.pop_back();
 
     /* Move 'bout' to the end, it's nicer */
-    algo::shiftback(func->ir_func->blocks.begin() + bout_id,
-                    func->ir_func->blocks.end());
+    algo::shiftback(func->m_ir_func->m_blocks.begin() + bout_id,
+                    func->m_ir_func->m_blocks.end());
     // FIXME::DELME::
-    //func->ir_func->blocks[bout_id].release();
-    //func->ir_func->blocks.erase(func->ir_func->blocks.begin() + bout_id);
-    //func->ir_func->blocks.emplace_back(bout);
+    //func->m_ir_func->m_blocks[bout_id].release();
+    //func->m_ir_func->m_blocks.erase(func->m_ir_func->m_blocks.begin() + bout_id);
+    //func->m_ir_func->m_blocks.emplace_back(bout);
 
     return true;
 }
@@ -3258,33 +3255,33 @@ bool ast_label_codegen(ast_label *self, ast_function *func, bool lvalue, ir_valu
 {
     ir_value *dummy;
 
-    if (self->undefined) {
-        compile_error(ast_ctx(self), "internal error: ast_label never defined");
+    if (self->m_undefined) {
+        compile_error(self->m_context, "internal error: ast_label never defined");
         return false;
     }
 
     *out = nullptr;
     if (lvalue) {
-        compile_error(ast_ctx(self), "internal error: ast_label cannot be an lvalue");
+        compile_error(self->m_context, "internal error: ast_label cannot be an lvalue");
         return false;
     }
 
     /* simply create a new block and jump to it */
-    self->irblock = ir_function_create_block(ast_ctx(self), func->ir_func, self->name);
-    if (!self->irblock) {
-        compile_error(ast_ctx(self), "failed to allocate label block `%s`", self->name);
+    self->m_irblock = ir_function_create_block(self->m_context, func->m_ir_func, self->m_name);
+    if (!self->m_irblock) {
+        compile_error(self->m_context, "failed to allocate label block `%s`", self->m_name);
         return false;
     }
-    if (!func->curblock->final) {
-        if (!ir_block_create_jump(func->curblock, ast_ctx(self), self->irblock))
+    if (!func->m_curblock->m_final) {
+        if (!ir_block_create_jump(func->m_curblock, self->m_context, self->m_irblock))
             return false;
     }
 
     /* enter the new block */
-    func->curblock = self->irblock;
+    func->m_curblock = self->m_irblock;
 
     /* Generate all the leftover gotos */
-    for (auto &it : self->gotos) {
+    for (auto &it : self->m_gotos) {
         if (!ast_goto_codegen(it, func, false, &dummy))
             return false;
     }
@@ -3296,23 +3293,23 @@ bool ast_goto_codegen(ast_goto *self, ast_function *func, bool lvalue, ir_value
 {
     *out = nullptr;
     if (lvalue) {
-        compile_error(ast_ctx(self), "internal error: ast_goto cannot be an lvalue");
+        compile_error(self->m_context, "internal error: ast_goto cannot be an lvalue");
         return false;
     }
 
-    if (self->target->irblock) {
-        if (self->irblock_from) {
+    if (self->m_target->m_irblock) {
+        if (self->m_irblock_from) {
             /* we already tried once, this is the callback */
-            self->irblock_from->final = false;
-            if (!ir_block_create_goto(self->irblock_from, ast_ctx(self), self->target->irblock)) {
-                compile_error(ast_ctx(self), "failed to generate goto to `%s`", self->name);
+            self->m_irblock_from->m_final = false;
+            if (!ir_block_create_goto(self->m_irblock_from, self->m_context, self->m_target->m_irblock)) {
+                compile_error(self->m_context, "failed to generate goto to `%s`", self->m_name);
                 return false;
             }
         }
         else
         {
-            if (!ir_block_create_goto(func->curblock, ast_ctx(self), self->target->irblock)) {
-                compile_error(ast_ctx(self), "failed to generate goto to `%s`", self->name);
+            if (!ir_block_create_goto(func->m_curblock, self->m_context, self->m_target->m_irblock)) {
+                compile_error(self->m_context, "failed to generate goto to `%s`", self->m_name);
                 return false;
             }
         }
@@ -3322,9 +3319,9 @@ bool ast_goto_codegen(ast_goto *self, ast_function *func, bool lvalue, ir_value
         /* the target has not yet been created...
          * close this block in a sneaky way:
          */
-        func->curblock->final = true;
-        self->irblock_from = func->curblock;
-        ast_label_register_goto(self->target, self);
+        func->m_curblock->m_final = true;
+        self->m_irblock_from = func->m_curblock;
+        ast_label_register_goto(self->m_target, self);
     }
 
     return true;
@@ -3338,33 +3335,33 @@ bool ast_state_codegen(ast_state *self, ast_function *func, bool lvalue, ir_valu
     ir_value *frameval, *thinkval;
 
     if (lvalue) {
-        compile_error(ast_ctx(self), "not an l-value (state operation)");
+        compile_error(self->m_context, "not an l-value (state operation)");
         return false;
     }
-    if (self->outr) {
-        compile_error(ast_ctx(self), "internal error: ast_state cannot be reused!");
+    if (self->m_outr) {
+        compile_error(self->m_context, "internal error: ast_state cannot be reused!");
         return false;
     }
     *out = nullptr;
 
-    cgen = self->framenum->codegen;
-    if (!(*cgen)((ast_expression*)(self->framenum), func, false, &frameval))
+    cgen = self->m_framenum->m_codegen;
+    if (!(*cgen)((ast_expression*)(self->m_framenum), func, false, &frameval))
         return false;
     if (!frameval)
         return false;
 
-    cgen = self->nextthink->codegen;
-    if (!(*cgen)((ast_expression*)(self->nextthink), func, false, &thinkval))
+    cgen = self->m_nextthink->m_codegen;
+    if (!(*cgen)((ast_expression*)(self->m_nextthink), func, false, &thinkval))
         return false;
     if (!frameval)
         return false;
 
-    if (!ir_block_create_state_op(func->curblock, ast_ctx(self), frameval, thinkval)) {
-        compile_error(ast_ctx(self), "failed to create STATE instruction");
+    if (!ir_block_create_state_op(func->m_curblock, self->m_context, frameval, thinkval)) {
+        compile_error(self->m_context, "failed to create STATE instruction");
         return false;
     }
 
-    self->outr = (ir_value*)1;
+    self->m_outr = (ir_value*)1;
     return true;
 }
 
@@ -3378,25 +3375,25 @@ bool ast_call_codegen(ast_call *self, ast_function *func, bool lvalue, ir_value
 
     /* return values are never lvalues */
     if (lvalue) {
-        compile_error(ast_ctx(self), "not an l-value (function call)");
+        compile_error(self->m_context, "not an l-value (function call)");
         return false;
     }
 
-    if (self->outr) {
-        *out = self->outr;
+    if (self->m_outr) {
+        *out = self->m_outr;
         return true;
     }
 
-    cgen = self->func->codegen;
-    if (!(*cgen)((ast_expression*)(self->func), func, false, &funval))
+    cgen = self->m_func->m_codegen;
+    if (!(*cgen)((ast_expression*)(self->m_func), func, false, &funval))
         return false;
     if (!funval)
         return false;
 
     /* parameters */
-    for (auto &it : self->params) {
+    for (auto &it : self->m_params) {
         ir_value *param;
-        cgen = it->codegen;
+        cgen = it->m_codegen;
         if (!(*cgen)(it, func, false, &param))
             return false;
         if (!param)
@@ -3405,22 +3402,22 @@ bool ast_call_codegen(ast_call *self, ast_function *func, bool lvalue, ir_value
     }
 
     /* varargs counter */
-    if (self->va_count) {
+    if (self->m_va_count) {
         ir_value   *va_count;
-        ir_builder *builder = func->curblock->owner->owner;
-        cgen = self->va_count->codegen;
-        if (!(*cgen)((ast_expression*)(self->va_count), func, false, &va_count))
+        ir_builder *builder = func->m_curblock->m_owner->m_owner;
+        cgen = self->m_va_count->m_codegen;
+        if (!(*cgen)((ast_expression*)(self->m_va_count), func, false, &va_count))
             return false;
-        if (!ir_block_create_store_op(func->curblock, ast_ctx(self), INSTR_STORE_F,
+        if (!ir_block_create_store_op(func->m_curblock, self->m_context, INSTR_STORE_F,
                                       ir_builder_get_va_count(builder), va_count))
         {
             return false;
         }
     }
 
-    callinstr = ir_block_create_call(func->curblock, ast_ctx(self),
+    callinstr = ir_block_create_call(func->m_curblock, self->m_context,
                                      ast_function_label(func, "call"),
-                                     funval, !!(self->func->flags & AST_FLAG_NORETURN));
+                                     funval, !!(self->m_func->m_flags & AST_FLAG_NORETURN));
     if (!callinstr)
         return false;
 
@@ -3428,7 +3425,7 @@ bool ast_call_codegen(ast_call *self, ast_function *func, bool lvalue, ir_value
         ir_call_param(callinstr, it);
 
     *out = ir_call_value(callinstr);
-    self->outr = *out;
+    self->m_outr = *out;
 
     codegen_output_type(self, *out);
 
diff --git a/ast.h b/ast.h
index eeedfcc..8a437ab 100644 (file)
--- a/ast.h
+++ b/ast.h
@@ -93,9 +93,7 @@ enum {
     TYPE_ast_state        /* 22 */
 };
 
-#define ast_istype(x, t) ( ((ast_node*)x)->node_type == (TYPE_##t) )
-#define ast_ctx(node) (((ast_node*)(node))->context)
-#define ast_side_effects(node) (((ast_node*)(node))->side_effects)
+#define ast_istype(x, t) ( (x)->m_node_type == (TYPE_##t) )
 
 /* Node interface with common components
  */
@@ -103,23 +101,27 @@ typedef void ast_node_delete(ast_node*);
 
 struct ast_node
 {
-    lex_ctx_t context;
+    //ast_node() = delete;
+    //ast_node(lex_ctx_t, int nodetype);
+    //virtual ~ast_node();
+
+    lex_ctx_t m_context;
     /* I don't feel comfortable using keywords like 'delete' as names... */
-    ast_node_delete *destroy;
-    int              node_type;
+    ast_node_delete *m_destroy;
+    int              m_node_type;
     /* keep_node: if a node contains this node, 'keep_node'
      * prevents its dtor from destroying this node as well.
      */
-    bool             keep_node;
-    bool             side_effects;
+    bool             m_keep_node;
+    bool             m_side_effects;
 };
 
-#define ast_delete(x) (*( ((ast_node*)(x))->destroy ))((ast_node*)(x))
-#define ast_unref(x) do                     \
-{                                           \
-    if (! (((ast_node*)(x))->keep_node) ) { \
-        ast_delete(x);                      \
-    }                                       \
+#define ast_delete(x) ( (x)->m_destroy((x)) )
+#define ast_unref(x) do        \
+{                              \
+    if (! (x)->m_keep_node ) { \
+        ast_delete(x);         \
+    }                          \
 } while(0)
 
 /* Expression interface
@@ -144,25 +146,25 @@ typedef bool ast_expression_codegen(ast_expression*,
 struct ast_expression : ast_node {
     ast_expression() {}
 
-    ast_expression_codegen *codegen;
-    qc_type                 vtype;
-    ast_expression         *next;
+    ast_expression_codegen *m_codegen;
+    qc_type                 m_vtype;
+    ast_expression         *m_next;
     /* arrays get a member-count */
-    size_t                  count;
-    std::vector<ast_value*> type_params;
+    size_t                  m_count;
+    std::vector<ast_value*> m_type_params;
 
-    ast_flag_t              flags;
+    ast_flag_t              m_flags;
     /* void foo(string...) gets varparam set as a restriction
      * for variadic parameters
      */
-    ast_expression         *varparam;
+    ast_expression         *m_varparam;
     /* The codegen functions should store their output values
      * so we can call it multiple times without re-evaluating.
      * Store lvalue and rvalue seperately though. So that
      * ast_entfield for example can generate both if required.
      */
-    ir_value               *outl;
-    ir_value               *outr;
+    ir_value               *m_outl;
+    ir_value               *m_outr;
 };
 
 /* Value
@@ -184,36 +186,36 @@ union basic_value_t {
 
 struct ast_value : ast_expression
 {
-    const char *name;
-    const char *desc;
+    const char *m_name;
+    const char *m_desc;
 
-    const char *argcounter;
+    const char *m_argcounter;
 
-    int cvq;     /* const/var qualifier */
-    bool isfield; /* this declares a field */
-    bool isimm;   /* an immediate, not just const */
-    bool hasvalue;
-    bool inexact; /* inexact coming from folded expression */
-    basic_value_t constval;
+    int m_cvq;     /* const/var qualifier */
+    bool m_isfield; /* this declares a field */
+    bool m_isimm;   /* an immediate, not just const */
+    bool m_hasvalue;
+    bool m_inexact; /* inexact coming from folded expression */
+    basic_value_t m_constval;
     /* for TYPE_ARRAY we have an optional vector
      * of constants when an initializer list
      * was provided.
      */
-    std::vector<basic_value_t> initlist;
+    std::vector<basic_value_t> m_initlist;
 
     /* usecount for the parser */
-    size_t uses;
+    size_t m_uses;
 
-    ir_value *ir_v;
-    ir_value **ir_values;
-    size_t ir_value_count;
+    ir_value *m_ir_v;
+    ir_value **m_ir_values;
+    size_t m_ir_value_count;
 
     /* ONLY for arrays in progs version up to 6 */
-    ast_value *setter;
-    ast_value *getter;
+    ast_value *m_setter;
+    ast_value *m_getter;
 
 
-    bool intrinsic; /* true if associated with intrinsic */
+    bool m_intrinsic; /* true if associated with intrinsic */
 };
 
 ast_value* ast_value_new(lex_ctx_t ctx, const char *name, qc_type qctype);
@@ -252,11 +254,11 @@ enum ast_binary_ref {
  */
 struct ast_binary : ast_expression
 {
-    int op;
-    ast_expression *left;
-    ast_expression *right;
-    ast_binary_ref refs;
-    bool right_first;
+    int m_op;
+    ast_expression *m_left;
+    ast_expression *m_right;
+    ast_binary_ref m_refs;
+    bool m_right_first;
 };
 ast_binary* ast_binary_new(lex_ctx_t    ctx,
                            int        op,
@@ -270,12 +272,12 @@ ast_binary* ast_binary_new(lex_ctx_t    ctx,
  */
 struct ast_binstore : ast_expression
 {
-    int opstore;
-    int opbin;
-    ast_expression *dest;
-    ast_expression *source;
+    int m_opstore;
+    int m_opbin;
+    ast_expression *m_dest;
+    ast_expression *m_source;
     /* for &~= which uses the destination in a binary in source we can use this */
-    bool keep_dest;
+    bool m_keep_dest;
 };
 ast_binstore* ast_binstore_new(lex_ctx_t    ctx,
                                int        storeop,
@@ -289,8 +291,8 @@ ast_binstore* ast_binstore_new(lex_ctx_t    ctx,
  */
 struct ast_unary : ast_expression
 {
-    int op;
-    ast_expression *operand;
+    int m_op;
+    ast_expression *m_operand;
 };
 ast_unary* ast_unary_new(lex_ctx_t ctx,
                          int op,
@@ -304,7 +306,7 @@ ast_unary* ast_unary_new(lex_ctx_t ctx,
  */
 struct ast_return : ast_expression
 {
-    ast_expression *operand;
+    ast_expression *m_operand;
 };
 ast_return* ast_return_new(lex_ctx_t ctx,
                            ast_expression *expr);
@@ -325,9 +327,9 @@ ast_return* ast_return_new(lex_ctx_t ctx,
 struct ast_entfield : ast_expression
 {
     /* The entity can come from an expression of course. */
-    ast_expression *entity;
+    ast_expression *m_entity;
     /* As can the field, it just must result in a value of TYPE_FIELD */
-    ast_expression *field;
+    ast_expression *m_field;
 };
 ast_entfield* ast_entfield_new(lex_ctx_t ctx, ast_expression *entity, ast_expression *field);
 ast_entfield* ast_entfield_new_force(lex_ctx_t ctx, ast_expression *entity, ast_expression *field, const ast_expression *outtype);
@@ -339,10 +341,10 @@ ast_entfield* ast_entfield_new_force(lex_ctx_t ctx, ast_expression *entity, ast_
  */
 struct ast_member : ast_expression
 {
-    ast_expression *owner;
-    unsigned int field;
-    const char *name;
-    bool rvalue;
+    ast_expression *m_owner;
+    unsigned int m_field;
+    const char *m_name;
+    bool m_rvalue;
 };
 ast_member* ast_member_new(lex_ctx_t ctx, ast_expression *owner, unsigned int field, const char *name);
 void ast_member_delete(ast_member*);
@@ -361,8 +363,8 @@ bool ast_member_set_name(ast_member*, const char *name);
  */
 struct ast_array_index : ast_expression
 {
-    ast_expression *array;
-    ast_expression *index;
+    ast_expression *m_array;
+    ast_expression *m_index;
 };
 ast_array_index* ast_array_index_new(lex_ctx_t ctx, ast_expression *array, ast_expression *index);
 
@@ -372,7 +374,7 @@ ast_array_index* ast_array_index_new(lex_ctx_t ctx, ast_expression *array, ast_e
  */
 struct ast_argpipe : ast_expression
 {
-    ast_expression *index;
+    ast_expression *m_index;
 };
 ast_argpipe* ast_argpipe_new(lex_ctx_t ctx, ast_expression *index);
 
@@ -383,9 +385,9 @@ ast_argpipe* ast_argpipe_new(lex_ctx_t ctx, ast_expression *index);
  */
 struct ast_store : ast_expression
 {
-    int op;
-    ast_expression *dest;
-    ast_expression *source;
+    int m_op;
+    ast_expression *m_dest;
+    ast_expression *m_source;
 };
 ast_store* ast_store_new(lex_ctx_t ctx, int op,
                          ast_expression *d, ast_expression *s);
@@ -403,10 +405,10 @@ ast_store* ast_store_new(lex_ctx_t ctx, int op,
  */
 struct ast_ifthen : ast_expression
 {
-    ast_expression *cond;
+    ast_expression *m_cond;
     /* It's all just 'expressions', since an ast_block is one too. */
-    ast_expression *on_true;
-    ast_expression *on_false;
+    ast_expression *m_on_true;
+    ast_expression *m_on_false;
 };
 ast_ifthen* ast_ifthen_new(lex_ctx_t ctx, ast_expression *cond, ast_expression *ontrue, ast_expression *onfalse);
 
@@ -425,10 +427,10 @@ ast_ifthen* ast_ifthen_new(lex_ctx_t ctx, ast_expression *cond, ast_expression *
  */
 struct ast_ternary : ast_expression
 {
-    ast_expression *cond;
+    ast_expression *m_cond;
     /* It's all just 'expressions', since an ast_block is one too. */
-    ast_expression *on_true;
-    ast_expression *on_false;
+    ast_expression *m_on_true;
+    ast_expression *m_on_false;
 };
 ast_ternary* ast_ternary_new(lex_ctx_t ctx, ast_expression *cond, ast_expression *ontrue, ast_expression *onfalse);
 
@@ -457,19 +459,19 @@ continue:      // a 'continue' will jump here
  */
 struct ast_loop : ast_expression
 {
-    ast_expression *initexpr;
-    ast_expression *precond;
-    ast_expression *postcond;
-    ast_expression *increment;
-    ast_expression *body;
+    ast_expression *m_initexpr;
+    ast_expression *m_precond;
+    ast_expression *m_postcond;
+    ast_expression *m_increment;
+    ast_expression *m_body;
     /* For now we allow a seperate flag on whether or not the condition
      * is supposed to be true or false.
      * That way, the parser can generate a 'while not(!x)' for `while(x)`
      * if desired, which is useful for the new -f{true,false}-empty-strings
      * flag.
      */
-    bool pre_not;
-    bool post_not;
+    bool m_pre_not;
+    bool m_post_not;
 };
 ast_loop* ast_loop_new(lex_ctx_t ctx,
                        ast_expression *initexpr,
@@ -482,8 +484,8 @@ ast_loop* ast_loop_new(lex_ctx_t ctx,
  */
 struct ast_breakcont : ast_expression
 {
-    bool         is_continue;
-    unsigned int levels;
+    bool         m_is_continue;
+    unsigned int m_levels;
 };
 ast_breakcont* ast_breakcont_new(lex_ctx_t ctx, bool iscont, unsigned int levels);
 
@@ -498,14 +500,14 @@ ast_breakcont* ast_breakcont_new(lex_ctx_t ctx, bool iscont, unsigned int levels
  * TODO: Ticket #20
  */
 struct ast_switch_case {
-    ast_expression *value; /* #20 will replace this */
-    ast_expression *code;
+    ast_expression *m_value; /* #20 will replace this */
+    ast_expression *m_code;
 };
 
 struct ast_switch : ast_expression
 {
-    ast_expression *operand;
-    std::vector<ast_switch_case> cases;
+    ast_expression *m_operand;
+    std::vector<ast_switch_case> m_cases;
 };
 
 ast_switch* ast_switch_new(lex_ctx_t ctx, ast_expression *op);
@@ -516,12 +518,12 @@ ast_switch* ast_switch_new(lex_ctx_t ctx, ast_expression *op);
  */
 struct ast_label : ast_expression
 {
-    const char *name;
-    ir_block *irblock;
-    std::vector<ast_goto*> gotos;
+    const char *m_name;
+    ir_block *m_irblock;
+    std::vector<ast_goto*> m_gotos;
 
     /* means it has not yet been defined */
-    bool undefined;
+    bool m_undefined;
 };
 
 ast_label* ast_label_new(lex_ctx_t ctx, const char *name, bool undefined);
@@ -532,9 +534,9 @@ ast_label* ast_label_new(lex_ctx_t ctx, const char *name, bool undefined);
  */
 struct ast_goto : ast_expression
 {
-    const char *name;
-    ast_label *target;
-    ir_block *irblock_from;
+    const char *m_name;
+    ast_label *m_target;
+    ir_block *m_irblock_from;
 };
 
 ast_goto* ast_goto_new(lex_ctx_t ctx, const char *name);
@@ -546,8 +548,8 @@ void ast_goto_set_label(ast_goto*, ast_label*);
  */
 struct ast_state : ast_expression
 {
-    ast_expression *framenum;
-    ast_expression *nextthink;
+    ast_expression *m_framenum;
+    ast_expression *m_nextthink;
 };
 ast_state* ast_state_new(lex_ctx_t ctx, ast_expression *frame, ast_expression *think);
 void ast_state_delete(ast_state*);
@@ -564,9 +566,9 @@ void ast_state_delete(ast_state*);
  */
 struct ast_call : ast_expression
 {
-    ast_expression *func;
-    std::vector<ast_expression *> params;
-    ast_expression *va_count;
+    ast_expression *m_func;
+    std::vector<ast_expression *> m_params;
+    ast_expression *m_va_count;
 };
 ast_call* ast_call_new(lex_ctx_t ctx,
                        ast_expression *funcexpr);
@@ -577,9 +579,9 @@ bool ast_call_check_types(ast_call*, ast_expression *this_func_va_type);
  */
 struct ast_block : ast_expression
 {
-    std::vector<ast_value*>      locals;
-    std::vector<ast_expression*> exprs;
-    std::vector<ast_expression*> collect;
+    std::vector<ast_value*>      m_locals;
+    std::vector<ast_expression*> m_exprs;
+    std::vector<ast_expression*> m_collect;
 };
 ast_block* ast_block_new(lex_ctx_t ctx);
 void ast_block_delete(ast_block*);
@@ -598,39 +600,37 @@ bool GMQCC_WARN ast_block_add_expr(ast_block*, ast_expression*);
  * pointers could just work with a name. However, this way could be
  * more flexible, and adds no real complexity.
  */
-struct ast_function
+struct ast_function : ast_node
 {
-    ast_node node;
-
-    ast_value  *function_type;
-    const char *name;
+    ast_value  *m_function_type;
+    const char *m_name;
 
-    int builtin;
+    int m_builtin;
 
     /* list of used-up names for statics without the count suffix */
-    std::vector<char*> static_names;
+    std::vector<char*> m_static_names;
     /* number of static variables, by convention this includes the
      * ones without the count-suffix - remember this when dealing
      * with savegames. uint instead of size_t as %zu in printf is
      * C99, so no windows support. */
-    unsigned int static_count;
+    unsigned int m_static_count;
 
-    ir_function *ir_func;
-    ir_block *curblock;
-    std::vector<ir_block*> breakblocks;
-    std::vector<ir_block*> continueblocks;
+    ir_function *m_ir_func;
+    ir_block *m_curblock;
+    std::vector<ir_block*> m_breakblocks;
+    std::vector<ir_block*> m_continueblocks;
 
-    size_t labelcount;
+    size_t m_labelcount;
     /* in order for thread safety - for the optional
      * channel abesed multithreading... keeping a buffer
      * here to use in ast_function_label.
      */
-    char labelbuf[64];
-    std::vector<std::unique_ptr<ast_block>> blocks;
-    ast_value *varargs;
-    ast_value *argc;
-    ast_value *fixedparams;
-    ast_value *return_value;
+    char m_labelbuf[64];
+    std::vector<std::unique_ptr<ast_block>> m_blocks;
+    ast_value *m_varargs;
+    ast_value *m_argc;
+    ast_value *m_fixedparams;
+    ast_value *m_return_value;
 };
 ast_function* ast_function_new(lex_ctx_t ctx, const char *name, ast_value *vtype);
 /* This will NOT delete the underlying ast_value */
index 195e8a5..306e5ca 100644 (file)
--- a/fold.cpp
+++ b/fold.cpp
@@ -535,10 +535,10 @@ static GMQCC_INLINE void sfloat_init(sfloat_state_t *state) {
  * This file is thus, split into two parts.
  */
 
-#define isfloat(X)      (((ast_expression*)(X))->vtype == TYPE_FLOAT)
-#define isvector(X)     (((ast_expression*)(X))->vtype == TYPE_VECTOR)
-#define isstring(X)     (((ast_expression*)(X))->vtype == TYPE_STRING)
-#define isarray(X)      (((ast_expression*)(X))->vtype == TYPE_ARRAY)
+#define isfloat(X)      (((ast_expression*)(X))->m_vtype == TYPE_FLOAT)
+#define isvector(X)     (((ast_expression*)(X))->m_vtype == TYPE_VECTOR)
+#define isstring(X)     (((ast_expression*)(X))->m_vtype == TYPE_STRING)
+#define isarray(X)      (((ast_expression*)(X))->m_vtype == TYPE_ARRAY)
 #define isfloats(X,Y)   (isfloat  (X) && isfloat (Y))
 
 /*
@@ -858,15 +858,15 @@ end:
 }
 
 qcfloat_t fold::immvalue_float(ast_value *value) {
-    return value->constval.vfloat;
+    return value->m_constval.vfloat;
 }
 
 vec3_t fold::immvalue_vector(ast_value *value) {
-    return value->constval.vvec;
+    return value->m_constval.vvec;
 }
 
 const char *fold::immvalue_string(ast_value *value) {
-    return value->constval.vstring;
+    return value->m_constval.vstring;
 }
 
 lex_ctx_t fold::ctx() {
@@ -878,32 +878,32 @@ lex_ctx_t fold::ctx() {
 }
 
 bool fold::immediate_true(ast_value *v) {
-    switch (v->vtype) {
+    switch (v->m_vtype) {
         case TYPE_FLOAT:
-            return !!v->constval.vfloat;
+            return !!v->m_constval.vfloat;
         case TYPE_INTEGER:
-            return !!v->constval.vint;
+            return !!v->m_constval.vint;
         case TYPE_VECTOR:
             if (OPTS_FLAG(CORRECT_LOGIC))
-                return vec3_pbool(v->constval.vvec);
-            return !!(v->constval.vvec.x);
+                return vec3_pbool(v->m_constval.vvec);
+            return !!(v->m_constval.vvec.x);
         case TYPE_STRING:
-            if (!v->constval.vstring)
+            if (!v->m_constval.vstring)
                 return false;
             if (OPTS_FLAG(TRUE_EMPTY_STRINGS))
                 return true;
-            return !!v->constval.vstring[0];
+            return !!v->m_constval.vstring[0];
         default:
             compile_error(ctx(), "internal error: fold_immediate_true on invalid type");
             break;
     }
-    return !!v->constval.vfunc;
+    return !!v->m_constval.vfunc;
 }
 
 /* Handy macros to determine if an ast_value can be constant folded. */
 #define fold_can_1(X)  \
-    (ast_istype(((ast_expression*)(X)), ast_value) && (X)->hasvalue && ((X)->cvq == CV_CONST) && \
-                ((ast_expression*)(X))->vtype != TYPE_FUNCTION)
+    (ast_istype(((ast_expression*)(X)), ast_value) && (X)->m_hasvalue && ((X)->m_cvq == CV_CONST) && \
+                ((ast_expression*)(X))->m_vtype != TYPE_FUNCTION)
 
 #define fold_can_2(X, Y) (fold_can_1(X) && fold_can_1(Y))
 
@@ -938,7 +938,7 @@ bool fold::generate(ir_builder *ir) {
         if (!ast_global_codegen((cur = it), ir, false)) goto err;
     return true;
 err:
-    con_out("failed to generate global %s\n", cur->name);
+    con_out("failed to generate global %s\n", cur->m_name);
     delete ir;
     return false;
 }
@@ -957,14 +957,14 @@ fold::~fold() {
 
 ast_expression *fold::constgen_float(qcfloat_t value, bool inexact) {
     for (auto &it : m_imm_float)
-        if (!memcmp(&it->constval.vfloat, &value, sizeof(qcfloat_t)))
+        if (!memcmp(&it->m_constval.vfloat, &value, sizeof(qcfloat_t)))
             return (ast_expression*)it;
 
     ast_value *out  = ast_value_new(ctx(), "#IMMEDIATE", TYPE_FLOAT);
-    out->cvq = CV_CONST;
-    out->hasvalue = true;
-    out->inexact = inexact;
-    out->constval.vfloat = value;
+    out->m_cvq = CV_CONST;
+    out->m_hasvalue = true;
+    out->m_inexact = inexact;
+    out->m_constval.vfloat = value;
 
     m_imm_float.push_back(out);
 
@@ -973,13 +973,13 @@ ast_expression *fold::constgen_float(qcfloat_t value, bool inexact) {
 
 ast_expression *fold::constgen_vector(vec3_t value) {
     for (auto &it : m_imm_vector)
-        if (vec3_cmp(it->constval.vvec, value))
+        if (vec3_cmp(it->m_constval.vvec, value))
             return (ast_expression*)it;
 
     ast_value *out = ast_value_new(ctx(), "#IMMEDIATE", TYPE_VECTOR);
-    out->cvq = CV_CONST;
-    out->hasvalue = true;
-    out->constval.vvec = value;
+    out->m_cvq = CV_CONST;
+    out->m_hasvalue = true;
+    out->m_constval.vvec = value;
 
     m_imm_vector.push_back(out);
 
@@ -998,15 +998,15 @@ ast_expression *fold::constgen_string(const char *str, bool translate) {
         char name[32];
         util_snprintf(name, sizeof(name), "dotranslate_%zu", m_parser->translated++);
         out = ast_value_new(ctx(), name, TYPE_STRING);
-        out->flags |= AST_FLAG_INCLUDE_DEF; /* def needs to be included for translatables */
+        out->m_flags |= AST_FLAG_INCLUDE_DEF; /* def needs to be included for translatables */
     } else {
         out = ast_value_new(ctx(), "#IMMEDIATE", TYPE_STRING);
     }
 
-    out->cvq = CV_CONST;
-    out->hasvalue = true;
-    out->isimm = true;
-    out->constval.vstring = parser_strdup(str);
+    out->m_cvq = CV_CONST;
+    out->m_hasvalue = true;
+    out->m_isimm = true;
+    out->m_constval.vstring = parser_strdup(str);
 
     m_imm_string.push_back(out);
     util_htseth(table, str, hash, out);
@@ -1057,7 +1057,7 @@ inexact_possible:
 bool fold::check_inexact_float(ast_value *a, ast_value *b) {
     if (!OPTS_WARN(WARN_INEXACT_COMPARES))
         return false;
-    if (!a->inexact && !b->inexact)
+    if (!a->m_inexact && !b->m_inexact)
         return false;
     return compile_warning(ctx(), WARN_INEXACT_COMPARES, "inexact value in comparison");
 }
@@ -1070,8 +1070,8 @@ ast_expression *fold::op_mul_vec(vec3_t vec, ast_value *sel, const char *set) {
         ast_expression *out;
         ++opts_optimizationcount[OPTIM_VECTOR_COMPONENTS];
         out = (ast_expression*)ast_member_new(ctx(), (ast_expression*)sel, set[0]-'x', nullptr);
-        out->keep_node = false;
-        ((ast_member*)out)->rvalue = true;
+        out->m_keep_node = false;
+        ((ast_member*)out)->m_rvalue = true;
         if (x != -1.0f)
             return (ast_expression*)ast_binary_new(ctx(), INSTR_MUL_F, constgen_float(x, false), out);
     }
@@ -1370,7 +1370,7 @@ ast_expression *fold::op_length(ast_value *a) {
     if (fold_can_1(a) && isstring(a))
         return constgen_float(strlen(immvalue_string(a)), false);
     if (isarray(a))
-        return constgen_float(a->initlist.size(), false);
+        return constgen_float(a->m_initlist.size(), false);
     return nullptr;
 }
 
@@ -1522,18 +1522,18 @@ ast_expression *fold::intrinsic(const char *intrinsic, ast_expression **arg) {
 #undef fold_can_1
 #undef fold_can_2
 
-#define isfloat(X)              ((X)->vtype == TYPE_FLOAT)
-/*#define isstring(X)             ((X)->vtype == TYPE_STRING)*/
-/*#define isvector(X)             ((X)->vtype == TYPE_VECTOR)*/
-#define fold_can_1(X)           ((X)->hasvalue && (X)->cvq == CV_CONST)
+#define isfloat(X)              ((X)->m_vtype == TYPE_FLOAT)
+/*#define isstring(X)             ((X)->m_vtype == TYPE_STRING)*/
+/*#define isvector(X)             ((X)->m_vtype == TYPE_VECTOR)*/
+#define fold_can_1(X)           ((X)->m_hasvalue && (X)->m_cvq == CV_CONST)
 /*#define fold_can_2(X,Y)         (fold_can_1(X) && fold_can_1(Y))*/
 
 qcfloat_t fold::immvalue_float(ir_value *value) {
-    return value->constval.vfloat;
+    return value->m_constval.vfloat;
 }
 
 vec3_t fold::immvalue_vector(ir_value *value) {
-    return value->constval.vvec;
+    return value->m_constval.vvec;
 }
 
 ast_expression *fold::superfluous(ast_expression *left, ast_expression *right, int op) {
@@ -1608,10 +1608,10 @@ int fold::cond(ir_value *condval, ast_function *func, ast_ifthen *branch) {
         ast_expression_codegen *cgen;
         ir_block               *elide;
         ir_value               *dummy;
-        bool                    istrue  = (immvalue_float(condval) != 0.0f && branch->on_true);
-        bool                    isfalse = (immvalue_float(condval) == 0.0f && branch->on_false);
-        ast_expression         *path    = (istrue)  ? branch->on_true  :
-                                          (isfalse) ? branch->on_false : nullptr;
+        bool                    istrue  = (immvalue_float(condval) != 0.0f && branch->m_on_true);
+        bool                    isfalse = (immvalue_float(condval) == 0.0f && branch->m_on_false);
+        ast_expression         *path    = (istrue)  ? branch->m_on_true  :
+                                          (isfalse) ? branch->m_on_false : nullptr;
         if (!path) {
             /*
              * no path to take implies that the evaluation is if(0) and there
@@ -1621,17 +1621,17 @@ int fold::cond(ir_value *condval, ast_function *func, ast_ifthen *branch) {
             return true;
         }
 
-        if (!(elide = ir_function_create_block(ast_ctx(branch), func->ir_func, ast_function_label(func, ((istrue) ? "ontrue" : "onfalse")))))
+        if (!(elide = ir_function_create_block(branch->m_context, func->m_ir_func, ast_function_label(func, ((istrue) ? "ontrue" : "onfalse")))))
             return false;
-        if (!(*(cgen = path->codegen))((ast_expression*)path, func, false, &dummy))
+        if (!(*(cgen = path->m_codegen))((ast_expression*)path, func, false, &dummy))
             return false;
-        if (!ir_block_create_jump(func->curblock, ast_ctx(branch), elide))
+        if (!ir_block_create_jump(func->m_curblock, branch->m_context, elide))
             return false;
         /*
          * now the branch has been eliminated and the correct block for the constant evaluation
          * is expanded into the current block for the function.
          */
-        func->curblock = elide;
+        func->m_curblock = elide;
         ++opts_optimizationcount[OPTIM_CONST_FOLD_DCE];
         return true;
     }
index ebdacd9..cc6250b 100644 (file)
@@ -18,10 +18,10 @@ ast_function *intrin::value(ast_value **out, const char *name, qc_type vtype) {
     util_snprintf(stype,  sizeof(stype),   "<%s>",        type_name[vtype]);
 
     value = ast_value_new(ctx(), buffer, TYPE_FUNCTION);
-    value->intrinsic = true;
-    value->next = (ast_expression*)ast_value_new(ctx(), stype, vtype);
+    value->m_intrinsic = true;
+    value->m_next = (ast_expression*)ast_value_new(ctx(), stype, vtype);
     func = ast_function_new(ctx(), buffer, value);
-    value->flags |= AST_FLAG_ERASEABLE;
+    value->m_flags |= AST_FLAG_ERASEABLE;
 
     *out = value;
     return func;
@@ -55,16 +55,16 @@ ast_expression *intrin::isfinite_() {
     ast_block    *block     = ast_block_new(ctx());
 
     /* float x; */
-    val->type_params.push_back(x);
+    val->m_type_params.push_back(x);
 
     /* <callisnan> = isnan(x); */
-    callisnan->params.push_back((ast_expression*)x);
+    callisnan->m_params.push_back((ast_expression*)x);
 
     /* <callisinf> = isinf(x); */
-    callisinf->params.push_back((ast_expression*)x);
+    callisinf->m_params.push_back((ast_expression*)x);
 
     /* return (!<callisnan> || <callisinf>); */
-    block->exprs.push_back(
+    block->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)ast_unary_new(
@@ -80,7 +80,7 @@ ast_expression *intrin::isfinite_() {
         )
     );
 
-    func->blocks.emplace_back(block);
+    func->m_blocks.emplace_back(block);
     reg(val, func);
 
     return (ast_expression*)val;;
@@ -97,7 +97,7 @@ ast_expression *intrin::isinf_() {
     ast_block *body = ast_block_new(ctx());
     ast_function *func = value(&val, "isinf", TYPE_FLOAT);
 
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -124,8 +124,8 @@ ast_expression *intrin::isinf_() {
         )
     );
 
-    val->type_params.push_back(x);
-    func->blocks.emplace_back(body);
+    val->m_type_params.push_back(x);
+    func->m_blocks.emplace_back(body);
 
     reg(val, func);
 
@@ -147,8 +147,8 @@ ast_expression *intrin::isnan_() {
     ast_block *body  = ast_block_new(ctx());
     ast_function *func = value(&val, "isnan", TYPE_FLOAT);
 
-    body->locals.push_back(local);
-    body->exprs.push_back(
+    body->m_locals.push_back(local);
+    body->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -157,7 +157,7 @@ ast_expression *intrin::isnan_() {
         )
     );
 
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -169,8 +169,8 @@ ast_expression *intrin::isnan_() {
         )
     );
 
-    val->type_params.push_back(arg1);
-    func->blocks.emplace_back(body);
+    val->m_type_params.push_back(arg1);
+    func->m_blocks.emplace_back(body);
 
     reg(val, func);
 
@@ -189,18 +189,18 @@ ast_expression *intrin::isnormal_() {
     ast_block *body = ast_block_new(ctx());
     ast_function *func = value(&val, "isnormal", TYPE_FLOAT);
 
-    val->type_params.push_back(x);
-    callisfinite->params.push_back((ast_expression*)x);
+    val->m_type_params.push_back(x);
+    callisfinite->m_params.push_back((ast_expression*)x);
 
     /* return <callisfinite> */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)callisfinite
         )
     );
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -216,10 +216,10 @@ ast_expression *intrin::signbit_() {
     ast_block *body = ast_block_new(ctx());
     ast_function *func = value(&val, "signbit", TYPE_FLOAT);
 
-    val->type_params.push_back(x);
+    val->m_type_params.push_back(x);
 
     /* return (x < 0); */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)ast_ternary_new(
@@ -236,7 +236,7 @@ ast_expression *intrin::signbit_() {
         )
     );
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -254,10 +254,10 @@ ast_expression *intrin::acosh_() {
     ast_block    *body     = ast_block_new(ctx());
     ast_function *func     = value(&val, "acosh", TYPE_FLOAT);
 
-    val->type_params.push_back(x);
+    val->m_type_params.push_back(x);
 
     /* <callsqrt> = sqrt((x * x) - 1); */
-    callsqrt->params.push_back(
+    callsqrt->m_params.push_back(
         (ast_expression*)ast_binary_new(
             ctx(),
             INSTR_SUB_F,
@@ -272,7 +272,7 @@ ast_expression *intrin::acosh_() {
     );
 
     /* <calllog> = log(x + <callsqrt>); */
-    calllog->params.push_back(
+    calllog->m_params.push_back(
         (ast_expression*)ast_binary_new(
             ctx(),
             INSTR_ADD_F,
@@ -282,14 +282,14 @@ ast_expression *intrin::acosh_() {
     );
 
     /* return <calllog>; */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)calllog
         )
     );
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -307,10 +307,10 @@ ast_expression *intrin::asinh_() {
     ast_block *body = ast_block_new(ctx());
     ast_function *func = value(&val, "asinh", TYPE_FLOAT);
 
-    val->type_params.push_back(x);
+    val->m_type_params.push_back(x);
 
     /* <callsqrt> = sqrt((x * x) + 1); */
-    callsqrt->params.push_back(
+    callsqrt->m_params.push_back(
         (ast_expression*)ast_binary_new(
             ctx(),
             INSTR_ADD_F,
@@ -325,7 +325,7 @@ ast_expression *intrin::asinh_() {
     );
 
     /* <calllog> = log(x + <callsqrt>); */
-    calllog->params.push_back(
+    calllog->m_params.push_back(
         (ast_expression*)ast_binary_new(
             ctx(),
             INSTR_ADD_F,
@@ -335,14 +335,14 @@ ast_expression *intrin::asinh_() {
     );
 
     /* return <calllog>; */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)calllog
         )
     );
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -359,10 +359,10 @@ ast_expression *intrin::atanh_() {
     ast_block    *body    = ast_block_new(ctx());
     ast_function *func    = value(&val, "atanh", TYPE_FLOAT);
 
-    val->type_params.push_back(x);
+    val->m_type_params.push_back(x);
 
     /* <callog> = log((1 + x) / (1 - x)); */
-    calllog->params.push_back(
+    calllog->m_params.push_back(
         (ast_expression*)ast_binary_new(
             ctx(),
             INSTR_DIV_F,
@@ -382,7 +382,7 @@ ast_expression *intrin::atanh_() {
     );
 
     /* return 0.5 * <calllog>; */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_binary_new(
             ctx(),
             INSTR_MUL_F,
@@ -391,7 +391,7 @@ ast_expression *intrin::atanh_() {
         )
     );
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -416,14 +416,14 @@ ast_expression *intrin::exp_() {
     ast_block *body = ast_block_new(ctx());
     ast_function *func = value(&val, "exp", TYPE_FLOAT);
 
-    val->type_params.push_back(x);
+    val->m_type_params.push_back(x);
 
-    body->locals.push_back(sum);
-    body->locals.push_back(acc);
-    body->locals.push_back(i);
+    body->m_locals.push_back(sum);
+    body->m_locals.push_back(acc);
+    body->m_locals.push_back(i);
 
     /* sum = 1.0; */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -433,7 +433,7 @@ ast_expression *intrin::exp_() {
     );
 
     /* acc = 1.0; */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -446,7 +446,7 @@ ast_expression *intrin::exp_() {
      * for (i = 1; i < 200; ++i)
      *     sum += (acc *= x / i);
      */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_loop_new(
             ctx(),
             /* i = 1; */
@@ -497,14 +497,14 @@ ast_expression *intrin::exp_() {
     );
 
     /* return sum; */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)sum
         )
     );
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -521,20 +521,20 @@ ast_expression *intrin::exp2_() {
     ast_block *body = ast_block_new(ctx());
     ast_function *func = value(&val, "exp2", TYPE_FLOAT);
 
-    val->type_params.push_back(arg1);
+    val->m_type_params.push_back(arg1);
 
-    callpow->params.push_back((ast_expression*)m_fold->m_imm_float[3]);
-    callpow->params.push_back((ast_expression*)arg1);
+    callpow->m_params.push_back((ast_expression*)m_fold->m_imm_float[3]);
+    callpow->m_params.push_back((ast_expression*)arg1);
 
     /* return <callpow> */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)callpow
         )
     );
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -551,13 +551,13 @@ ast_expression *intrin::expm1_() {
     ast_block *body = ast_block_new(ctx());
     ast_function *func = value(&val, "expm1", TYPE_FLOAT);
 
-    val->type_params.push_back(x);
+    val->m_type_params.push_back(x);
 
     /* <callexp> = exp(x); */
-    callexp->params.push_back((ast_expression*)x);
+    callexp->m_params.push_back((ast_expression*)x);
 
     /* return <callexp> - 1; */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -569,7 +569,7 @@ ast_expression *intrin::expm1_() {
         )
     );
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -652,21 +652,21 @@ ast_expression *intrin::pow_() {
     ast_value *square     = ast_value_new(ctx(), "square",     TYPE_FLOAT);
     ast_value *accumulate = ast_value_new(ctx(), "accumulate", TYPE_FLOAT);
     ast_value *mid        = ast_value_new(ctx(), "mid",        TYPE_FLOAT);
-    body->locals.push_back(result);
-    body->locals.push_back(low);
-    body->locals.push_back(high);
-    body->locals.push_back(square);
-    body->locals.push_back(accumulate);
-    body->locals.push_back(mid);
+    body->m_locals.push_back(result);
+    body->m_locals.push_back(low);
+    body->m_locals.push_back(high);
+    body->m_locals.push_back(square);
+    body->m_locals.push_back(accumulate);
+    body->m_locals.push_back(mid);
 
-    val->type_params.push_back(base);
-    val->type_params.push_back(exp);
+    val->m_type_params.push_back(base);
+    val->m_type_params.push_back(exp);
 
     /*
      * if (exp == 0.0)
      *     return 1;
      */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_ifthen_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -687,7 +687,7 @@ ast_expression *intrin::pow_() {
      * if (exp == 1.0)
      *     return base;
      */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_ifthen_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -705,8 +705,8 @@ ast_expression *intrin::pow_() {
     );
 
     /* <callpow1> = pow(base, -exp) */
-    callpow1->params.push_back((ast_expression*)base);
-    callpow1->params.push_back(
+    callpow1->m_params.push_back((ast_expression*)base);
+    callpow1->m_params.push_back(
         (ast_expression*)ast_unary_new(
             ctx(),
             VINSTR_NEG_F,
@@ -718,7 +718,7 @@ ast_expression *intrin::pow_() {
      * if (exp < 0)
      *     return 1.0 / <callpow1>;
      */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_ifthen_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -741,8 +741,8 @@ ast_expression *intrin::pow_() {
     );
 
     /* <callpow2> = pow(base, exp / 2) */
-    callpow2->params.push_back((ast_expression*)base);
-    callpow2->params.push_back(
+    callpow2->m_params.push_back((ast_expression*)base);
+    callpow2->m_params.push_back(
         (ast_expression*)ast_binary_new(
             ctx(),
             INSTR_DIV_F,
@@ -757,7 +757,7 @@ ast_expression *intrin::pow_() {
      *     return result * result;
      * }
      */
-    expgt1->exprs.push_back(
+    expgt1->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -765,7 +765,7 @@ ast_expression *intrin::pow_() {
             (ast_expression*)callpow2
         )
     );
-    expgt1->exprs.push_back(
+    expgt1->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -782,7 +782,7 @@ ast_expression *intrin::pow_() {
      *     <expgt1>
      * }
      */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_ifthen_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -799,7 +799,7 @@ ast_expression *intrin::pow_() {
     /*
      * <callsqrt1> = sqrt(base)
      */
-    callsqrt1->params.push_back((ast_expression*)base);
+    callsqrt1->m_params.push_back((ast_expression*)base);
 
     /*
      * low        = 0.0f;
@@ -808,14 +808,14 @@ ast_expression *intrin::pow_() {
      * accumulate = square;
      * mid        = high / 2.0f;
      */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_store_new(ctx(),
             INSTR_STORE_F,
             (ast_expression*)low,
             (ast_expression*)m_fold->m_imm_float[0]
         )
     );
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -824,7 +824,7 @@ ast_expression *intrin::pow_() {
         )
     );
 
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -833,7 +833,7 @@ ast_expression *intrin::pow_() {
         )
     );
 
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -841,7 +841,7 @@ ast_expression *intrin::pow_() {
             (ast_expression*)square
         )
     );
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -861,7 +861,7 @@ ast_expression *intrin::pow_() {
      *     accumulate *= square;
      * }
      */
-    midltexp->exprs.push_back(
+    midltexp->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -869,7 +869,7 @@ ast_expression *intrin::pow_() {
             (ast_expression*)mid
         )
     );
-    midltexp->exprs.push_back(
+    midltexp->m_exprs.push_back(
         (ast_expression*)ast_binstore_new(
             ctx(),
             INSTR_STORE_F,
@@ -885,7 +885,7 @@ ast_expression *intrin::pow_() {
      *     accumulate *= (1.0 / square);
      * }
      */
-    midltexpelse->exprs.push_back(
+    midltexpelse->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -893,7 +893,7 @@ ast_expression *intrin::pow_() {
             (ast_expression*)mid
         )
     );
-    midltexpelse->exprs.push_back(
+    midltexpelse->m_exprs.push_back(
         (ast_expression*)ast_binstore_new(
             ctx(),
             INSTR_STORE_F,
@@ -911,7 +911,7 @@ ast_expression *intrin::pow_() {
     /*
      * <callsqrt2> = sqrt(square)
      */
-    callsqrt2->params.push_back((ast_expression*)square);
+    callsqrt2->m_params.push_back((ast_expression*)square);
 
     /*
      * <whileblock> = {
@@ -924,7 +924,7 @@ ast_expression *intrin::pow_() {
      *     mid = (low + high) / 2;
      * }
      */
-    whileblock->exprs.push_back(
+    whileblock->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -932,7 +932,7 @@ ast_expression *intrin::pow_() {
             (ast_expression*)callsqrt2
         )
     );
-    whileblock->exprs.push_back(
+    whileblock->m_exprs.push_back(
         (ast_expression*)ast_ifthen_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -945,7 +945,7 @@ ast_expression *intrin::pow_() {
             (ast_expression*)midltexpelse
         )
     );
-    whileblock->exprs.push_back(
+    whileblock->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -967,7 +967,7 @@ ast_expression *intrin::pow_() {
     /*
      * <callabs> = fabs(mid - exp)
      */
-    callfabs->params.push_back(
+    callfabs->m_params.push_back(
         (ast_expression*)ast_binary_new(
             ctx(),
             INSTR_SUB_F,
@@ -980,7 +980,7 @@ ast_expression *intrin::pow_() {
      * while (<callfabs>  > epsilon)
      *     <whileblock>
      */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_loop_new(
             ctx(),
             /* init */
@@ -1006,7 +1006,7 @@ ast_expression *intrin::pow_() {
     );
 
     /* return accumulate */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)accumulate
@@ -1014,7 +1014,7 @@ ast_expression *intrin::pow_() {
     );
 
     /* } */
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -1036,14 +1036,14 @@ ast_expression *intrin::mod_() {
     ast_block    *body  = ast_block_new(ctx());
     ast_function *func  = value(&val, "mod", TYPE_FLOAT);
 
-    val->type_params.push_back(a);
-    val->type_params.push_back(b);
+    val->m_type_params.push_back(a);
+    val->m_type_params.push_back(b);
 
-    body->locals.push_back(div);
-    body->locals.push_back(sign);
+    body->m_locals.push_back(div);
+    body->m_locals.push_back(sign);
 
     /* div = a / b; */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1058,7 +1058,7 @@ ast_expression *intrin::mod_() {
     );
 
     /* sign = (div < 0.0f) ? -1 : 1; */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1078,7 +1078,7 @@ ast_expression *intrin::mod_() {
     );
 
     /* floor(sign * div) */
-    call->params.push_back(
+    call->m_params.push_back(
         (ast_expression*)ast_binary_new(
             ctx(),
             INSTR_MUL_F,
@@ -1088,7 +1088,7 @@ ast_expression *intrin::mod_() {
     );
 
     /* return a - b * sign * <call> */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -1110,7 +1110,7 @@ ast_expression *intrin::mod_() {
         )
     );
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -1126,7 +1126,7 @@ ast_expression *intrin::fabs_() {
     ast_block    *body   = ast_block_new(ctx());
     ast_function *func   = value(&val, "fabs", TYPE_FLOAT);
 
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)ast_ternary_new(
@@ -1147,9 +1147,9 @@ ast_expression *intrin::fabs_() {
         )
     );
 
-    val->type_params.push_back(arg1);
+    val->m_type_params.push_back(arg1);
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -1167,10 +1167,10 @@ ast_expression *intrin::epsilon_() {
     ast_block    *body   = ast_block_new(ctx());
     ast_function *func   = value(&val, "epsilon", TYPE_FLOAT);
 
-    body->locals.push_back(eps);
+    body->m_locals.push_back(eps);
 
     /* eps = 1.0f; */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1179,7 +1179,7 @@ ast_expression *intrin::epsilon_() {
         )
     );
 
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_loop_new(
             ctx(),
             nullptr,
@@ -1214,14 +1214,14 @@ ast_expression *intrin::epsilon_() {
     );
 
     /* return eps; */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)eps
         )
     );
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -1238,9 +1238,9 @@ ast_expression *intrin::nan_() {
     ast_function *func   = value(&val, "nan", TYPE_FLOAT);
     ast_block    *block  = ast_block_new(ctx());
 
-    block->locals.push_back(x);
+    block->m_locals.push_back(x);
 
-    block->exprs.push_back(
+    block->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1249,7 +1249,7 @@ ast_expression *intrin::nan_() {
         )
     );
 
-    block->exprs.push_back(
+    block->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -1261,7 +1261,7 @@ ast_expression *intrin::nan_() {
         )
     );
 
-    func->blocks.emplace_back(block);
+    func->m_blocks.emplace_back(block);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -1281,12 +1281,12 @@ ast_expression *intrin::inf_() {
     ast_block    *block  = ast_block_new(ctx());
     size_t        i;
 
-    block->locals.push_back(x);
-    block->locals.push_back(y);
+    block->m_locals.push_back(x);
+    block->m_locals.push_back(y);
 
     /* to keep code size down */
     for (i = 0; i <= 1; i++) {
-        block->exprs.push_back(
+        block->m_exprs.push_back(
             (ast_expression*)ast_store_new(
                 ctx(),
                 INSTR_STORE_F,
@@ -1296,7 +1296,7 @@ ast_expression *intrin::inf_() {
         );
     }
 
-    block->exprs.push_back(
+    block->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -1308,7 +1308,7 @@ ast_expression *intrin::inf_() {
         )
     );
 
-    func->blocks.emplace_back(block);
+    func->m_blocks.emplace_back(block);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -1406,20 +1406,20 @@ ast_expression *intrin::ln_() {
     ast_function *func = value(&val, "ln", TYPE_FLOAT);
     size_t i;
 
-    val->type_params.push_back(power);
-    val->type_params.push_back(base);
+    val->m_type_params.push_back(power);
+    val->m_type_params.push_back(base);
 
-    block->locals.push_back(whole);
-    block->locals.push_back(nth);
-    block->locals.push_back(sign);
-    block->locals.push_back(eps);
-    block->locals.push_back(A_i);
-    block->locals.push_back(B_i);
-    block->locals.push_back(A_iminus1);
-    block->locals.push_back(B_iminus1);
+    block->m_locals.push_back(whole);
+    block->m_locals.push_back(nth);
+    block->m_locals.push_back(sign);
+    block->m_locals.push_back(eps);
+    block->m_locals.push_back(A_i);
+    block->m_locals.push_back(B_i);
+    block->m_locals.push_back(A_iminus1);
+    block->m_locals.push_back(B_iminus1);
 
     /* sign = 1.0f; */
-    block->exprs.push_back(
+    block->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1429,7 +1429,7 @@ ast_expression *intrin::ln_() {
     );
 
     /* eps = __builtin_epsilon(); */
-    block->exprs.push_back(
+    block->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1450,7 +1450,7 @@ ast_expression *intrin::ln_() {
     for (i = 0; i <= 1; i++) {
         int j;
         for (j = 1; j >= 0; j--) {
-            block->exprs.push_back(
+            block->m_exprs.push_back(
                 (ast_expression*)ast_store_new(
                     ctx(),
                     INSTR_STORE_F,
@@ -1473,7 +1473,7 @@ ast_expression *intrin::ln_() {
      * }
      */
     for (i = 0; i <= 1; i++) {
-        ((i) ? blt1 : plt1)->exprs.push_back(
+        ((i) ? blt1 : plt1)->m_exprs.push_back(
             (ast_expression*)ast_store_new(
                 ctx(),
                 INSTR_STORE_F,
@@ -1486,7 +1486,7 @@ ast_expression *intrin::ln_() {
                 )
             )
         );
-        plt1->exprs.push_back(
+        plt1->m_exprs.push_back(
             (ast_expression*)ast_binstore_new(
                 ctx(),
                 INSTR_STORE_F,
@@ -1507,7 +1507,7 @@ ast_expression *intrin::ln_() {
      *         <blt1>
      * }
      */
-    plt1orblt1->exprs.push_back(
+    plt1orblt1->m_exprs.push_back(
         (ast_expression*)ast_ifthen_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -1538,7 +1538,7 @@ ast_expression *intrin::ln_() {
     );
 
     for (i = 0; i <= 1; i++) {
-        plt1orblt1->exprs.push_back(
+        plt1orblt1->m_exprs.push_back(
             (ast_expression*)ast_ifthen_new(
                 ctx(),
                 (ast_expression*)ast_binary_new(
@@ -1553,11 +1553,11 @@ ast_expression *intrin::ln_() {
         );
     }
 
-    block->exprs.push_back((ast_expression*)plt1orblt1);
+    block->m_exprs.push_back((ast_expression*)plt1orblt1);
 
 
     /* whole = power; */
-    forloop->exprs.push_back(
+    forloop->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1567,7 +1567,7 @@ ast_expression *intrin::ln_() {
     );
 
     /* nth = 0.0f; */
-    forloop->exprs.push_back(
+    forloop->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1577,7 +1577,7 @@ ast_expression *intrin::ln_() {
     );
 
     /* base2 = base; */
-    whileloop->exprs.push_back(
+    whileloop->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1587,7 +1587,7 @@ ast_expression *intrin::ln_() {
     );
 
     /* n2 = 1.0f; */
-    whileloop->exprs.push_back(
+    whileloop->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1597,7 +1597,7 @@ ast_expression *intrin::ln_() {
     );
 
     /* newbase2 = base2 * base2; */
-    whileloop->exprs.push_back(
+    whileloop->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1612,12 +1612,12 @@ ast_expression *intrin::ln_() {
     );
 
     /* while loop locals */
-    whileloop->locals.push_back(base2);
-    whileloop->locals.push_back(n2);
-    whileloop->locals.push_back(newbase2);
+    whileloop->m_locals.push_back(base2);
+    whileloop->m_locals.push_back(n2);
+    whileloop->m_locals.push_back(newbase2);
 
     /* base2 = newbase2; */
-    nestwhile->exprs.push_back(
+    nestwhile->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1627,7 +1627,7 @@ ast_expression *intrin::ln_() {
     );
 
     /* n2 *= 2; */
-    nestwhile->exprs.push_back(
+    nestwhile->m_exprs.push_back(
         (ast_expression*)ast_binstore_new(
             ctx(),
             INSTR_STORE_F,
@@ -1638,7 +1638,7 @@ ast_expression *intrin::ln_() {
     );
 
     /* newbase2 *= newbase2; */
-    nestwhile->exprs.push_back(
+    nestwhile->m_exprs.push_back(
         (ast_expression*)ast_binstore_new(
             ctx(),
             INSTR_STORE_F,
@@ -1649,7 +1649,7 @@ ast_expression *intrin::ln_() {
     );
 
     /* while (whole >= newbase2) */
-    whileloop->exprs.push_back(
+    whileloop->m_exprs.push_back(
         (ast_expression*)ast_loop_new(
             ctx(),
             nullptr,
@@ -1668,7 +1668,7 @@ ast_expression *intrin::ln_() {
     );
 
     /* whole /= base2; */
-    whileloop->exprs.push_back(
+    whileloop->m_exprs.push_back(
         (ast_expression*)ast_binstore_new(
             ctx(),
             INSTR_STORE_F,
@@ -1679,7 +1679,7 @@ ast_expression *intrin::ln_() {
     );
 
     /* nth += n2; */
-    whileloop->exprs.push_back(
+    whileloop->m_exprs.push_back(
         (ast_expression*)ast_binstore_new(
             ctx(),
             INSTR_STORE_F,
@@ -1690,7 +1690,7 @@ ast_expression *intrin::ln_() {
     );
 
     /* while (whole >= base) */
-    forloop->exprs.push_back(
+    forloop->m_exprs.push_back(
         (ast_expression*)ast_loop_new(
             ctx(),
             nullptr,
@@ -1708,12 +1708,12 @@ ast_expression *intrin::ln_() {
         )
     );
 
-    forloop->locals.push_back(b_iplus1);
-    forloop->locals.push_back(A_iplus1);
-    forloop->locals.push_back(B_iplus1);
+    forloop->m_locals.push_back(b_iplus1);
+    forloop->m_locals.push_back(A_iplus1);
+    forloop->m_locals.push_back(B_iplus1);
 
     /* b_iplus1 = nth; */
-    forloop->exprs.push_back(
+    forloop->m_exprs.push_back(
         (ast_expression*)ast_store_new(
             ctx(),
             INSTR_STORE_F,
@@ -1727,7 +1727,7 @@ ast_expression *intrin::ln_() {
      * B_iplus1 = b_iplus1 * B_i + B_iminus1;
      */
     for (i = 0; i <= 1; i++) {
-        forloop->exprs.push_back(
+        forloop->m_exprs.push_back(
             (ast_expression*)ast_store_new(
                 ctx(),
                 INSTR_STORE_F,
@@ -1752,7 +1752,7 @@ ast_expression *intrin::ln_() {
      * B_iminus1 = B_i;
      */
     for (i = 0; i <= 1; i++) {
-        forloop->exprs.push_back(
+        forloop->m_exprs.push_back(
             (ast_expression*)ast_store_new(
                 ctx(),
                 INSTR_STORE_F,
@@ -1767,7 +1767,7 @@ ast_expression *intrin::ln_() {
      * B_i = B_iplus1;
      */
     for (i = 0; i <= 1; i++) {
-        forloop->exprs.push_back(
+        forloop->m_exprs.push_back(
             (ast_expression*)ast_store_new(
                 ctx(),
                 INSTR_STORE_F,
@@ -1781,7 +1781,7 @@ ast_expression *intrin::ln_() {
      * if (whole <= 1.0f + eps)
      *     break;
      */
-    forloop->exprs.push_back(
+    forloop->m_exprs.push_back(
         (ast_expression*)ast_ifthen_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -1809,7 +1809,7 @@ ast_expression *intrin::ln_() {
      * base  = whole;
      */
     for (i = 0; i <= 1; i++) {
-        forloop->exprs.push_back(
+        forloop->m_exprs.push_back(
             (ast_expression*)ast_store_new(
                 ctx(),
                 INSTR_STORE_F,
@@ -1820,7 +1820,7 @@ ast_expression *intrin::ln_() {
     }
 
     /* add the for loop block */
-    block->exprs.push_back(
+    block->m_exprs.push_back(
         (ast_expression*)ast_loop_new(
             ctx(),
             nullptr,
@@ -1835,7 +1835,7 @@ ast_expression *intrin::ln_() {
     );
 
     /* return sign * A_i / B_il */
-    block->exprs.push_back(
+    block->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)ast_binary_new(
@@ -1852,7 +1852,7 @@ ast_expression *intrin::ln_() {
         )
     );
 
-    func->blocks.emplace_back(block);
+    func->m_blocks.emplace_back(block);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -1864,19 +1864,19 @@ ast_expression *intrin::log_variant(const char *name, float base) {
     ast_block *body = ast_block_new(ctx());
     ast_function *func = value(&val, name, TYPE_FLOAT);
 
-    val->type_params.push_back(arg1);
+    val->m_type_params.push_back(arg1);
 
-    callln->params.push_back((ast_expression*)arg1);
-    callln->params.push_back((ast_expression*)m_fold->constgen_float(base, false));
+    callln->m_params.push_back((ast_expression*)arg1);
+    callln->m_params.push_back((ast_expression*)m_fold->constgen_float(base, false));
 
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)callln
         )
     );
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -1908,15 +1908,15 @@ ast_expression *intrin::shift_variant(const char *name, size_t instr) {
     ast_block *body = ast_block_new(ctx());
     ast_function *func = value(&val, name, TYPE_FLOAT);
 
-    val->type_params.push_back(a);
-    val->type_params.push_back(b);
+    val->m_type_params.push_back(a);
+    val->m_type_params.push_back(b);
 
     /* <callpow> = pow(2, b) */
-    callpow->params.push_back((ast_expression*)m_fold->m_imm_float[3]);
-    callpow->params.push_back((ast_expression*)b);
+    callpow->m_params.push_back((ast_expression*)m_fold->m_imm_float[3]);
+    callpow->m_params.push_back((ast_expression*)b);
 
     /* <callfloor> = floor(a [instr] <callpow>) */
-    callfloor->params.push_back(
+    callfloor->m_params.push_back(
         (ast_expression*)ast_binary_new(
             ctx(),
             instr,
@@ -1926,14 +1926,14 @@ ast_expression *intrin::shift_variant(const char *name, size_t instr) {
     );
 
     /* return <callfloor> */
-    body->exprs.push_back(
+    body->m_exprs.push_back(
         (ast_expression*)ast_return_new(
             ctx(),
             (ast_expression*)callfloor
         )
     );
 
-    func->blocks.emplace_back(body);
+    func->m_blocks.emplace_back(body);
     reg(val, func);
     return (ast_expression*)val;
 }
@@ -1998,14 +1998,14 @@ intrin::intrin(parser_t *parser)
 }
 
 ast_expression *intrin::do_fold(ast_value *val, ast_expression **exprs) {
-    if (!val || !val->name)
+    if (!val || !val->m_name)
         return nullptr;
     static constexpr size_t kPrefixLength = 10; // "__builtin_"
     for (auto &it : m_intrinsics) {
-        if (!strcmp(val->name, it.name))
+        if (!strcmp(val->m_name, it.name))
             return (vec_size(exprs) != it.args)
                         ? nullptr
-                        : m_fold->intrinsic(val->name + kPrefixLength, exprs);
+                        : m_fold->intrinsic(val->m_name + kPrefixLength, exprs);
     }
     return nullptr;
 }
@@ -2025,9 +2025,9 @@ ast_expression *intrin::func_try(size_t offset, const char *compare) {
 ast_expression *intrin::func_self(const char *name, const char *from) {
     ast_expression *find;
     /* try current first */
-    if ((find = parser_find_global(m_parser, name)) && ((ast_value*)find)->vtype == TYPE_FUNCTION)
+    if ((find = parser_find_global(m_parser, name)) && ((ast_value*)find)->m_vtype == TYPE_FUNCTION)
         for (auto &it : m_parser->functions)
-            if (((ast_value*)find)->name && !strcmp(it->name, ((ast_value*)find)->name) && it->builtin < 0)
+            if (((ast_value*)find)->m_name && !strcmp(it->m_name, ((ast_value*)find)->m_name) && it->m_builtin < 0)
                 return find;
     /* try name second */
     if ((find = func_try(offsetof(intrin_func_t, name),  name)))
diff --git a/ir.cpp b/ir.cpp
index 787a126..ba4ed64 100644 (file)
--- a/ir.cpp
+++ b/ir.cpp
@@ -273,59 +273,49 @@ static void ir_block_delete_quick(ir_block* self);
 static void ir_instr_delete_quick(ir_instr *self);
 static void ir_function_delete_quick(ir_function *self);
 
-void* ir_builder::operator new(std::size_t bytes)
-{
-    return mem_a(bytes);
-}
-
-void ir_builder::operator delete(void *ptr)
-{
-    mem_d(ptr);
-}
-
 ir_builder::ir_builder(const std::string& modulename)
-: name(modulename),
-  code(new code_t)
+: m_name(modulename),
+  m_code(new code_t)
 {
-    htglobals   = util_htnew(IR_HT_SIZE);
-    htfields    = util_htnew(IR_HT_SIZE);
-    htfunctions = util_htnew(IR_HT_SIZE);
+    m_htglobals   = util_htnew(IR_HT_SIZE);
+    m_htfields    = util_htnew(IR_HT_SIZE);
+    m_htfunctions = util_htnew(IR_HT_SIZE);
 
-    nil = new ir_value("nil", store_value, TYPE_NIL);
-    nil->cvq = CV_CONST;
+    m_nil = new ir_value("nil", store_value, TYPE_NIL);
+    m_nil->m_cvq = CV_CONST;
 
     for (size_t i = 0; i != IR_MAX_VINSTR_TEMPS; ++i) {
         /* we write to them, but they're not supposed to be used outside the IR, so
          * let's not allow the generation of ir_instrs which use these.
          * So it's a constant noexpr.
          */
-        vinstr_temp[i] = new ir_value("vinstr_temp", store_value, TYPE_NOEXPR);
-        vinstr_temp[i]->cvq = CV_CONST;
+        m_vinstr_temp[i] = new ir_value("vinstr_temp", store_value, TYPE_NOEXPR);
+        m_vinstr_temp[i]->m_cvq = CV_CONST;
     }
 }
 
 ir_builder::~ir_builder()
 {
-    util_htdel(htglobals);
-    util_htdel(htfields);
-    util_htdel(htfunctions);
-    for (auto& f : functions)
+    util_htdel(m_htglobals);
+    util_htdel(m_htfields);
+    util_htdel(m_htfunctions);
+    for (auto& f : m_functions)
         ir_function_delete_quick(f.release());
-    functions.clear(); // delete them now before deleting the rest:
+    m_functions.clear(); // delete them now before deleting the rest:
 
-    delete nil;
+    delete m_nil;
 
     for (size_t i = 0; i != IR_MAX_VINSTR_TEMPS; ++i) {
-        delete vinstr_temp[i];
+        delete m_vinstr_temp[i];
     }
 
-    extparams.clear();
-    extparam_protos.clear();
+    m_extparams.clear();
+    m_extparam_protos.clear();
 }
 
 static ir_function* ir_builder_get_function(ir_builder *self, const char *name)
 {
-    return (ir_function*)util_htget(self->htfunctions, name);
+    return (ir_function*)util_htget(self->m_htfunctions, name);
 }
 
 ir_function* ir_builder_create_function(ir_builder *self, const std::string& name, qc_type outtype)
@@ -336,27 +326,27 @@ ir_function* ir_builder_create_function(ir_builder *self, const std::string& nam
     }
 
     fn = new ir_function(self, outtype);
-    fn->name = name;
-    self->functions.emplace_back(fn);
-    util_htset(self->htfunctions, name.c_str(), fn);
+    fn->m_name = name;
+    self->m_functions.emplace_back(fn);
+    util_htset(self->m_htfunctions, name.c_str(), fn);
 
-    fn->value = ir_builder_create_global(self, fn->name, TYPE_FUNCTION);
-    if (!fn->value) {
+    fn->m_value = ir_builder_create_global(self, fn->m_name, TYPE_FUNCTION);
+    if (!fn->m_value) {
         delete fn;
         return nullptr;
     }
 
-    fn->value->hasvalue = true;
-    fn->value->outtype = outtype;
-    fn->value->constval.vfunc = fn;
-    fn->value->context = fn->context;
+    fn->m_value->m_hasvalue = true;
+    fn->m_value->m_outtype = outtype;
+    fn->m_value->m_constval.vfunc = fn;
+    fn->m_value->m_context = fn->m_context;
 
     return fn;
 }
 
 static ir_value* ir_builder_get_global(ir_builder *self, const char *name)
 {
-    return (ir_value*)util_htget(self->htglobals, name);
+    return (ir_value*)util_htget(self->m_htglobals, name);
 }
 
 ir_value* ir_builder_create_global(ir_builder *self, const std::string& name, qc_type vtype)
@@ -372,21 +362,21 @@ ir_value* ir_builder_create_global(ir_builder *self, const std::string& name, qc
     }
 
     ve = new ir_value(std::string(name), store_global, vtype);
-    self->globals.emplace_back(ve);
-    util_htset(self->htglobals, name.c_str(), ve);
+    self->m_globals.emplace_back(ve);
+    util_htset(self->m_htglobals, name.c_str(), ve);
     return ve;
 }
 
 ir_value* ir_builder_get_va_count(ir_builder *self)
 {
-    if (self->reserved_va_count)
-        return self->reserved_va_count;
-    return (self->reserved_va_count = ir_builder_create_global(self, "reserved:va_count", TYPE_FLOAT));
+    if (self->m_reserved_va_count)
+        return self->m_reserved_va_count;
+    return (self->m_reserved_va_count = ir_builder_create_global(self, "reserved:va_count", TYPE_FLOAT));
 }
 
 static ir_value* ir_builder_get_field(ir_builder *self, const char *name)
 {
-    return (ir_value*)util_htget(self->htfields, name);
+    return (ir_value*)util_htget(self->m_htfields, name);
 }
 
 
@@ -398,9 +388,9 @@ ir_value* ir_builder_create_field(ir_builder *self, const std::string& name, qc_
     }
 
     ve = new ir_value(std::string(name), store_global, TYPE_FIELD);
-    ve->fieldtype = vtype;
-    self->fields.emplace_back(ve);
-    util_htset(self->htfields, name.c_str(), ve);
+    ve->m_fieldtype = vtype;
+    self->m_fields.emplace_back(ve);
+    util_htset(self->m_htfields, name.c_str(), ve);
     return ve;
 }
 
@@ -413,23 +403,13 @@ static void ir_function_enumerate(ir_function*);
 static bool ir_function_calculate_liferanges(ir_function*);
 static bool ir_function_allocate_locals(ir_function*);
 
-void* ir_function::operator new(std::size_t bytes)
-{
-    return mem_a(bytes);
-}
-
-void ir_function::operator delete(void *ptr)
-{
-    mem_d(ptr);
-}
-
 ir_function::ir_function(ir_builder* owner_, qc_type outtype_)
-: owner(owner_),
-  name("<@unnamed>"),
-  outtype(outtype_)
+: m_owner(owner_),
+  m_name("<@unnamed>"),
+  m_outtype(outtype_)
 {
-    context.file = "<@no context>";
-    context.line = 0;
+    m_context.file = "<@no context>";
+    m_context.line = 0;
 }
 
 ir_function::~ir_function()
@@ -438,24 +418,24 @@ ir_function::~ir_function()
 
 static void ir_function_delete_quick(ir_function *self)
 {
-    for (auto& b : self->blocks)
+    for (auto& b : self->m_blocks)
         ir_block_delete_quick(b.release());
     delete self;
 }
 
 static void ir_function_collect_value(ir_function *self, ir_value *v)
 {
-    self->values.emplace_back(v);
+    self->m_values.emplace_back(v);
 }
 
 ir_block* ir_function_create_block(lex_ctx_t ctx, ir_function *self, const char *label)
 {
     ir_block* bn = new ir_block(self, label ? std::string(label) : std::string());
-    bn->context = ctx;
-    self->blocks.emplace_back(bn);
+    bn->m_context = ctx;
+    self->m_blocks.emplace_back(bn);
 
-    if ((self->flags & IR_FLAG_BLOCK_COVERAGE) && self->owner->coverage_func)
-        (void)ir_block_create_call(bn, ctx, nullptr, self->owner->coverage_func, false);
+    if ((self->m_flags & IR_FLAG_BLOCK_COVERAGE) && self->m_owner->m_coverage_func)
+        (void)ir_block_create_call(bn, ctx, nullptr, self->m_owner->m_coverage_func, false);
 
     return bn;
 }
@@ -473,15 +453,15 @@ static bool instr_is_operation(uint16_t op)
 
 static bool ir_function_pass_peephole(ir_function *self)
 {
-    for (auto& bp : self->blocks) {
+    for (auto& bp : self->m_blocks) {
         ir_block *block = bp.get();
-        for (size_t i = 0; i < vec_size(block->instr); ++i) {
+        for (size_t i = 0; i < vec_size(block->m_instr); ++i) {
             ir_instr *inst;
-            inst = block->instr[i];
+            inst = block->m_instr[i];
 
             if (i >= 1 &&
-                (inst->opcode >= INSTR_STORE_F &&
-                 inst->opcode <= INSTR_STORE_FNC))
+                (inst->m_opcode >= INSTR_STORE_F &&
+                 inst->m_opcode <= INSTR_STORE_FNC))
             {
                 ir_instr *store;
                 ir_instr *oper;
@@ -489,44 +469,44 @@ static bool ir_function_pass_peephole(ir_function *self)
 
                 store = inst;
 
-                oper  = block->instr[i-1];
-                if (!instr_is_operation(oper->opcode))
+                oper  = block->m_instr[i-1];
+                if (!instr_is_operation(oper->m_opcode))
                     continue;
 
                 /* Don't change semantics of MUL_VF in engines where these may not alias. */
                 if (OPTS_FLAG(LEGACY_VECTOR_MATHS)) {
-                    if (oper->opcode == INSTR_MUL_VF && oper->_ops[2]->memberof == oper->_ops[1])
+                    if (oper->m_opcode == INSTR_MUL_VF && oper->_m_ops[2]->m_memberof == oper->_m_ops[1])
                         continue;
-                    if (oper->opcode == INSTR_MUL_FV && oper->_ops[1]->memberof == oper->_ops[2])
+                    if (oper->m_opcode == INSTR_MUL_FV && oper->_m_ops[1]->m_memberof == oper->_m_ops[2])
                         continue;
                 }
 
-                value = oper->_ops[0];
+                value = oper->_m_ops[0];
 
                 /* only do it for SSA values */
-                if (value->store != store_value)
+                if (value->m_store != store_value)
                     continue;
 
                 /* don't optimize out the temp if it's used later again */
-                if (value->reads.size() != 1)
+                if (value->m_reads.size() != 1)
                     continue;
 
                 /* The very next store must use this value */
-                if (value->reads[0] != store)
+                if (value->m_reads[0] != store)
                     continue;
 
                 /* And of course the store must _read_ from it, so it's in
                  * OP 1 */
-                if (store->_ops[1] != value)
+                if (store->_m_ops[1] != value)
                     continue;
 
                 ++opts_optimizationcount[OPTIM_PEEPHOLE];
-                (void)!ir_instr_op(oper, 0, store->_ops[0], true);
+                (void)!ir_instr_op(oper, 0, store->_m_ops[0], true);
 
-                vec_remove(block->instr, i, 1);
+                vec_remove(block->m_instr, i, 1);
                 delete store;
             }
-            else if (inst->opcode == VINSTR_COND)
+            else if (inst->m_opcode == VINSTR_COND)
             {
                 /* COND on a value resulting from a NOT could
                  * remove the NOT and swap its operands
@@ -536,17 +516,17 @@ static bool ir_function_pass_peephole(ir_function *self)
                     size_t    inotid;
                     ir_instr *inot;
                     ir_value *value;
-                    value = inst->_ops[0];
+                    value = inst->_m_ops[0];
 
-                    if (value->store != store_value || value->reads.size() != 1 || value->reads[0] != inst)
+                    if (value->m_store != store_value || value->m_reads.size() != 1 || value->m_reads[0] != inst)
                         break;
 
-                    inot = value->writes[0];
-                    if (inot->_ops[0] != value ||
-                        inot->opcode < INSTR_NOT_F ||
-                        inot->opcode > INSTR_NOT_FNC ||
-                        inot->opcode == INSTR_NOT_V || /* can't do these */
-                        inot->opcode == INSTR_NOT_S)
+                    inot = value->m_writes[0];
+                    if (inot->_m_ops[0] != value ||
+                        inot->m_opcode < INSTR_NOT_F ||
+                        inot->m_opcode > INSTR_NOT_FNC ||
+                        inot->m_opcode == INSTR_NOT_V || /* can't do these */
+                        inot->m_opcode == INSTR_NOT_S)
                     {
                         break;
                     }
@@ -554,23 +534,23 @@ static bool ir_function_pass_peephole(ir_function *self)
                     /* count */
                     ++opts_optimizationcount[OPTIM_PEEPHOLE];
                     /* change operand */
-                    (void)!ir_instr_op(inst, 0, inot->_ops[1], false);
+                    (void)!ir_instr_op(inst, 0, inot->_m_ops[1], false);
                     /* remove NOT */
-                    tmp = inot->owner;
-                    for (inotid = 0; inotid < vec_size(tmp->instr); ++inotid) {
-                        if (tmp->instr[inotid] == inot)
+                    tmp = inot->m_owner;
+                    for (inotid = 0; inotid < vec_size(tmp->m_instr); ++inotid) {
+                        if (tmp->m_instr[inotid] == inot)
                             break;
                     }
-                    if (inotid >= vec_size(tmp->instr)) {
-                        compile_error(inst->context, "sanity-check failed: failed to find instruction to optimize out");
+                    if (inotid >= vec_size(tmp->m_instr)) {
+                        compile_error(inst->m_context, "sanity-check failed: failed to find instruction to optimize out");
                         return false;
                     }
-                    vec_remove(tmp->instr, inotid, 1);
+                    vec_remove(tmp->m_instr, inotid, 1);
                     delete inot;
                     /* swap ontrue/onfalse */
-                    tmp = inst->bops[0];
-                    inst->bops[0] = inst->bops[1];
-                    inst->bops[1] = tmp;
+                    tmp = inst->m_bops[0];
+                    inst->m_bops[0] = inst->m_bops[1];
+                    inst->m_bops[1] = tmp;
                 }
                 continue;
             }
@@ -584,80 +564,80 @@ static bool ir_function_pass_tailrecursion(ir_function *self)
 {
     size_t p;
 
-    for (auto& bp : self->blocks) {
+    for (auto& bp : self->m_blocks) {
         ir_block *block = bp.get();
 
         ir_value *funcval;
         ir_instr *ret, *call, *store = nullptr;
 
-        if (!block->final || vec_size(block->instr) < 2)
+        if (!block->m_final || vec_size(block->m_instr) < 2)
             continue;
 
-        ret = block->instr[vec_size(block->instr)-1];
-        if (ret->opcode != INSTR_DONE && ret->opcode != INSTR_RETURN)
+        ret = block->m_instr[vec_size(block->m_instr)-1];
+        if (ret->m_opcode != INSTR_DONE && ret->m_opcode != INSTR_RETURN)
             continue;
 
-        call = block->instr[vec_size(block->instr)-2];
-        if (call->opcode >= INSTR_STORE_F && call->opcode <= INSTR_STORE_FNC) {
+        call = block->m_instr[vec_size(block->m_instr)-2];
+        if (call->m_opcode >= INSTR_STORE_F && call->m_opcode <= INSTR_STORE_FNC) {
             /* account for the unoptimized
              * CALL
              * STORE %return, %tmp
              * RETURN %tmp
              * version
              */
-            if (vec_size(block->instr) < 3)
+            if (vec_size(block->m_instr) < 3)
                 continue;
 
             store = call;
-            call = block->instr[vec_size(block->instr)-3];
+            call = block->m_instr[vec_size(block->m_instr)-3];
         }
 
-        if (call->opcode < INSTR_CALL0 || call->opcode > INSTR_CALL8)
+        if (call->m_opcode < INSTR_CALL0 || call->m_opcode > INSTR_CALL8)
             continue;
 
         if (store) {
             /* optimize out the STORE */
-            if (ret->_ops[0]   &&
-                ret->_ops[0]   == store->_ops[0] &&
-                store->_ops[1] == call->_ops[0])
+            if (ret->_m_ops[0]   &&
+                ret->_m_ops[0]   == store->_m_ops[0] &&
+                store->_m_ops[1] == call->_m_ops[0])
             {
                 ++opts_optimizationcount[OPTIM_PEEPHOLE];
-                call->_ops[0] = store->_ops[0];
-                vec_remove(block->instr, vec_size(block->instr) - 2, 1);
+                call->_m_ops[0] = store->_m_ops[0];
+                vec_remove(block->m_instr, vec_size(block->m_instr) - 2, 1);
                 delete store;
             }
             else
                 continue;
         }
 
-        if (!call->_ops[0])
+        if (!call->_m_ops[0])
             continue;
 
-        funcval = call->_ops[1];
+        funcval = call->_m_ops[1];
         if (!funcval)
             continue;
-        if (funcval->vtype != TYPE_FUNCTION || funcval->constval.vfunc != self)
+        if (funcval->m_vtype != TYPE_FUNCTION || funcval->m_constval.vfunc != self)
             continue;
 
         /* now we have a CALL and a RET, check if it's a tailcall */
-        if (ret->_ops[0] && call->_ops[0] != ret->_ops[0])
+        if (ret->_m_ops[0] && call->_m_ops[0] != ret->_m_ops[0])
             continue;
 
         ++opts_optimizationcount[OPTIM_TAIL_RECURSION];
-        vec_shrinkby(block->instr, 2);
+        vec_shrinkby(block->m_instr, 2);
 
-        block->final = false; /* open it back up */
+        block->m_final = false; /* open it back up */
 
         /* emite parameter-stores */
-        for (p = 0; p < call->params.size(); ++p) {
+        for (p = 0; p < call->m_params.size(); ++p) {
             /* assert(call->params_count <= self->locals_count); */
-            if (!ir_block_create_store(block, call->context, self->locals[p].get(), call->params[p])) {
-                irerror(call->context, "failed to create tailcall store instruction for parameter %i", (int)p);
+            if (!ir_block_create_store(block, call->m_context, self->m_locals[p].get(), call->m_params[p])) {
+                irerror(call->m_context, "failed to create tailcall store instruction for parameter %i", (int)p);
                 return false;
             }
         }
-        if (!ir_block_create_jump(block, call->context, self->blocks[0].get())) {
-            irerror(call->context, "failed to create tailcall jump");
+        if (!ir_block_create_jump(block, call->m_context, self->m_blocks[0].get())) {
+            irerror(call->m_context, "failed to create tailcall jump");
             return false;
         }
 
@@ -670,42 +650,42 @@ static bool ir_function_pass_tailrecursion(ir_function *self)
 
 bool ir_function_finalize(ir_function *self)
 {
-    if (self->builtin)
+    if (self->m_builtin)
         return true;
 
     if (OPTS_OPTIMIZATION(OPTIM_PEEPHOLE)) {
         if (!ir_function_pass_peephole(self)) {
-            irerror(self->context, "generic optimization pass broke something in `%s`", self->name.c_str());
+            irerror(self->m_context, "generic optimization pass broke something in `%s`", self->m_name.c_str());
             return false;
         }
     }
 
     if (OPTS_OPTIMIZATION(OPTIM_TAIL_RECURSION)) {
         if (!ir_function_pass_tailrecursion(self)) {
-            irerror(self->context, "tail-recursion optimization pass broke something in `%s`", self->name.c_str());
+            irerror(self->m_context, "tail-recursion optimization pass broke something in `%s`", self->m_name.c_str());
             return false;
         }
     }
 
     if (!ir_function_naive_phi(self)) {
-        irerror(self->context, "internal error: ir_function_naive_phi failed");
+        irerror(self->m_context, "internal error: ir_function_naive_phi failed");
         return false;
     }
 
-    for (auto& lp : self->locals) {
+    for (auto& lp : self->m_locals) {
         ir_value *v = lp.get();
-        if (v->vtype == TYPE_VECTOR ||
-            (v->vtype == TYPE_FIELD && v->outtype == TYPE_VECTOR))
+        if (v->m_vtype == TYPE_VECTOR ||
+            (v->m_vtype == TYPE_FIELD && v->m_outtype == TYPE_VECTOR))
         {
             ir_value_vector_member(v, 0);
             ir_value_vector_member(v, 1);
             ir_value_vector_member(v, 2);
         }
     }
-    for (auto& vp : self->values) {
+    for (auto& vp : self->m_values) {
         ir_value *v = vp.get();
-        if (v->vtype == TYPE_VECTOR ||
-            (v->vtype == TYPE_FIELD && v->outtype == TYPE_VECTOR))
+        if (v->m_vtype == TYPE_VECTOR ||
+            (v->m_vtype == TYPE_FIELD && v->m_outtype == TYPE_VECTOR))
         {
             ir_value_vector_member(v, 0);
             ir_value_vector_member(v, 1);
@@ -727,17 +707,17 @@ ir_value* ir_function_create_local(ir_function *self, const std::string& name, q
     ir_value *ve;
 
     if (param &&
-        !self->locals.empty() &&
-        self->locals.back()->store != store_param)
+        !self->m_locals.empty() &&
+        self->m_locals.back()->m_store != store_param)
     {
-        irerror(self->context, "cannot add parameters after adding locals");
+        irerror(self->m_context, "cannot add parameters after adding locals");
         return nullptr;
     }
 
     ve = new ir_value(std::string(name), (param ? store_param : store_local), vtype);
     if (param)
-        ve->locked = true;
-    self->locals.emplace_back(ve);
+        ve->m_locked = true;
+    self->m_locals.emplace_back(ve);
     return ve;
 }
 
@@ -745,37 +725,29 @@ ir_value* ir_function_create_local(ir_function *self, const std::string& name, q
  *IR Block
  */
 
-void* ir_block::operator new(std::size_t bytes) {
-  return mem_a(bytes);
-}
-
-void ir_block::operator delete(void *data) {
-    mem_d(data);
-}
-
 ir_block::ir_block(ir_function* owner, const std::string& name)
-: owner(owner),
-  label(name)
+: m_owner(owner),
+  m_label(name)
 {
-    context.file = "<@no context>";
-    context.line = 0;
+    m_context.file = "<@no context>";
+    m_context.line = 0;
 }
 
 ir_block::~ir_block()
 {
-    for (size_t i = 0; i != vec_size(instr); ++i)
-        delete instr[i];
-    vec_free(instr);
-    vec_free(entries);
-    vec_free(exits);
+    for (size_t i = 0; i != vec_size(m_instr); ++i)
+        delete m_instr[i];
+    vec_free(m_instr);
+    vec_free(m_entries);
+    vec_free(m_exits);
 }
 
 static void ir_block_delete_quick(ir_block* self)
 {
     size_t i;
-    for (i = 0; i != vec_size(self->instr); ++i)
-        ir_instr_delete_quick(self->instr[i]);
-    vec_free(self->instr);
+    for (i = 0; i != vec_size(self->m_instr); ++i)
+        ir_instr_delete_quick(self->m_instr[i]);
+    vec_free(self->m_instr);
     delete self;
 }
 
@@ -783,18 +755,10 @@ static void ir_block_delete_quick(ir_block* self)
  *IR Instructions
  */
 
-void* ir_instr::operator new(std::size_t bytes) {
-  return mem_a(bytes);
-}
-
-void ir_instr::operator delete(void *data) {
-    mem_d(data);
-}
-
 ir_instr::ir_instr(lex_ctx_t ctx, ir_block* owner_, int op)
-: opcode(op),
-  context(ctx),
-  owner(owner_)
+: m_opcode(op),
+  m_context(ctx),
+  m_owner(owner_)
 {
 }
 
@@ -805,19 +769,19 @@ ir_instr::~ir_instr()
     // so ignore the return value. Since with the warn_unused_result attribute
     // gcc doesn't care about an explicit: (void)foo(); to ignore the result,
     // I have to improvise here and use if(foo());
-    for (auto &it : phi) {
+    for (auto &it : m_phi) {
         size_t idx;
-        if (vec_ir_instr_find(it.value->writes, this, &idx))
-            it.value->writes.erase(it.value->writes.begin() + idx);
-        if (vec_ir_instr_find(it.value->reads, this, &idx))
-            it.value->reads.erase(it.value->reads.begin() + idx);
+        if (vec_ir_instr_find(it.value->m_writes, this, &idx))
+            it.value->m_writes.erase(it.value->m_writes.begin() + idx);
+        if (vec_ir_instr_find(it.value->m_reads, this, &idx))
+            it.value->m_reads.erase(it.value->m_reads.begin() + idx);
     }
-    for (auto &it : params) {
+    for (auto &it : m_params) {
         size_t idx;
-        if (vec_ir_instr_find(it->writes, this, &idx))
-            it->writes.erase(it->writes.begin() + idx);
-        if (vec_ir_instr_find(it->reads, this, &idx))
-            it->reads.erase(it->reads.begin() + idx);
+        if (vec_ir_instr_find(it->m_writes, this, &idx))
+            it->m_writes.erase(it->m_writes.begin() + idx);
+        if (vec_ir_instr_find(it->m_reads, this, &idx))
+            it->m_reads.erase(it->m_reads.begin() + idx);
     }
     (void)!ir_instr_op(this, 0, nullptr, false);
     (void)!ir_instr_op(this, 1, nullptr, false);
@@ -826,32 +790,32 @@ ir_instr::~ir_instr()
 
 static void ir_instr_delete_quick(ir_instr *self)
 {
-    self->phi.clear();
-    self->params.clear();
+    self->m_phi.clear();
+    self->m_params.clear();
     delete self;
 }
 
 static bool ir_instr_op(ir_instr *self, int op, ir_value *v, bool writing)
 {
-    if (v && v->vtype == TYPE_NOEXPR) {
-        irerror(self->context, "tried to use a NOEXPR value");
+    if (v && v->m_vtype == TYPE_NOEXPR) {
+        irerror(self->m_context, "tried to use a NOEXPR value");
         return false;
     }
 
-    if (self->_ops[op]) {
+    if (self->_m_ops[op]) {
         size_t idx;
-        if (writing && vec_ir_instr_find(self->_ops[op]->writes, self, &idx))
-            self->_ops[op]->writes.erase(self->_ops[op]->writes.begin() + idx);
-        else if (vec_ir_instr_find(self->_ops[op]->reads, self, &idx))
-            self->_ops[op]->reads.erase(self->_ops[op]->reads.begin() + idx);
+        if (writing && vec_ir_instr_find(self->_m_ops[op]->m_writes, self, &idx))
+            self->_m_ops[op]->m_writes.erase(self->_m_ops[op]->m_writes.begin() + idx);
+        else if (vec_ir_instr_find(self->_m_ops[op]->m_reads, self, &idx))
+            self->_m_ops[op]->m_reads.erase(self->_m_ops[op]->m_reads.begin() + idx);
     }
     if (v) {
         if (writing)
-            v->writes.push_back(self);
+            v->m_writes.push_back(self);
         else
-            v->reads.push_back(self);
+            v->m_reads.push_back(self);
     }
-    self->_ops[op] = v;
+    self->_m_ops[op] = v;
     return true;
 }
 
@@ -861,65 +825,57 @@ static bool ir_instr_op(ir_instr *self, int op, ir_value *v, bool writing)
 
 static void ir_value_code_setaddr(ir_value *self, int32_t gaddr)
 {
-    self->code.globaladdr = gaddr;
-    if (self->members[0]) self->members[0]->code.globaladdr = gaddr;
-    if (self->members[1]) self->members[1]->code.globaladdr = gaddr;
-    if (self->members[2]) self->members[2]->code.globaladdr = gaddr;
+    self->m_code.globaladdr = gaddr;
+    if (self->m_members[0]) self->m_members[0]->m_code.globaladdr = gaddr;
+    if (self->m_members[1]) self->m_members[1]->m_code.globaladdr = gaddr;
+    if (self->m_members[2]) self->m_members[2]->m_code.globaladdr = gaddr;
 }
 
 static int32_t ir_value_code_addr(const ir_value *self)
 {
-    if (self->store == store_return)
-        return OFS_RETURN + self->code.addroffset;
-    return self->code.globaladdr + self->code.addroffset;
-}
-
-void* ir_value::operator new(std::size_t bytes) {
-  return mem_a(bytes);
-}
-
-void ir_value::operator delete(void *data) {
-    mem_d(data);
+    if (self->m_store == store_return)
+        return OFS_RETURN + self->m_code.addroffset;
+    return self->m_code.globaladdr + self->m_code.addroffset;
 }
 
 ir_value::ir_value(std::string&& name_, store_type store_, qc_type vtype_)
-: name(move(name_)),
-  vtype(vtype_),
-  store(store_)
+: m_name(move(name_)),
+  m_vtype(vtype_),
+  m_store(store_)
 {
-    fieldtype = TYPE_VOID;
-    outtype = TYPE_VOID;
-    flags = 0;
-
-    cvq          = CV_NONE;
-    hasvalue     = false;
-    context.file = "<@no context>";
-    context.line = 0;
-
-    memset(&constval, 0, sizeof(constval));
-    memset(&code,     0, sizeof(code));
-
-    members[0] = nullptr;
-    members[1] = nullptr;
-    members[2] = nullptr;
-    memberof = nullptr;
-
-    unique_life = false;
-    locked = false;
-    callparam  = false;
+    m_fieldtype = TYPE_VOID;
+    m_outtype = TYPE_VOID;
+    m_flags = 0;
+
+    m_cvq          = CV_NONE;
+    m_hasvalue     = false;
+    m_context.file = "<@no context>";
+    m_context.line = 0;
+
+    memset(&m_constval, 0, sizeof(m_constval));
+    memset(&m_code,     0, sizeof(m_code));
+
+    m_members[0] = nullptr;
+    m_members[1] = nullptr;
+    m_members[2] = nullptr;
+    m_memberof = nullptr;
+
+    m_unique_life = false;
+    m_locked = false;
+    m_callparam  = false;
 }
 
 ir_value::~ir_value()
 {
     size_t i;
-    if (hasvalue) {
-        if (vtype == TYPE_STRING)
-            mem_d((void*)constval.vstring);
+    if (m_hasvalue) {
+        if (m_vtype == TYPE_STRING)
+            mem_d((void*)m_constval.vstring);
     }
-    if (!(flags & IR_FLAG_SPLIT_VECTOR)) {
+    if (!(m_flags & IR_FLAG_SPLIT_VECTOR)) {
         for (i = 0; i < 3; ++i) {
-            if (members[i])
-                delete members[i];
+            if (m_members[i])
+                delete m_members[i];
         }
     }
 }
@@ -928,14 +884,14 @@ ir_value::~ir_value()
 /*  helper function */
 static ir_value* ir_builder_imm_float(ir_builder *self, float value, bool add_to_list) {
     ir_value *v = new ir_value("#IMMEDIATE", store_global, TYPE_FLOAT);
-    v->flags |= IR_FLAG_ERASABLE;
-    v->hasvalue = true;
-    v->cvq = CV_CONST;
-    v->constval.vfloat = value;
+    v->m_flags |= IR_FLAG_ERASABLE;
+    v->m_hasvalue = true;
+    v->m_cvq = CV_CONST;
+    v->m_constval.vfloat = value;
 
-    self->globals.emplace_back(v);
+    self->m_globals.emplace_back(v);
     if (add_to_list)
-        self->const_floats.emplace_back(v);
+        self->m_const_floats.emplace_back(v);
     return v;
 }
 
@@ -946,52 +902,52 @@ ir_value* ir_value_vector_member(ir_value *self, unsigned int member)
     if (member >= 3)
         return nullptr;
 
-    if (self->members[member])
-        return self->members[member];
+    if (self->m_members[member])
+        return self->m_members[member];
 
-    if (!self->name.empty()) {
+    if (!self->m_name.empty()) {
         char member_name[3] = { '_', char('x' + member), 0 };
-        name = self->name + member_name;
+        name = self->m_name + member_name;
     }
 
-    if (self->vtype == TYPE_VECTOR)
+    if (self->m_vtype == TYPE_VECTOR)
     {
-        m = new ir_value(move(name), self->store, TYPE_FLOAT);
+        m = new ir_value(move(name), self->m_store, TYPE_FLOAT);
         if (!m)
             return nullptr;
-        m->context = self->context;
+        m->m_context = self->m_context;
 
-        self->members[member] = m;
-        m->code.addroffset = member;
+        self->m_members[member] = m;
+        m->m_code.addroffset = member;
     }
-    else if (self->vtype == TYPE_FIELD)
+    else if (self->m_vtype == TYPE_FIELD)
     {
-        if (self->fieldtype != TYPE_VECTOR)
+        if (self->m_fieldtype != TYPE_VECTOR)
             return nullptr;
-        m = new ir_value(move(name), self->store, TYPE_FIELD);
+        m = new ir_value(move(name), self->m_store, TYPE_FIELD);
         if (!m)
             return nullptr;
-        m->fieldtype = TYPE_FLOAT;
-        m->context = self->context;
+        m->m_fieldtype = TYPE_FLOAT;
+        m->m_context = self->m_context;
 
-        self->members[member] = m;
-        m->code.addroffset = member;
+        self->m_members[member] = m;
+        m->m_code.addroffset = member;
     }
     else
     {
-        irerror(self->context, "invalid member access on %s", self->name.c_str());
+        irerror(self->m_context, "invalid member access on %s", self->m_name.c_str());
         return nullptr;
     }
 
-    m->memberof = self;
+    m->m_memberof = self;
     return m;
 }
 
 static GMQCC_INLINE size_t ir_value_sizeof(const ir_value *self)
 {
-    if (self->vtype == TYPE_FIELD && self->fieldtype == TYPE_VECTOR)
+    if (self->m_vtype == TYPE_FIELD && self->m_fieldtype == TYPE_VECTOR)
         return type_sizeof_[TYPE_VECTOR];
-    return type_sizeof_[self->vtype];
+    return type_sizeof_[self->m_vtype];
 }
 
 static ir_value* ir_value_out(ir_function *owner, const char *name, store_type storetype, qc_type vtype)
@@ -1005,63 +961,63 @@ static ir_value* ir_value_out(ir_function *owner, const char *name, store_type s
 
 bool ir_value_set_float(ir_value *self, float f)
 {
-    if (self->vtype != TYPE_FLOAT)
+    if (self->m_vtype != TYPE_FLOAT)
         return false;
-    self->constval.vfloat = f;
-    self->hasvalue = true;
+    self->m_constval.vfloat = f;
+    self->m_hasvalue = true;
     return true;
 }
 
 bool ir_value_set_func(ir_value *self, int f)
 {
-    if (self->vtype != TYPE_FUNCTION)
+    if (self->m_vtype != TYPE_FUNCTION)
         return false;
-    self->constval.vint = f;
-    self->hasvalue = true;
+    self->m_constval.vint = f;
+    self->m_hasvalue = true;
     return true;
 }
 
 bool ir_value_set_vector(ir_value *self, vec3_t v)
 {
-    if (self->vtype != TYPE_VECTOR)
+    if (self->m_vtype != TYPE_VECTOR)
         return false;
-    self->constval.vvec = v;
-    self->hasvalue = true;
+    self->m_constval.vvec = v;
+    self->m_hasvalue = true;
     return true;
 }
 
 bool ir_value_set_field(ir_value *self, ir_value *fld)
 {
-    if (self->vtype != TYPE_FIELD)
+    if (self->m_vtype != TYPE_FIELD)
         return false;
-    self->constval.vpointer = fld;
-    self->hasvalue = true;
+    self->m_constval.vpointer = fld;
+    self->m_hasvalue = true;
     return true;
 }
 
 bool ir_value_set_string(ir_value *self, const char *str)
 {
-    if (self->vtype != TYPE_STRING)
+    if (self->m_vtype != TYPE_STRING)
         return false;
-    self->constval.vstring = util_strdupe(str);
-    self->hasvalue = true;
+    self->m_constval.vstring = util_strdupe(str);
+    self->m_hasvalue = true;
     return true;
 }
 
 #if 0
 bool ir_value_set_int(ir_value *self, int i)
 {
-    if (self->vtype != TYPE_INTEGER)
+    if (self->m_vtype != TYPE_INTEGER)
         return false;
-    self->constval.vint = i;
-    self->hasvalue = true;
+    self->m_constval.vint = i;
+    self->m_hasvalue = true;
     return true;
 }
 #endif
 
 bool ir_value_lives(ir_value *self, size_t at)
 {
-    for (auto& l : self->life) {
+    for (auto& l : self->m_life) {
         if (l.start <= at && at <= l.end)
             return true;
         if (l.start > at) /* since it's ordered */
@@ -1072,14 +1028,14 @@ bool ir_value_lives(ir_value *self, size_t at)
 
 static bool ir_value_life_insert(ir_value *self, size_t idx, ir_life_entry_t e)
 {
-    self->life.insert(self->life.begin() + idx, e);
+    self->m_life.insert(self->m_life.begin() + idx, e);
     return true;
 }
 
 static bool ir_value_life_merge(ir_value *self, size_t s)
 {
     size_t i;
-    const size_t vs = self->life.size();
+    const size_t vs = self->m_life.size();
     ir_life_entry_t *life_found = nullptr;
     ir_life_entry_t *before = nullptr;
     ir_life_entry_t new_entry;
@@ -1088,7 +1044,7 @@ static bool ir_value_life_merge(ir_value *self, size_t s)
     for (i = 0; i < vs; ++i)
     {
         before = life_found;
-        life_found = &self->life[i];
+        life_found = &self->m_life[i];
         if (life_found->start > s)
             break;
     }
@@ -1104,7 +1060,7 @@ static bool ir_value_life_merge(ir_value *self, size_t s)
         if (life_found && life_found->end >= s)
             return false;
         e.start = e.end = s;
-        self->life.emplace_back(e);
+        self->m_life.emplace_back(e);
         return true;
     }
     /* found */
@@ -1115,7 +1071,7 @@ static bool ir_value_life_merge(ir_value *self, size_t s)
         {
             /* merge */
             before->end = life_found->end;
-            self->life.erase(self->life.begin()+i);
+            self->m_life.erase(self->m_life.begin()+i);
             return true;
         }
         if (before->end + 1 == s)
@@ -1143,21 +1099,21 @@ static bool ir_value_life_merge_into(ir_value *self, const ir_value *other)
 {
     size_t i, myi;
 
-    if (other->life.empty())
+    if (other->m_life.empty())
         return true;
 
-    if (self->life.empty()) {
-        self->life = other->life;
+    if (self->m_life.empty()) {
+        self->m_life = other->m_life;
         return true;
     }
 
     myi = 0;
-    for (i = 0; i < other->life.size(); ++i)
+    for (i = 0; i < other->m_life.size(); ++i)
     {
-        const ir_life_entry_t &otherlife = other->life[i];
+        const ir_life_entry_t &otherlife = other->m_life[i];
         while (true)
         {
-            ir_life_entry_t *entry = &self->life[myi];
+            ir_life_entry_t *entry = &self->m_life[myi];
 
             if (otherlife.end+1 < entry->start)
             {
@@ -1183,14 +1139,14 @@ static bool ir_value_life_merge_into(ir_value *self, const ir_value *other)
             }
 
             /* see if our change combines it with the next ranges */
-            while (myi+1 < self->life.size() &&
-                   entry->end+1 >= self->life[1+myi].start)
+            while (myi+1 < self->m_life.size() &&
+                   entry->end+1 >= self->m_life[1+myi].start)
             {
                 /* overlaps with (myi+1) */
-                if (entry->end < self->life[1+myi].end)
-                    entry->end = self->life[1+myi].end;
-                self->life.erase(self->life.begin() + (myi + 1));
-                entry = &self->life[myi];
+                if (entry->end < self->m_life[1+myi].end)
+                    entry->end = self->m_life[1+myi].end;
+                self->m_life.erase(self->m_life.begin() + (myi + 1));
+                entry = &self->m_life[myi];
             }
 
             /* see if we're after the entry */
@@ -1198,8 +1154,8 @@ static bool ir_value_life_merge_into(ir_value *self, const ir_value *other)
             {
                 ++myi;
                 /* append if we're at the end */
-                if (myi >= self->life.size()) {
-                    self->life.emplace_back(otherlife);
+                if (myi >= self->m_life.size()) {
+                    self->m_life.emplace_back(otherlife);
                     break;
                 }
                 /* otherweise check the next range */
@@ -1223,13 +1179,13 @@ static bool ir_values_overlap(const ir_value *a, const ir_value *b)
     const ir_life_entry_t *la, *lb, *enda, *endb;
 
     /* first of all, if either has no life range, they cannot clash */
-    if (a->life.empty() || b->life.empty())
+    if (a->m_life.empty() || b->m_life.empty())
         return false;
 
-    la = &a->life.front();
-    lb = &b->life.front();
-    enda = &a->life.back() + 1;
-    endb = &b->life.back() + 1;
+    la = &a->m_life.front();
+    lb = &b->m_life.front();
+    enda = &a->m_life.back() + 1;
+    endb = &b->m_life.back() + 1;
     while (true)
     {
         /* check if the entries overlap, for that,
@@ -1272,9 +1228,9 @@ static bool ir_values_overlap(const ir_value *a, const ir_value *b)
 static bool ir_check_unreachable(ir_block *self)
 {
     /* The IR should never have to deal with unreachable code */
-    if (!self->final/* || OPTS_FLAG(ALLOW_UNREACHABLE_CODE)*/)
+    if (!self->m_final/* || OPTS_FLAG(ALLOW_UNREACHABLE_CODE)*/)
         return true;
-    irerror(self->context, "unreachable statement (%s)", self->label.c_str());
+    irerror(self->m_context, "unreachable statement (%s)", self->m_label.c_str());
     return false;
 }
 
@@ -1284,12 +1240,12 @@ bool ir_block_create_store_op(ir_block *self, lex_ctx_t ctx, int op, ir_value *t
     if (!ir_check_unreachable(self))
         return false;
 
-    if (target->store == store_value &&
+    if (target->m_store == store_value &&
         (op < INSTR_STOREP_F || op > INSTR_STOREP_FNC))
     {
-        irerror(self->context, "cannot store to an SSA value");
-        irerror(self->context, "trying to store: %s <- %s", target->name.c_str(), what->name.c_str());
-        irerror(self->context, "instruction: %s", util_instr_str[op]);
+        irerror(self->m_context, "cannot store to an SSA value");
+        irerror(self->m_context, "trying to store: %s <- %s", target->m_name.c_str(), what->m_name.c_str());
+        irerror(self->m_context, "instruction: %s", util_instr_str[op]);
         return false;
     }
 
@@ -1303,7 +1259,7 @@ bool ir_block_create_store_op(ir_block *self, lex_ctx_t ctx, int op, ir_value *t
         delete in;
         return false;
     }
-    vec_push(self->instr, in);
+    vec_push(self->m_instr, in);
     return true;
 }
 
@@ -1323,7 +1279,7 @@ bool ir_block_create_state_op(ir_block *self, lex_ctx_t ctx, ir_value *frame, ir
         delete in;
         return false;
     }
-    vec_push(self->instr, in);
+    vec_push(self->m_instr, in);
     return true;
 }
 
@@ -1331,21 +1287,21 @@ static bool ir_block_create_store(ir_block *self, lex_ctx_t ctx, ir_value *targe
 {
     int op = 0;
     qc_type vtype;
-    if (target->vtype == TYPE_VARIANT)
-        vtype = what->vtype;
+    if (target->m_vtype == TYPE_VARIANT)
+        vtype = what->m_vtype;
     else
-        vtype = target->vtype;
+        vtype = target->m_vtype;
 
 #if 0
-    if      (vtype == TYPE_FLOAT   && what->vtype == TYPE_INTEGER)
+    if      (vtype == TYPE_FLOAT   && what->m_vtype == TYPE_INTEGER)
         op = INSTR_CONV_ITOF;
-    else if (vtype == TYPE_INTEGER && what->vtype == TYPE_FLOAT)
+    else if (vtype == TYPE_INTEGER && what->m_vtype == TYPE_FLOAT)
         op = INSTR_CONV_FTOI;
 #endif
         op = type_store_instr[vtype];
 
     if (OPTS_FLAG(ADJUST_VECTOR_FIELDS)) {
-        if (op == INSTR_STORE_FLD && what->fieldtype == TYPE_VECTOR)
+        if (op == INSTR_STORE_FLD && what->m_fieldtype == TYPE_VECTOR)
             op = INSTR_STORE_V;
     }
 
@@ -1357,17 +1313,17 @@ bool ir_block_create_storep(ir_block *self, lex_ctx_t ctx, ir_value *target, ir_
     int op = 0;
     qc_type vtype;
 
-    if (target->vtype != TYPE_POINTER)
+    if (target->m_vtype != TYPE_POINTER)
         return false;
 
     /* storing using pointer - target is a pointer, type must be
      * inferred from source
      */
-    vtype = what->vtype;
+    vtype = what->m_vtype;
 
     op = type_storep_instr[vtype];
     if (OPTS_FLAG(ADJUST_VECTOR_FIELDS)) {
-        if (op == INSTR_STOREP_FLD && what->fieldtype == TYPE_VECTOR)
+        if (op == INSTR_STOREP_FLD && what->m_fieldtype == TYPE_VECTOR)
             op = INSTR_STOREP_V;
     }
 
@@ -1380,9 +1336,9 @@ bool ir_block_create_return(ir_block *self, lex_ctx_t ctx, ir_value *v)
     if (!ir_check_unreachable(self))
         return false;
 
-    self->final = true;
+    self->m_final = true;
 
-    self->is_return = true;
+    self->m_is_return = true;
     in = new ir_instr(ctx, self, INSTR_RETURN);
     if (!in)
         return false;
@@ -1392,7 +1348,7 @@ bool ir_block_create_return(ir_block *self, lex_ctx_t ctx, ir_value *v)
         return false;
     }
 
-    vec_push(self->instr, in);
+    vec_push(self->m_instr, in);
     return true;
 }
 
@@ -1402,8 +1358,8 @@ bool ir_block_create_if(ir_block *self, lex_ctx_t ctx, ir_value *v,
     ir_instr *in;
     if (!ir_check_unreachable(self))
         return false;
-    self->final = true;
-    /*in = new ir_instr(ctx, self, (v->vtype == TYPE_STRING ? INSTR_IF_S : INSTR_IF_F));*/
+    self->m_final = true;
+    /*in = new ir_instr(ctx, self, (v->m_vtype == TYPE_STRING ? INSTR_IF_S : INSTR_IF_F));*/
     in = new ir_instr(ctx, self, VINSTR_COND);
     if (!in)
         return false;
@@ -1413,15 +1369,15 @@ bool ir_block_create_if(ir_block *self, lex_ctx_t ctx, ir_value *v,
         return false;
     }
 
-    in->bops[0] = ontrue;
-    in->bops[1] = onfalse;
+    in->m_bops[0] = ontrue;
+    in->m_bops[1] = onfalse;
 
-    vec_push(self->instr, in);
+    vec_push(self->m_instr, in);
 
-    vec_push(self->exits, ontrue);
-    vec_push(self->exits, onfalse);
-    vec_push(ontrue->entries,  self);
-    vec_push(onfalse->entries, self);
+    vec_push(self->m_exits, ontrue);
+    vec_push(self->m_exits, onfalse);
+    vec_push(ontrue->m_entries,  self);
+    vec_push(onfalse->m_entries, self);
     return true;
 }
 
@@ -1430,22 +1386,22 @@ bool ir_block_create_jump(ir_block *self, lex_ctx_t ctx, ir_block *to)
     ir_instr *in;
     if (!ir_check_unreachable(self))
         return false;
-    self->final = true;
+    self->m_final = true;
     in = new ir_instr(ctx, self, VINSTR_JUMP);
     if (!in)
         return false;
 
-    in->bops[0] = to;
-    vec_push(self->instr, in);
+    in->m_bops[0] = to;
+    vec_push(self->m_instr, in);
 
-    vec_push(self->exits, to);
-    vec_push(to->entries, self);
+    vec_push(self->m_exits, to);
+    vec_push(to->m_entries, self);
     return true;
 }
 
 bool ir_block_create_goto(ir_block *self, lex_ctx_t ctx, ir_block *to)
 {
-    self->owner->flags |= IR_FLAG_HAS_GOTO;
+    self->m_owner->m_flags |= IR_FLAG_HAS_GOTO;
     return ir_block_create_jump(self, ctx, to);
 }
 
@@ -1458,7 +1414,7 @@ ir_instr* ir_block_create_phi(ir_block *self, lex_ctx_t ctx, const char *label,
     in = new ir_instr(ctx, self, VINSTR_PHI);
     if (!in)
         return nullptr;
-    out = ir_value_out(self->owner, label, store_value, ot);
+    out = ir_value_out(self->m_owner, label, store_value, ot);
     if (!out) {
         delete in;
         return nullptr;
@@ -1467,30 +1423,30 @@ ir_instr* ir_block_create_phi(ir_block *self, lex_ctx_t ctx, const char *label,
         delete in;
         return nullptr;
     }
-    vec_push(self->instr, in);
+    vec_push(self->m_instr, in);
     return in;
 }
 
 ir_value* ir_phi_value(ir_instr *self)
 {
-    return self->_ops[0];
+    return self->_m_ops[0];
 }
 
 void ir_phi_add(ir_instr* self, ir_block *b, ir_value *v)
 {
     ir_phi_entry_t pe;
 
-    if (!vec_ir_block_find(self->owner->entries, b, nullptr)) {
+    if (!vec_ir_block_find(self->m_owner->m_entries, b, nullptr)) {
         // Must not be possible to cause this, otherwise the AST
         // is doing something wrong.
-        irerror(self->context, "Invalid entry block for PHI");
+        irerror(self->m_context, "Invalid entry block for PHI");
         exit(EXIT_FAILURE);
     }
 
     pe.value = v;
     pe.from = b;
-    v->reads.push_back(self);
-    self->phi.push_back(pe);
+    v->m_reads.push_back(self);
+    self->m_phi.push_back(pe);
 }
 
 /* call related code */
@@ -1504,10 +1460,10 @@ ir_instr* ir_block_create_call(ir_block *self, lex_ctx_t ctx, const char *label,
     if (!in)
         return nullptr;
     if (noreturn) {
-        self->final = true;
-        self->is_return = true;
+        self->m_final = true;
+        self->m_is_return = true;
     }
-    out = ir_value_out(self->owner, label, (func->outtype == TYPE_VOID) ? store_return : store_value, func->outtype);
+    out = ir_value_out(self->m_owner, label, (func->m_outtype == TYPE_VOID) ? store_return : store_value, func->m_outtype);
     if (!out) {
         delete in;
         return nullptr;
@@ -1518,7 +1474,7 @@ ir_instr* ir_block_create_call(ir_block *self, lex_ctx_t ctx, const char *label,
         delete in;
         return nullptr;
     }
-    vec_push(self->instr, in);
+    vec_push(self->m_instr, in);
     /*
     if (noreturn) {
         if (!ir_block_create_return(self, ctx, nullptr)) {
@@ -1533,13 +1489,13 @@ ir_instr* ir_block_create_call(ir_block *self, lex_ctx_t ctx, const char *label,
 
 ir_value* ir_call_value(ir_instr *self)
 {
-    return self->_ops[0];
+    return self->_m_ops[0];
 }
 
 void ir_call_param(ir_instr* self, ir_value *v)
 {
-    self->params.push_back(v);
-    v->reads.push_back(self);
+    self->m_params.push_back(v);
+    v->m_reads.push_back(self);
 }
 
 /* binary op related code */
@@ -1688,7 +1644,7 @@ ir_value* ir_block_create_unary(ir_block *self, lex_ctx_t ctx,
             return ir_block_create_general_instr(self, ctx, label, INSTR_SUB_V, nullptr, operand, TYPE_VECTOR);
 
         default:
-            ot = operand->vtype;
+            ot = operand->m_vtype;
             break;
     };
     if (ot == TYPE_VOID) {
@@ -1706,7 +1662,7 @@ static ir_value* ir_block_create_general_instr(ir_block *self, lex_ctx_t ctx, co
     ir_instr *instr;
     ir_value *out;
 
-    out = ir_value_out(self->owner, label, store_value, outype);
+    out = ir_value_out(self->m_owner, label, store_value, outype);
     if (!out)
         return nullptr;
 
@@ -1722,7 +1678,7 @@ static ir_value* ir_block_create_general_instr(ir_block *self, lex_ctx_t ctx, co
         goto on_error;
     }
 
-    vec_push(self->instr, instr);
+    vec_push(self->m_instr, instr);
 
     return out;
 on_error:
@@ -1735,25 +1691,25 @@ ir_value* ir_block_create_fieldaddress(ir_block *self, lex_ctx_t ctx, const char
     ir_value *v;
 
     /* Support for various pointer types todo if so desired */
-    if (ent->vtype != TYPE_ENTITY)
+    if (ent->m_vtype != TYPE_ENTITY)
         return nullptr;
 
-    if (field->vtype != TYPE_FIELD)
+    if (field->m_vtype != TYPE_FIELD)
         return nullptr;
 
     v = ir_block_create_general_instr(self, ctx, label, INSTR_ADDRESS, ent, field, TYPE_POINTER);
-    v->fieldtype = field->fieldtype;
+    v->m_fieldtype = field->m_fieldtype;
     return v;
 }
 
 ir_value* ir_block_create_load_from_ent(ir_block *self, lex_ctx_t ctx, const char *label, ir_value *ent, ir_value *field, qc_type outype)
 {
     int op;
-    if (ent->vtype != TYPE_ENTITY)
+    if (ent->m_vtype != TYPE_ENTITY)
         return nullptr;
 
     /* at some point we could redirect for TYPE_POINTER... but that could lead to carelessness */
-    if (field->vtype != TYPE_FIELD)
+    if (field->m_vtype != TYPE_FIELD)
         return nullptr;
 
     switch (outype)
@@ -1769,7 +1725,7 @@ ir_value* ir_block_create_load_from_ent(ir_block *self, lex_ctx_t ctx, const cha
         case TYPE_INTEGER: op = INSTR_LOAD_I;   break;
 #endif
         default:
-            irerror(self->context, "invalid type for ir_block_create_load_from_ent: %s", type_name[outype]);
+            irerror(self->m_context, "invalid type for ir_block_create_load_from_ent: %s", type_name[outype]);
             return nullptr;
     }
 
@@ -1783,7 +1739,7 @@ ir_value* ir_block_create_load_from_ent(ir_block *self, lex_ctx_t ctx, const cha
 static bool ir_block_naive_phi(ir_block *self);
 bool ir_function_naive_phi(ir_function *self)
 {
-    for (auto& b : self->blocks)
+    for (auto& b : self->m_blocks)
         if (!ir_block_naive_phi(b.get()))
             return false;
     return true;
@@ -1796,33 +1752,33 @@ static bool ir_block_naive_phi(ir_block *self)
      * to a list so we don't need to loop through blocks
      * - anyway: "don't optimize YET"
      */
-    for (i = 0; i < vec_size(self->instr); ++i)
+    for (i = 0; i < vec_size(self->m_instr); ++i)
     {
-        ir_instr *instr = self->instr[i];
-        if (instr->opcode != VINSTR_PHI)
+        ir_instr *instr = self->m_instr[i];
+        if (instr->m_opcode != VINSTR_PHI)
             continue;
 
-        vec_remove(self->instr, i, 1);
+        vec_remove(self->m_instr, i, 1);
         --i; /* NOTE: i+1 below */
 
-        for (auto &it : instr->phi) {
+        for (auto &it : instr->m_phi) {
             ir_value *v = it.value;
             ir_block *b = it.from;
-            if (v->store == store_value && v->reads.size() == 1 && v->writes.size() == 1) {
+            if (v->m_store == store_value && v->m_reads.size() == 1 && v->m_writes.size() == 1) {
                 /* replace the value */
-                if (!ir_instr_op(v->writes[0], 0, instr->_ops[0], true))
+                if (!ir_instr_op(v->m_writes[0], 0, instr->_m_ops[0], true))
                     return false;
             } else {
                 /* force a move instruction */
-                ir_instr *prevjump = vec_last(b->instr);
-                vec_pop(b->instr);
-                b->final = false;
-                instr->_ops[0]->store = store_global;
-                if (!ir_block_create_store(b, instr->context, instr->_ops[0], v))
+                ir_instr *prevjump = vec_last(b->m_instr);
+                vec_pop(b->m_instr);
+                b->m_final = false;
+                instr->_m_ops[0]->m_store = store_global;
+                if (!ir_block_create_store(b, instr->m_context, instr->_m_ops[0], v))
                     return false;
-                instr->_ops[0]->store = store_value;
-                vec_push(b->instr, prevjump);
-                b->final = true;
+                instr->_m_ops[0]->m_store = store_value;
+                vec_push(b->m_instr, prevjump);
+                b->m_final = true;
             }
         }
         delete instr;
@@ -1845,9 +1801,9 @@ static void ir_block_enumerate(ir_block *self, size_t *_eid)
 {
     size_t i;
     size_t eid = *_eid;
-    for (i = 0; i < vec_size(self->instr); ++i)
+    for (i = 0; i < vec_size(self->m_instr); ++i)
     {
-        self->instr[i]->eid = eid++;
+        self->m_instr[i]->m_eid = eid++;
     }
     *_eid = eid;
 }
@@ -1861,13 +1817,13 @@ void ir_function_enumerate(ir_function *self)
 {
     size_t instruction_id = 0;
     size_t block_eid = 0;
-    for (auto& block : self->blocks)
+    for (auto& block : self->m_blocks)
     {
         /* each block now gets an additional "entry" instruction id
          * we can use to avoid point-life issues
          */
-        block->entry_id = instruction_id;
-        block->eid      = block_eid;
+        block->m_entry_id = instruction_id;
+        block->m_eid      = block_eid;
         ++instruction_id;
         ++block_eid;
 
@@ -1892,9 +1848,9 @@ static bool function_allocator_alloc(function_allocator *alloc, ir_value *var)
     ir_value *slot;
     size_t vsize = ir_value_sizeof(var);
 
-    var->code.local = vec_size(alloc->locals);
+    var->m_code.local = vec_size(alloc->locals);
 
-    slot = new ir_value("reg", store_global, var->vtype);
+    slot = new ir_value("reg", store_global, var->m_vtype);
     if (!slot)
         return false;
 
@@ -1903,7 +1859,7 @@ static bool function_allocator_alloc(function_allocator *alloc, ir_value *var)
 
     vec_push(alloc->locals, slot);
     vec_push(alloc->sizes, vsize);
-    vec_push(alloc->unique, var->unique_life);
+    vec_push(alloc->unique, var->m_unique_life);
 
     return true;
 
@@ -1917,7 +1873,7 @@ static bool ir_function_allocator_assign(ir_function *self, function_allocator *
     size_t a;
     ir_value *slot;
 
-    if (v->unique_life)
+    if (v->m_unique_life)
         return function_allocator_alloc(alloc, v);
 
     for (a = 0; a < vec_size(alloc->locals); ++a)
@@ -1931,7 +1887,7 @@ static bool ir_function_allocator_assign(ir_function *self, function_allocator *
         /* never resize parameters
          * will be required later when overlapping temps + locals
          */
-        if (a < vec_size(self->params) &&
+        if (a < vec_size(self->m_params) &&
             alloc->sizes[a] < ir_value_sizeof(v))
         {
             continue;
@@ -1947,7 +1903,7 @@ static bool ir_function_allocator_assign(ir_function *self, function_allocator *
         if (alloc->sizes[a] < ir_value_sizeof(v))
             alloc->sizes[a] = ir_value_sizeof(v);
 
-        v->code.local = a;
+        v->m_code.local = a;
         return true;
     }
     if (a >= vec_size(alloc->locals)) {
@@ -1965,7 +1921,7 @@ bool ir_function_allocate_locals(ir_function *self)
 
     function_allocator lockalloc, globalloc;
 
-    if (self->locals.empty() && self->values.empty())
+    if (self->m_locals.empty() && self->m_values.empty())
         return true;
 
     globalloc.locals    = nullptr;
@@ -1978,86 +1934,86 @@ bool ir_function_allocate_locals(ir_function *self)
     lockalloc.unique    = nullptr;
 
     size_t i;
-    for (i = 0; i < self->locals.size(); ++i)
+    for (i = 0; i < self->m_locals.size(); ++i)
     {
-        ir_value *v = self->locals[i].get();
-        if ((self->flags & IR_FLAG_MASK_NO_LOCAL_TEMPS) || !OPTS_OPTIMIZATION(OPTIM_LOCAL_TEMPS)) {
-            v->locked      = true;
-            v->unique_life = true;
+        ir_value *v = self->m_locals[i].get();
+        if ((self->m_flags & IR_FLAG_MASK_NO_LOCAL_TEMPS) || !OPTS_OPTIMIZATION(OPTIM_LOCAL_TEMPS)) {
+            v->m_locked      = true;
+            v->m_unique_life = true;
         }
-        else if (i >= vec_size(self->params))
+        else if (i >= vec_size(self->m_params))
             break;
         else
-            v->locked = true; /* lock parameters locals */
-        if (!function_allocator_alloc((v->locked || !opt_gt ? &lockalloc : &globalloc), v))
+            v->m_locked = true; /* lock parameters locals */
+        if (!function_allocator_alloc((v->m_locked || !opt_gt ? &lockalloc : &globalloc), v))
             goto error;
     }
-    for (; i < self->locals.size(); ++i)
+    for (; i < self->m_locals.size(); ++i)
     {
-        ir_value *v = self->locals[i].get();
-        if (v->life.empty())
+        ir_value *v = self->m_locals[i].get();
+        if (v->m_life.empty())
             continue;
-        if (!ir_function_allocator_assign(self, (v->locked || !opt_gt ? &lockalloc : &globalloc), v))
+        if (!ir_function_allocator_assign(self, (v->m_locked || !opt_gt ? &lockalloc : &globalloc), v))
             goto error;
     }
 
     /* Allocate a slot for any value that still exists */
-    for (i = 0; i < self->values.size(); ++i)
+    for (i = 0; i < self->m_values.size(); ++i)
     {
-        ir_value *v = self->values[i].get();
+        ir_value *v = self->m_values[i].get();
 
-        if (v->life.empty())
+        if (v->m_life.empty())
             continue;
 
         /* CALL optimization:
          * If the value is a parameter-temp: 1 write, 1 read from a CALL
          * and it's not "locked", write it to the OFS_PARM directly.
          */
-        if (OPTS_OPTIMIZATION(OPTIM_CALL_STORES) && !v->locked && !v->unique_life) {
-            if (v->reads.size() == 1 && v->writes.size() == 1 &&
-                (v->reads[0]->opcode == VINSTR_NRCALL ||
-                 (v->reads[0]->opcode >= INSTR_CALL0 && v->reads[0]->opcode <= INSTR_CALL8)
+        if (OPTS_OPTIMIZATION(OPTIM_CALL_STORES) && !v->m_locked && !v->m_unique_life) {
+            if (v->m_reads.size() == 1 && v->m_writes.size() == 1 &&
+                (v->m_reads[0]->m_opcode == VINSTR_NRCALL ||
+                 (v->m_reads[0]->m_opcode >= INSTR_CALL0 && v->m_reads[0]->m_opcode <= INSTR_CALL8)
                 )
                )
             {
                 size_t param;
-                ir_instr *call = v->reads[0];
-                if (!vec_ir_value_find(call->params, v, &param)) {
-                    irerror(call->context, "internal error: unlocked parameter %s not found", v->name.c_str());
+                ir_instr *call = v->m_reads[0];
+                if (!vec_ir_value_find(call->m_params, v, &param)) {
+                    irerror(call->m_context, "internal error: unlocked parameter %s not found", v->m_name.c_str());
                     goto error;
                 }
                 ++opts_optimizationcount[OPTIM_CALL_STORES];
-                v->callparam = true;
+                v->m_callparam = true;
                 if (param < 8)
                     ir_value_code_setaddr(v, OFS_PARM0 + 3*param);
                 else {
-                    size_t nprotos = self->owner->extparam_protos.size();
+                    size_t nprotos = self->m_owner->m_extparam_protos.size();
                     ir_value *ep;
                     param -= 8;
                     if (nprotos > param)
-                        ep = self->owner->extparam_protos[param].get();
+                        ep = self->m_owner->m_extparam_protos[param].get();
                     else
                     {
-                        ep = ir_gen_extparam_proto(self->owner);
+                        ep = ir_gen_extparam_proto(self->m_owner);
                         while (++nprotos <= param)
-                            ep = ir_gen_extparam_proto(self->owner);
+                            ep = ir_gen_extparam_proto(self->m_owner);
                     }
-                    ir_instr_op(v->writes[0], 0, ep, true);
-                    call->params[param+8] = ep;
+                    ir_instr_op(v->m_writes[0], 0, ep, true);
+                    call->m_params[param+8] = ep;
                 }
                 continue;
             }
-            if (v->writes.size() == 1 && v->writes[0]->opcode == INSTR_CALL0) {
-                v->store = store_return;
-                if (v->members[0]) v->members[0]->store = store_return;
-                if (v->members[1]) v->members[1]->store = store_return;
-                if (v->members[2]) v->members[2]->store = store_return;
+            if (v->m_writes.size() == 1 && v->m_writes[0]->m_opcode == INSTR_CALL0) {
+                v->m_store = store_return;
+                if (v->m_members[0]) v->m_members[0]->m_store = store_return;
+                if (v->m_members[1]) v->m_members[1]->m_store = store_return;
+                if (v->m_members[2]) v->m_members[2]->m_store = store_return;
                 ++opts_optimizationcount[OPTIM_CALL_STORES];
                 continue;
             }
         }
 
-        if (!ir_function_allocator_assign(self, (v->locked || !opt_gt ? &lockalloc : &globalloc), v))
+        if (!ir_function_allocator_assign(self, (v->m_locked || !opt_gt ? &lockalloc : &globalloc), v))
             goto error;
     }
 
@@ -2075,7 +2031,7 @@ bool ir_function_allocate_locals(ir_function *self)
             pos = lockalloc.positions[i-1] + lockalloc.sizes[i-1];
             vec_push(lockalloc.positions, pos);
         }
-        self->allocated_locals = pos + vec_last(lockalloc.sizes);
+        self->m_allocated_locals = pos + vec_last(lockalloc.sizes);
     }
     if (globalloc.sizes) {
         pos = (vec_size(globalloc.sizes) ? globalloc.positions[0] : 0);
@@ -2084,22 +2040,22 @@ bool ir_function_allocate_locals(ir_function *self)
             pos = globalloc.positions[i-1] + globalloc.sizes[i-1];
             vec_push(globalloc.positions, pos);
         }
-        self->globaltemps = pos + vec_last(globalloc.sizes);
+        self->m_globaltemps = pos + vec_last(globalloc.sizes);
     }
 
     /* Locals need to know their new position */
-    for (auto& local : self->locals) {
-        if (local->locked || !opt_gt)
-            local->code.local = lockalloc.positions[local->code.local];
+    for (auto& local : self->m_locals) {
+        if (local->m_locked || !opt_gt)
+            local->m_code.local = lockalloc.positions[local->m_code.local];
         else
-            local->code.local = globalloc.positions[local->code.local];
+            local->m_code.local = globalloc.positions[local->m_code.local];
     }
     /* Take over the actual slot positions on values */
-    for (auto& value : self->values) {
-        if (value->locked || !opt_gt)
-            value->code.local = lockalloc.positions[value->code.local];
+    for (auto& value : self->m_values) {
+        if (value->m_locked || !opt_gt)
+            value->m_code.local = lockalloc.positions[value->m_code.local];
         else
-            value->code.local = globalloc.positions[value->code.local];
+            value->m_code.local = globalloc.positions[value->m_code.local];
     }
 
     goto cleanup;
@@ -2163,7 +2119,7 @@ static void ir_op_read_write(int op, size_t *read, size_t *write)
 
 static bool ir_block_living_add_instr(ir_block *self, size_t eid) {
     bool changed = false;
-    for (auto &it : self->living)
+    for (auto &it : self->m_living)
         if (ir_value_life_merge(it, eid))
             changed = true;
     return changed;
@@ -2171,10 +2127,10 @@ static bool ir_block_living_add_instr(ir_block *self, size_t eid) {
 
 static bool ir_block_living_lock(ir_block *self) {
     bool changed = false;
-    for (auto &it : self->living) {
-        if (it->locked)
+    for (auto &it : self->m_living) {
+        if (it->m_locked)
             continue;
-        it->locked = true;
+        it->m_locked = true;
         changed = true;
     }
     return changed;
@@ -2188,40 +2144,40 @@ static bool ir_block_life_propagate(ir_block *self, bool *changed)
     // bitmasks which operands are read from or written to
     size_t read, write;
 
-    self->living.clear();
+    self->m_living.clear();
 
-    p = vec_size(self->exits);
+    p = vec_size(self->m_exits);
     for (i = 0; i < p; ++i) {
-        ir_block *prev = self->exits[i];
-        for (auto &it : prev->living)
-            if (!vec_ir_value_find(self->living, it, nullptr))
-                self->living.push_back(it);
+        ir_block *prev = self->m_exits[i];
+        for (auto &it : prev->m_living)
+            if (!vec_ir_value_find(self->m_living, it, nullptr))
+                self->m_living.push_back(it);
     }
 
-    i = vec_size(self->instr);
+    i = vec_size(self->m_instr);
     while (i)
     { --i;
-        instr = self->instr[i];
+        instr = self->m_instr[i];
 
         /* See which operands are read and write operands */
-        ir_op_read_write(instr->opcode, &read, &write);
+        ir_op_read_write(instr->m_opcode, &read, &write);
 
         /* Go through the 3 main operands
          * writes first, then reads
          */
         for (o = 0; o < 3; ++o)
         {
-            if (!instr->_ops[o]) /* no such operand */
+            if (!instr->_m_ops[o]) /* no such operand */
                 continue;
 
-            value = instr->_ops[o];
+            value = instr->_m_ops[o];
 
             /* We only care about locals */
             /* we also calculate parameter liferanges so that locals
              * can take up parameter slots */
-            if (value->store != store_value &&
-                value->store != store_local &&
-                value->store != store_param)
+            if (value->m_store != store_value &&
+                value->m_store != store_local &&
+                value->m_store != store_param)
                 continue;
 
             /* write operands */
@@ -2232,7 +2188,7 @@ static bool ir_block_life_propagate(ir_block *self, bool *changed)
             if (write & (1<<o))
             {
                 size_t idx;
-                bool in_living = vec_ir_value_find(self->living, value, &idx);
+                bool in_living = vec_ir_value_find(self->m_living, value, &idx);
                 if (!in_living)
                 {
                     /* If the value isn't alive it hasn't been read before... */
@@ -2242,38 +2198,38 @@ static bool ir_block_life_propagate(ir_block *self, bool *changed)
                      * and make sure it's only printed once
                      * since this function is run multiple times.
                      */
-                    /* con_err( "Value only written %s\n", value->name); */
-                    if (ir_value_life_merge(value, instr->eid))
+                    /* con_err( "Value only written %s\n", value->m_name); */
+                    if (ir_value_life_merge(value, instr->m_eid))
                         *changed = true;
                 } else {
                     /* since 'living' won't contain it
                      * anymore, merge the value, since
                      * (A) doesn't.
                      */
-                    if (ir_value_life_merge(value, instr->eid))
+                    if (ir_value_life_merge(value, instr->m_eid))
                         *changed = true;
                     // Then remove
-                    self->living.erase(self->living.begin() + idx);
+                    self->m_living.erase(self->m_living.begin() + idx);
                 }
                 /* Removing a vector removes all members */
                 for (mem = 0; mem < 3; ++mem) {
-                    if (value->members[mem] && vec_ir_value_find(self->living, value->members[mem], &idx)) {
-                        if (ir_value_life_merge(value->members[mem], instr->eid))
+                    if (value->m_members[mem] && vec_ir_value_find(self->m_living, value->m_members[mem], &idx)) {
+                        if (ir_value_life_merge(value->m_members[mem], instr->m_eid))
                             *changed = true;
-                        self->living.erase(self->living.begin() + idx);
+                        self->m_living.erase(self->m_living.begin() + idx);
                     }
                 }
                 /* Removing the last member removes the vector */
-                if (value->memberof) {
-                    value = value->memberof;
+                if (value->m_memberof) {
+                    value = value->m_memberof;
                     for (mem = 0; mem < 3; ++mem) {
-                        if (value->members[mem] && vec_ir_value_find(self->living, value->members[mem], nullptr))
+                        if (value->m_members[mem] && vec_ir_value_find(self->m_living, value->m_members[mem], nullptr))
                             break;
                     }
-                    if (mem == 3 && vec_ir_value_find(self->living, value, &idx)) {
-                        if (ir_value_life_merge(value, instr->eid))
+                    if (mem == 3 && vec_ir_value_find(self->m_living, value, &idx)) {
+                        if (ir_value_life_merge(value, instr->m_eid))
                             *changed = true;
-                        self->living.erase(self->living.begin() + idx);
+                        self->m_living.erase(self->m_living.begin() + idx);
                     }
                 }
             }
@@ -2282,105 +2238,105 @@ static bool ir_block_life_propagate(ir_block *self, bool *changed)
         /* These operations need a special case as they can break when using
          * same source and destination operand otherwise, as the engine may
          * read the source multiple times. */
-        if (instr->opcode == INSTR_MUL_VF ||
-            instr->opcode == VINSTR_BITAND_VF ||
-            instr->opcode == VINSTR_BITOR_VF ||
-            instr->opcode == VINSTR_BITXOR ||
-            instr->opcode == VINSTR_BITXOR_VF ||
-            instr->opcode == VINSTR_BITXOR_V ||
-            instr->opcode == VINSTR_CROSS)
+        if (instr->m_opcode == INSTR_MUL_VF ||
+            instr->m_opcode == VINSTR_BITAND_VF ||
+            instr->m_opcode == VINSTR_BITOR_VF ||
+            instr->m_opcode == VINSTR_BITXOR ||
+            instr->m_opcode == VINSTR_BITXOR_VF ||
+            instr->m_opcode == VINSTR_BITXOR_V ||
+            instr->m_opcode == VINSTR_CROSS)
         {
-            value = instr->_ops[2];
+            value = instr->_m_ops[2];
             /* the float source will get an additional lifetime */
-            if (ir_value_life_merge(value, instr->eid+1))
+            if (ir_value_life_merge(value, instr->m_eid+1))
                 *changed = true;
-            if (value->memberof && ir_value_life_merge(value->memberof, instr->eid+1))
+            if (value->m_memberof && ir_value_life_merge(value->m_memberof, instr->m_eid+1))
                 *changed = true;
         }
 
-        if (instr->opcode == INSTR_MUL_FV ||
-            instr->opcode == INSTR_LOAD_V ||
-            instr->opcode == VINSTR_BITXOR ||
-            instr->opcode == VINSTR_BITXOR_VF ||
-            instr->opcode == VINSTR_BITXOR_V ||
-            instr->opcode == VINSTR_CROSS)
+        if (instr->m_opcode == INSTR_MU