avoid new_NoMem in favor or get_irg_no_mem
[libfirm] / scripts / ir_spec.py
index 4a763d1..9a193d6 100755 (executable)
@@ -259,7 +259,6 @@ class Call(Op):
                ("X_regular",        "control flow when no exception occurs", "pn_Generic_X_regular"),
                ("X_except",         "control flow when exception occured",   "pn_Generic_X_except"),
                ("T_result",         "tuple containing all results",          "pn_Generic_other"),
-               ("P_value_res_base", "pointer to memory register containing copied results passed by value"),
        ]
        flags    = [ "fragile", "uses_memory" ]
        attrs    = [
@@ -302,7 +301,7 @@ class Cast(Unop):
        init     = "assert(is_atomic_type(type));"
 
 class Cmp(Binop):
-       """Compares its two operands and checks wether a specified
+       """Compares its two operands and checks whether a specified
           relation (like less or equal) is fulfilled."""
        flags = []
        mode  = "mode_b"
@@ -539,7 +538,7 @@ class IJmp(Op):
        flags    = [ "cfopcode", "forking", "keep" ]
 
 class InstOf(Op):
-       """Tests wether an object is an instance of a class-type"""
+       """Tests whether an object is an instance of a class-type"""
        ins   = [
           ("store", "memory dependency"),
           ("obj",   "pointer to object being queried")
@@ -587,9 +586,20 @@ class Load(Op):
                dict(
                        type      = "ir_mode*",
                        name      = "mode",
-                       java_name = "load_mode",
                        comment   = "mode of the value to be loaded",
                ),
+               dict(
+                       type      = "ir_volatility",
+                       name      = "volatility",
+                       comment   = "volatile loads are a visible side-effect and may not be optimized",
+                       init      = "flags & cons_volatile ? volatility_is_volatile : volatility_non_volatile",
+               ),
+               dict(
+                       type      = "ir_align",
+                       name      = "unaligned",
+                       comment   = "pointers to unaligned loads don't need to respect the load-mode/type alignments",
+                       init      = "flags & cons_unaligned ? align_non_aligned : align_is_aligned",
+               ),
        ]
        attr_struct = "load_attr"
        constructor_args = [
@@ -600,10 +610,6 @@ class Load(Op):
                ),
        ]
        pinned_init = "flags & cons_floats ? op_pin_state_floats : op_pin_state_pinned"
-       init = '''
-       res->attr.load.volatility = flags & cons_volatile ? volatility_is_volatile : volatility_non_volatile;
-       res->attr.load.aligned = flags & cons_unaligned ? align_non_aligned : align_is_aligned;
-       '''
 
 class Minus(Unop):
        """returns the difference between its operands"""
@@ -803,7 +809,6 @@ class Start(Op):
                ("X_initial_exec", "control flow"),
                ("M",              "initial memory"),
                ("P_frame_base",   "frame base pointer"),
-               ("P_tls",          "pointer to thread local storage segment"),
                ("T_args",         "function arguments")
        ]
        mode             = "mode_T"
@@ -830,6 +835,20 @@ class Store(Op):
        pinned   = "exception"
        attr_struct = "store_attr"
        pinned_init = "flags & cons_floats ? op_pin_state_floats : op_pin_state_pinned"
+       attrs = [
+               dict(
+                       type      = "ir_volatility",
+                       name      = "volatility",
+                       comment   = "volatile stores are a visible side-effect and may not be optimized",
+                       init      = "flags & cons_volatile ? volatility_is_volatile : volatility_non_volatile",
+               ),
+               dict(
+                       type      = "ir_align",
+                       name      = "unaligned",
+                       comment   = "pointers to unaligned stores don't need to respect the load-mode/type alignments",
+                       init      = "flags & cons_unaligned ? align_non_aligned : align_is_aligned",
+               ),
+       ]
        constructor_args = [
                dict(
                        type    = "ir_cons_flags",
@@ -837,10 +856,6 @@ class Store(Op):
                        comment = "specifies alignment, volatility and pin state",
                ),
        ]
-       init = '''
-       res->attr.store.volatility = flags & cons_volatile ? volatility_is_volatile : volatility_non_volatile;
-       res->attr.store.aligned = flags & cons_unaligned ? align_non_aligned : align_is_aligned;
-       '''
 
 class Sub(Binop):
        """returns the difference of its operands"""