Add EXPR_LITERAL_BOOLEAN to get_expression_struct_size().
[cparser] / ast2firm.c
index 1c0a779..c214587 100644 (file)
@@ -49,7 +49,6 @@
 #include "printer.h"
 #include "entitymap_t.h"
 #include "driver/firm_opt.h"
-#include "driver/firm_cmdline.h"
 
 typedef struct trampoline_region trampoline_region;
 struct trampoline_region {
@@ -57,6 +56,8 @@ struct trampoline_region {
        ir_entity        *region;      /**< created region for the trampoline */
 };
 
+fp_model_t firm_fp_model = fp_model_precise;
+
 static const backend_params *be_params;
 
 static ir_type *ir_type_char;
@@ -146,7 +147,7 @@ static const char *dbg_retrieve(const dbg_info *dbg, unsigned *line)
        if (pos == NULL)
                return NULL;
        if (line != NULL)
-               *line = pos->linenr;
+               *line = pos->lineno;
        return pos->input_name;
 }
 
@@ -171,19 +172,15 @@ static type_dbg_info *get_type_dbg_info_(const type_t *type)
 }
 
 /* is the current block a reachable one? */
-static bool currently_reachable()
+static bool currently_reachable(void)
 {
-       ir_node *block = get_cur_block();
-       if (block == NULL || is_Bad(block))
-               return false;
-       else
-               return true;
+       ir_node *const block = get_cur_block();
+       return block != NULL && !is_Bad(block);
 }
 
-static void set_unreachable_now()
+static void set_unreachable_now(void)
 {
-       ir_node *bad = new_Bad(mode_BB);
-       set_cur_block(bad);
+       set_cur_block(NULL);
 }
 
 static ir_mode *atomic_modes[ATOMIC_TYPE_LAST+1];
@@ -4874,9 +4871,8 @@ static void if_statement_to_firm(if_statement_t *statement)
  * reachable. */
 static void jump_if_reachable(ir_node *const target_block)
 {
-       if (currently_reachable()) {
-               add_immBlock_pred(target_block, new_Jmp());
-       }
+       ir_node *const pred = currently_reachable() ? new_Jmp() : new_Bad(mode_X);
+       add_immBlock_pred(target_block, pred);
 }
 
 static void while_statement_to_firm(while_statement_t *statement)
@@ -5108,7 +5104,7 @@ static void switch_statement_to_firm(switch_statement_t *statement)
                        default_proj_nr = l->last_case;
        }
 
-       if (default_proj_nr == INT_MAX) {
+       if (default_proj_nr == LONG_MAX) {
                /* Bad: an overflow will occur, we cannot be sure that the
                 * maximum + 1 is a free number. Scan the values a second
                 * time to find a free number.
@@ -5808,7 +5804,7 @@ static void create_function(entity_t *entity)
        ir_graph *old_current_function = current_function;
        current_function = irg;
 
-       set_irg_fp_model(irg, firm_opt.fp_model);
+       set_irg_fp_model(irg, firm_fp_model);
        tarval_enable_fp_ops(1);
        set_irn_dbg_info(get_irg_start_block(irg),
                         get_entity_dbg_info(function_entity));