make code C++ warning clean (again)
[libfirm] / scripts / ir_spec.py
index 489cd40..3f374d9 100755 (executable)
@@ -31,8 +31,10 @@ class Add(Binop):
 
 class Alloc(Op):
        """allocates a block of memory.
-       It can be specified whether the variable should be allocated to the stack
-       or to the heap."""
+       It can be specified whether the memory should be allocated to the stack
+       or to the heap.
+       Allocates memory for one or more objects (depending on value on count input).
+       """
        ins   = [
                ("mem",   "memory dependency" ),
                ("count", "number of objects to allocate" ),
@@ -47,7 +49,7 @@ class Alloc(Op):
                dict(
                        name    = "type",
                        type    = "ir_type*",
-                       comment = "type of the allocated variable",
+                       comment = "type of the objects to allocate",
                ),
                dict(
                        name    = "where",
@@ -92,6 +94,9 @@ class ASM(Op):
        attr_struct      = "asm_attr"
        attrs_name       = "assem"
        customSerializer = True
+       ins   = [
+               ("mem",    "memory dependency"),
+       ]
        attrs = [
                dict(
                        name    = "input_constraints",
@@ -173,7 +178,7 @@ class Block(Op):
        block            = "NULL"
        pinned           = "yes"
        arity            = "variable"
-       flags            = [ "labeled" ]
+       flags            = []
        attr_struct      = "block_attr"
        attrs            = [
                dict(
@@ -422,7 +427,7 @@ class Conv(Unop):
        attr_struct = "conv_attr"
 
 class CopyB(Op):
-       """Copies a block of memory"""
+       """Copies a block of memory with statically known size/type."""
        ins   = [
                ("mem",  "memory dependency"),
                ("dst",  "destination address"),
@@ -500,7 +505,9 @@ class End(Op):
        singleton        = True
 
 class Eor(Binop):
-       """returns the result of a bitwise exclusive or operation of its operands"""
+       """returns the result of a bitwise exclusive or operation of its operands.
+
+       This is also known as the Xor operation."""
        flags    = [ "commutative" ]
 
 class Free(Op):
@@ -528,7 +535,10 @@ class Free(Op):
        attr_struct = "free_attr"
 
 class Id(Op):
-       """Returns its operand unchanged."""
+       """Returns its operand unchanged.
+
+       This is mainly used when exchanging nodes. Usually you shouldn't see Id
+       nodes since the getters/setters for node inputs skip them automatically."""
        ins    = [
           ("pred", "the value which is returned unchanged")
        ]
@@ -602,14 +612,14 @@ class Load(Op):
                        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",
-                       to_flags  = "%s == volatility_is_volatile ? cons_volatile : 0"
+                       to_flags  = "%s == volatility_is_volatile ? cons_volatile : cons_none"
                ),
                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",
-                       to_flags  = "%s == align_non_aligned ? cons_unaligned : 0"
+                       to_flags  = "%s == align_non_aligned ? cons_unaligned : cons_none"
                ),
        ]
        attr_struct = "load_attr"
@@ -685,16 +695,14 @@ class Mux(Op):
 class NoMem(Op):
        """Placeholder node for cases where you don't need any memory input"""
        mode          = "mode_M"
-       flags         = [ "dump_noblock", "dump_noinput" ]
+       flags         = [ "dump_noblock" ]
        pinned        = "yes"
        knownBlock    = True
        block         = "get_irg_start_block(irg)"
        singleton     = True
 
 class Not(Unop):
-       """returns the logical complement of a value. Works for integer values too.
-       If the input is false/zero then true/one is returned, otherwise false/zero
-       is returned."""
+       """returns the bitwise complement of a value. Works for boolean values, too."""
        flags = []
 
 class Or(Binop):
@@ -805,18 +813,27 @@ class Sel(Op):
 
 class Shl(Binop):
        """Returns its first operands bits shifted left by the amount of the 2nd
-       operand"""
+       operand.
+       The right input (shift amount) must be an unsigned integer value.
+       If the result mode has modulo_shift!=0, then the effective shift amount is
+       the right input modulo this modulo_shift amount."""
        flags = []
 
 class Shr(Binop):
        """Returns its first operands bits shifted right by the amount of the 2nd
-       operand. No special handling for the sign bit (zero extension)"""
+       operand. No special handling for the sign bit is performed (zero extension).
+       The right input (shift amount) must be an unsigned integer value.
+       If the result mode has modulo_shift!=0, then the effective shift amount is
+       the right input modulo this modulo_shift amount."""
        flags = []
 
 class Shrs(Binop):
        """Returns its first operands bits shifted right by the amount of the 2nd
        operand. The leftmost bit (usually the sign bit) stays the same
-       (sign extension)"""
+       (sign extension).
+       The right input (shift amount) must be an unsigned integer value.
+       If the result mode has modulo_shift!=0, then the effective shift amount is
+       the right input modulo this modulo_shift amount."""
        flags = []
 
 class Start(Op):
@@ -857,14 +874,14 @@ class Store(Op):
                        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",
-                       to_flags  = "%s == volatility_is_volatile ? cons_volatile : 0"
+                       to_flags  = "%s == volatility_is_volatile ? cons_volatile : cons_none"
                ),
                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",
-                       to_flags  = "%s == align_non_aligned ? cons_unaligned : 0"
+                       to_flags  = "%s == align_non_aligned ? cons_unaligned : cons_none"
                ),
        ]
        constructor_args = [
@@ -936,7 +953,7 @@ class Tuple(Op):
        arity  = "variable"
        mode   = "mode_T"
        pinned = "no"
-       flags  = [ "labeled" ]
+       flags  = []
 
 class Unknown(Op):
        """Returns an unknown (at compile- and runtime) value. It is a valid