adapt to latest libfirm
[cparser] / ast_t.h
diff --git a/ast_t.h b/ast_t.h
index 74ccf40..917f2aa 100644 (file)
--- a/ast_t.h
+++ b/ast_t.h
@@ -234,30 +234,28 @@ typedef enum funcname_kind_t {
  * The base class of every expression.
  */
 struct expression_base_t {
-       expression_kind_t   kind;            /**< The expression kind. */
-       type_t             *type;            /**< The type of the expression. */
-       source_position_t   source_position; /**< The source position of this expression. */
-       bool                parenthesized : 1;
+       expression_kind_t kind;     /**< The expression kind. */
+       type_t           *type;     /**< The type of the expression. */
+       position_t        pos;      /**< The source position of this expression. */
+       bool              parenthesized : 1;
 #ifndef NDEBUG
-       bool                transformed : 1;     /**< Set if this expression was transformed. */
+       bool              transformed : 1; /**< Set if this expression was transformed. */
 #endif
-       bool                implicit : 1;    /**< compiler generated expression.
-                                                 Examples:
-                                                    select into anonymous structs
-                                                    implicit casts
-                                             */
+       bool              implicit : 1;  /**< compiler generated expression.
+                                           Examples: select into anonymous structs,
+                                           implicit casts */
 };
 
 /**
  * integer, float and boolean constants
  */
 struct literal_expression_t {
-       expression_base_t  base;
-       string_t           value;
-       string_t           suffix;
+       expression_base_t base;
+       string_t          value;
+       char const       *suffix; /**< Start of the suffix in value. */
 
        /* ast2firm data */
-       ir_tarval         *target_value;
+       ir_tarval        *target_value;
 };
 
 /**
@@ -277,6 +275,7 @@ struct compound_literal_expression_t {
        expression_base_t  base;
        type_t            *type;
        initializer_t     *initializer;
+       bool               global_scope;
 };
 
 struct builtin_constant_expression_t {
@@ -342,10 +341,10 @@ struct typeprop_expression_t {
 };
 
 struct designator_t {
-       source_position_t  source_position;
-       symbol_t          *symbol;      /**< the symbol if any */
-       expression_t      *array_index; /**< the array index if any */
-       designator_t      *next;
+       position_t    pos;
+       symbol_t     *symbol;      /**< the symbol if any */
+       expression_t *array_index; /**< the array index if any */
+       designator_t *next;
 };
 
 struct offsetof_expression_t {
@@ -479,7 +478,6 @@ typedef enum statement_kind_t {
        STATEMENT_GOTO,
        STATEMENT_LABEL,
        STATEMENT_CASE_LABEL,
-       STATEMENT_WHILE,
        STATEMENT_DO_WHILE,
        STATEMENT_FOR,
        STATEMENT_ASM,
@@ -491,13 +489,13 @@ typedef enum statement_kind_t {
  * The base class of every statement.
  */
 struct statement_base_t {
-       statement_kind_t   kind;
-       statement_t       *next;         /**< Point to the next statement in a compound statement. */
-       source_position_t  source_position;
-       statement_t       *parent;       /**< The Parent statement that controls the execution. */
-       bool               reachable;    /**< True, if this statement is reachable. */
+       statement_kind_t kind;
+       statement_t     *next;      /**< Point to the next statement in a compound statement. */
+       position_t       pos;
+       statement_t     *parent;    /**< The Parent statement that controls the execution. */
+       bool             reachable; /**< True, if this statement is reachable. */
 #ifndef NDEBUG
-       bool               transformed;
+       bool             transformed;
 #endif
 };
 
@@ -553,8 +551,8 @@ struct case_label_statement_t {
        expression_t           *end_range;     /**< For GNUC case a .. b: the end range expression, NULL else. */
        case_label_statement_t *next;          /**< link to the next case label in switch */
        statement_t            *statement;
-       long                   first_case;     /**< The folded value of expression. */
-       long                   last_case;      /**< The folded value of end_range. */
+       ir_tarval              *first_case;
+       ir_tarval              *last_case;
        bool                   is_bad;         /**< If set marked as bad to suppress warnings. */
        bool                   is_empty_range; /**< If set marked this as an empty range. */
        long                   pn;
@@ -572,13 +570,6 @@ struct expression_statement_t {
        expression_t     *expression;
 };
 
-struct while_statement_t {
-       statement_base_t  base;
-       scope_t           scope;
-       expression_t     *condition;
-       statement_t      *body;
-};
-
 struct do_while_statement_t {
        statement_base_t  base;
        scope_t           scope;
@@ -609,12 +600,18 @@ struct asm_clobber_t {
        asm_clobber_t *next;
 };
 
+struct asm_label_t {
+       label_t     *label;
+       asm_label_t *next;
+};
+
 struct asm_statement_t {
        statement_base_t base;
        string_t         asm_text;
        asm_argument_t  *inputs;
        asm_argument_t  *outputs;
        asm_clobber_t   *clobbers;
+       asm_label_t     *labels;
        bool             is_volatile;
 };
 
@@ -642,7 +639,6 @@ union statement_t {
        case_label_statement_t    case_label;
        label_statement_t         label;
        expression_statement_t    expression;
-       while_statement_t         whiles;
        do_while_statement_t      do_while;
        for_statement_t           fors;
        asm_statement_t           asms;