X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ast_t.h;h=bdf375573847e29375e365662635f1ee4a10140a;hb=3c84e06d01aaed7971067d7cc1924f6e20bcd0ba;hp=c9e2b4f160a86741d312c9c422735282bda80a36;hpb=f109471af0f1a95e840a66c9e136409d0973021c;p=cparser diff --git a/ast_t.h b/ast_t.h index c9e2b4f..bdf3755 100644 --- a/ast_t.h +++ b/ast_t.h @@ -1,6 +1,6 @@ /* * This file is part of cparser. - * Copyright (C) 2007-2008 Matthias Braun + * Copyright (C) 2007-2009 Matthias Braun * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -86,6 +86,7 @@ typedef enum expression_kind_t { EXPR_OFFSETOF, EXPR_VA_START, EXPR_VA_ARG, + EXPR_VA_COPY, EXPR_STATEMENT, EXPR_LABEL_ADDRESS, /**< GCC extension &&label operator */ @@ -232,9 +233,9 @@ 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; + bool parenthesized : 1; #ifndef NDEBUG - bool transformed; /**< Set if this expression was transformed. */ + bool transformed : 1; /**< Set if this expression was transformed. */ #endif }; @@ -322,6 +323,8 @@ struct select_expression_t { expression_base_t base; expression_t *compound; entity_t *compound_entry; + bool implicit : 1; /**< compiler generated select + (for anonymous struct/union) */ }; struct array_access_expression_t { @@ -361,6 +364,12 @@ struct va_arg_expression_t { expression_t *ap; }; +struct va_copy_expression_t { + expression_base_t base; + expression_t *dst; /**< destination argument */ + expression_t *src; /**< source argument */ +}; + struct conditional_expression_t { expression_base_t base; expression_t *condition; @@ -403,6 +412,7 @@ union expression_t { offsetof_expression_t offsetofe; va_start_expression_t va_starte; va_arg_expression_t va_arge; + va_copy_expression_t va_copye; conditional_expression_t conditional; statement_expression_t statement; classify_type_expression_t classify_type; @@ -457,79 +467,6 @@ union initializer_t { initializer_designator_t designator; }; -/** - * GNU attributes. - */ -typedef enum gnu_attribute_kind_t { - GNU_AK_CONST, - GNU_AK_VOLATILE, - GNU_AK_CDECL, - GNU_AK_STDCALL, - GNU_AK_FASTCALL, - GNU_AK_DEPRECATED, - GNU_AK_NOINLINE, - GNU_AK_RETURNS_TWICE, - GNU_AK_NORETURN, - GNU_AK_NAKED, - GNU_AK_PURE, - GNU_AK_ALWAYS_INLINE, - GNU_AK_MALLOC, - GNU_AK_WEAK, - GNU_AK_CONSTRUCTOR, - GNU_AK_DESTRUCTOR, - GNU_AK_NOTHROW, - GNU_AK_TRANSPARENT_UNION, - GNU_AK_COMMON, - GNU_AK_NOCOMMON, - GNU_AK_PACKED, - GNU_AK_SHARED, - GNU_AK_NOTSHARED, - GNU_AK_USED, - GNU_AK_UNUSED, - GNU_AK_NO_INSTRUMENT_FUNCTION, - GNU_AK_WARN_UNUSED_RESULT, - GNU_AK_LONGCALL, - GNU_AK_SHORTCALL, - GNU_AK_LONG_CALL, - GNU_AK_SHORT_CALL, - GNU_AK_FUNCTION_VECTOR, - GNU_AK_INTERRUPT, - GNU_AK_INTERRUPT_HANDLER, - GNU_AK_NMI_HANDLER, - GNU_AK_NESTING, - GNU_AK_NEAR, - GNU_AK_FAR, - GNU_AK_SIGNAL, - GNU_AK_EIGTHBIT_DATA, - GNU_AK_TINY_DATA, - GNU_AK_SAVEALL, - GNU_AK_FLATTEN, - GNU_AK_SSEREGPARM, - GNU_AK_EXTERNALLY_VISIBLE, - GNU_AK_RETURN_TWICE, - GNU_AK_MAY_ALIAS, - GNU_AK_MS_STRUCT, - GNU_AK_GCC_STRUCT, - GNU_AK_DLLIMPORT, - GNU_AK_DLLEXPORT, - GNU_AK_ALIGNED, - GNU_AK_ALIAS, - GNU_AK_SECTION, - GNU_AK_FORMAT, - GNU_AK_FORMAT_ARG, - GNU_AK_WEAKREF, - GNU_AK_NONNULL, - GNU_AK_TLS_MODEL, - GNU_AK_VISIBILITY, - GNU_AK_REGPARM, - GNU_AK_MODEL, - GNU_AK_MODE, - GNU_AK_TRAP_EXIT, - GNU_AK_SP_SWITCH, - GNU_AK_SENTINEL, - GNU_AK_LAST -} gnu_attribute_kind_t; - /** * The statement kinds. */ @@ -740,7 +677,6 @@ bool is_invalid_statement(statement_t *statement) return statement->base.kind == STATEMENT_INVALID; } - #define allocate_ast(size) _allocate_ast(size) #endif