another instance of wrong block in new_Proj
[libfirm] / ir / ir / irprog.c
index a313ae9..8941410 100644 (file)
@@ -78,6 +78,8 @@ static ir_prog *new_incomplete_ir_prog(void)
 static ir_prog *complete_ir_prog(ir_prog *irp, const char *module_name) {
        int i;
 
+#define IDENT(x)  new_id_from_chars(x, sizeof(x) - 1)
+
        irp->name = new_id_from_str(module_name);
        irp->segment_types[IR_SEGMENT_GLOBAL] = new_type_class(IDENT("GlobalType"));
        irp->segment_types[IR_SEGMENT_THREAD_LOCAL]
@@ -111,6 +113,7 @@ static ir_prog *complete_ir_prog(ir_prog *irp, const char *module_name) {
        irp->globals_entity_usage_state = ir_entity_usage_not_computed;
 
        return irp;
+#undef IDENT
 }
 
 /* initializes ir_prog. Constructs only the basic lists. */
@@ -125,8 +128,8 @@ void init_irprog_2(void) {
 
 /* Create a new ir prog. Automatically called by init_firm through
    init_irprog. */
-ir_prog *new_ir_prog(void) {
-       return complete_ir_prog(new_incomplete_ir_prog());
+ir_prog *new_ir_prog(const char *name) {
+       return complete_ir_prog(new_incomplete_ir_prog(), name);
 }
 
 /* frees all memory used by irp.  Types in type list, irgs in irg
@@ -319,7 +322,7 @@ void add_irp_opcode(ir_op *opcode) {
        assert(irp);
        len  = ARR_LEN(irp->opcodes);
        code = opcode->code;
-       if (code >= len) {
+       if ((int) code >= len) {
                ARR_RESIZE(ir_op*, irp->opcodes, code+1);
                memset(&irp->opcodes[len], 0, (code-len+1) * sizeof(irp->opcodes[0]));
        }