Comments and file header added.
[libfirm] / scripts / ir_spec.py
index e26648b..7c60336 100755 (executable)
@@ -43,9 +43,7 @@ class Alloc(Op):
        pinned      = "yes"
        attr_struct = "alloc_attr"
        d_post = '''
-       #if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_Alloc, &res->attr.alloc.exc.frag_arr);
-       #endif
        '''
 
 class Anchor(Op):
@@ -95,11 +93,12 @@ class ASM(Op):
        java_noconstr = True
 
 class Bad(Op):
-       mode       = "mode_Bad"
-       flags      = [ "cfopcode", "fragile", "start_block", "dump_noblock" ]
-       pinned     = "yes"
-       knownBlock = True
-       singleton  = True
+       mode        = "mode_Bad"
+       flags       = [ "cfopcode", "fragile", "start_block", "dump_noblock" ]
+       pinned      = "yes"
+       knownBlock  = True
+       singleton   = True
+       attr_struct = "irg_attr"
        init = '''
        res->attr.irg.irg = irg;
        '''
@@ -197,9 +196,7 @@ class Bound(Op):
        pinned_init = "op_pin_state_pinned"
        attr_struct = "bound_attr"
        d_post = '''
-       #if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_Bound, &res->attr.bound.exc.frag_arr);
-       #endif
        '''
 
 class Break(Op):
@@ -238,6 +235,12 @@ class Call(Op):
                dict(
                        type = "ir_type*",
                        name = "type"
+               ),
+               dict(
+                       type = "unsigned",
+                       name = "tail_call",
+                       # the tail call attribute can only be set by analysis
+                       init = "0"
                )
        ]
        attr_struct = "call_attr"
@@ -247,9 +250,7 @@ class Call(Op):
        assert((get_unknown_type() == type) || is_Method_type(type));
        '''
        d_post = '''
-       #if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_Call, &res->attr.call.exc.frag_arr);
-       #endif
        '''
 
 class CallBegin(Op):
@@ -368,9 +369,7 @@ class CopyB(Op):
        pinned      = "memory"
        pinned_init = "op_pin_state_pinned"
        d_post = '''
-       #if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_CopyB, &res->attr.copyb.exc.frag_arr);
-       #endif
        '''
 
 class Div(Op):
@@ -398,9 +397,7 @@ class Div(Op):
        op_index    = 1
        arity_override = "oparity_binary"
        d_post = '''
-       #if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_Div, &res->attr.except.frag_arr);
-       #endif
        '''
 
 class DivMod(Op):
@@ -419,9 +416,7 @@ class DivMod(Op):
        op_index    = 1
        arity_override = "oparity_binary"
        d_post = '''
-       #if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_DivMod, &res->attr.except.frag_arr);
-       #endif
        '''
 
 class Dummy(Op):
@@ -538,9 +533,7 @@ class Load(Op):
                ),
        ]
        d_post = '''
-#if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_Load, &res->attr.load.exc.frag_arr);
-#endif
        '''
 
 class Minus(Unop):
@@ -562,9 +555,7 @@ class Mod(Op):
        op_index    = 1
        arity_override = "oparity_binary"
        d_post = '''
-       #if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_Mod, &res->attr.except.frag_arr);
-       #endif
        '''
 
 class Mul(Binop):
@@ -641,9 +632,7 @@ class Quot(Op):
        op_index    = 1
        arity_override = "oparity_binary"
        d_post = '''
-       #if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_Quot, &res->attr.except.frag_arr);
-       #endif
        '''
 
 class Raise(Op):
@@ -705,9 +694,7 @@ class Store(Op):
                ),
        ]
        d_post = '''
-#if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_Store, &res->attr.store.exc.frag_arr);
-#endif
        '''
 
 class Sub(Binop):