added option -momit-leaf-frame-pointer
[cparser] / ast.c
diff --git a/ast.c b/ast.c
index b203ee8..77be43e 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -137,7 +137,6 @@ static unsigned get_expression_precedence(expression_kind_t kind)
                [EXPR_UNARY_CAST]                = PREC_UNARY,
                [EXPR_UNARY_CAST_IMPLICIT]       = PREC_UNARY,
                [EXPR_UNARY_ASSUME]              = PREC_PRIM,
-               [EXPR_UNARY_BITFIELD_EXTRACT]    = PREC_ACCESS,
 
                [EXPR_BINARY_ADD]                = PREC_PLUS,
                [EXPR_BINARY_SUB]                = PREC_PLUS,
@@ -455,10 +454,6 @@ static void print_unary_expression(const unary_expression_t *unexpr)
        case EXPR_UNARY_DEREFERENCE:      fputs("*", out);  break;
        case EXPR_UNARY_TAKE_ADDRESS:     fputs("&", out);  break;
 
-       case EXPR_UNARY_BITFIELD_EXTRACT:
-               print_expression_prec(unexpr->value, prec);
-               return;
-
        case EXPR_UNARY_POSTFIX_INCREMENT:
                print_expression_prec(unexpr->value, prec);
                fputs("++", out);
@@ -1116,6 +1111,17 @@ static void print_ms_try_statement(const ms_try_statement_t *statement)
        print_statement(statement->final_statement);
 }
 
+/**
+ * Print a microsoft __leave statement.
+ *
+ * @param statement   the statement
+ */
+static void print_leave_statement(const leave_statement_t *statement)
+{
+       (void) statement;
+       fputs("__leave;\n", out);
+}
+
 /**
  * Print a statement.
  *
@@ -1175,6 +1181,9 @@ void print_statement(const statement_t *statement)
        case STATEMENT_MS_TRY:
                print_ms_try_statement(&statement->ms_try);
                break;
+       case STATEMENT_LEAVE:
+               print_leave_statement(&statement->leave);
+               break;
        case STATEMENT_INVALID:
                fprintf(out, "$invalid statement$");
                break;
@@ -1259,7 +1268,7 @@ static void print_ms_modifiers(const declaration_t *declaration) {
        if((c_mode & _MS) == 0)
                return;
 
-       decl_modifiers_t modifiers = declaration->modifiers;
+       decl_modifiers_t modifiers = declaration->decl_modifiers;
 
        /* DM_FORCEINLINE handled outside. */
        if((modifiers & ~DM_FORCEINLINE) != 0 ||
@@ -1333,10 +1342,10 @@ static void print_normal_declaration(const declaration_t *declaration)
 {
        print_storage_class((storage_class_tag_t) declaration->declared_storage_class);
        if(declaration->is_inline) {
-               if(declaration->modifiers & DM_FORCEINLINE)
+               if(declaration->decl_modifiers & DM_FORCEINLINE)
                        fputs("__forceinline ", out);
                else {
-                       if(declaration->modifiers & DM_MICROSOFT_INLINE)
+                       if(declaration->decl_modifiers & DM_MICROSOFT_INLINE)
                                fputs("__inline ", out);
                        else
                                fputs("inline ", out);
@@ -1565,7 +1574,6 @@ bool is_constant_expression(const expression_t *expression)
        case EXPR_UNARY_POSTFIX_DECREMENT:
        case EXPR_UNARY_PREFIX_INCREMENT:
        case EXPR_UNARY_PREFIX_DECREMENT:
-       case EXPR_UNARY_BITFIELD_EXTRACT:
        case EXPR_UNARY_ASSUME: /* has VOID type */
        case EXPR_UNARY_TAKE_ADDRESS:
        case EXPR_UNARY_DEREFERENCE: