Changeset e07caa2


Ignore:
Timestamp:
Jul 19, 2018, 6:16:41 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
68bceeb
Parents:
679a260
Message:

fix extend plan 9, anonymous declarations

Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r679a260 re07caa2  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jul 18 22:50:27 2018
    13 // Update Count     : 1096
     12// Last Modified On : Thu Jul 19 17:40:03 2018
     13// Update Count     : 1106
    1414//
    1515
     
    5454
    5555DeclarationNode::DeclarationNode() :
    56                 builtin( NoBuiltinType ),
    57                 type( nullptr ),
    58                 inLine( false ),
    59                 bitfieldWidth( nullptr ),
    60                 hasEllipsis( false ),
    61                 linkage( ::linkage ),
    62                 asmName( nullptr ),
    63                 initializer( nullptr ),
    64                 extension( false ),
    65                 asmStmt( nullptr ) {
     56        linkage( ::linkage ) {
    6657
    6758//      variable.name = nullptr;
     
    1004995                                //   struct T;            // anonymous member
    1005996                                // };
    1006                                 if ( ! (extracted && decl->name == "" && ! anon) ) {
    1007                                         if (decl->name == "") {
     997                                if ( ! (extracted && decl->name == "" && ! anon && ! cur->get_inLine()) ) {
     998                                        if ( decl->name == "" ) {
    1008999                                                if ( DeclarationWithType * dwt = dynamic_cast<DeclarationWithType *>( decl ) ) {
    10091000                                                        if ( ReferenceToType * aggr = dynamic_cast<ReferenceToType *>( dwt->get_type() ) ) {
    10101001                                                                if ( aggr->name.find("anonymous") == std::string::npos ) {
    1011                                                                         if ( ! cur->inLine ) {
    1012                                                                                 // temporary: warn about anonymous member declarations of named types, since this conflicts with the syntax for the forward declaration of an anonymous type
     1002                                                                        if ( ! cur->get_inLine() ) {
     1003                                                                                // temporary: warn about anonymous member declarations of named types, since
     1004                                                                                // this conflicts with the syntax for the forward declaration of an anonymous type
    10131005                                                                                SemanticWarning( cur->location, Warning::AggrForwardDecl, aggr->name.c_str() );
    1014                                                                         }
    1015                                                                 }
    1016                                                         }
    1017                                                 }
    1018                                         }
     1006                                                                        } // if
     1007                                                                } // if
     1008                                                        } // if
     1009                                                } // if
     1010                                        } // if
    10191011                                        decl->location = cur->location;
    1020                                         * out++ = decl;
    1021                                 }
     1012                                        *out++ = decl;
     1013                                } // if
    10221014                        } // if
    10231015                } catch( SemanticErrorException &e ) {
    10241016                        errors.append( e );
    10251017                } // try
    1026         } // while
     1018        } // for
    10271019
    10281020        if ( ! errors.isEmpty() ) {
  • src/Parser/ParseNode.h

    r679a260 re07caa2  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jul 18 17:35:55 2018
    13 // Update Count     : 844
     12// Last Modified On : Thu Jul 19 15:55:26 2018
     13// Update Count     : 848
    1414//
    1515
     
    303303        bool get_extension() const { return extension; }
    304304        DeclarationNode * set_extension( bool exten ) { extension = exten; return this; }
     305
     306        bool get_inLine() const { return inLine; }
     307        DeclarationNode * set_inLine( bool inL ) { inLine = inL; return this; }
    305308  public:
    306309        DeclarationNode * get_last() { return (DeclarationNode *)ParseNode::get_last(); }
     
    327330        StaticAssert_t assert;
    328331
    329         BuiltinType builtin;
    330 
    331         TypeData * type;
    332 
    333         bool inLine;
     332        BuiltinType builtin = NoBuiltinType;
     333
     334        TypeData * type = nullptr;
     335
     336        bool inLine = false;
    334337        Type::FuncSpecifiers funcSpecs;
    335338        Type::StorageClasses storageClasses;
    336339
    337         ExpressionNode * bitfieldWidth;
     340        ExpressionNode * bitfieldWidth = nullptr;
    338341        std::unique_ptr<ExpressionNode> enumeratorValue;
    339         bool hasEllipsis;
     342        bool hasEllipsis = false;
    340343        LinkageSpec::Spec linkage;
    341         Expression * asmName;
     344        Expression * asmName = nullptr;
    342345        std::list< Attribute * > attributes;
    343         InitializerNode * initializer;
     346        InitializerNode * initializer = nullptr;
    344347        bool extension = false;
    345348        std::string error;
    346         StatementNode * asmStmt;
     349        StatementNode * asmStmt = nullptr;
    347350
    348351        static UniqueName anonymous;
  • src/Parser/parser.yy

    r679a260 re07caa2  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 19 10:21:43 2018
    13 // Update Count     : 3808
     12// Last Modified On : Thu Jul 19 16:42:16 2018
     13// Update Count     : 3820
    1414//
    1515
     
    114114        } // for
    115115} // distExt
     116
     117void distInl( DeclarationNode * declaration ) {
     118        // distribute EXTENSION across all declarations
     119        for ( DeclarationNode *iter = declaration; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) {
     120                iter->set_inLine( true );
     121        } // for
     122} // distInl
    116123
    117124void distQual( DeclarationNode * declaration, DeclarationNode * qualifiers ) {
     
    338345%type<decl> exception_declaration
    339346
    340 %type<decl> field_declaration_list_opt field_declaration field_declaring_list_opt field_declarator field_abstract_list field_abstract_opt
     347%type<decl> field_declaration_list_opt field_declaration field_declaring_list_opt field_declarator field_abstract_list_opt field_abstract
    341348%type<en> field field_name_list field_name fraction_constants_opt
    342349
     
    19381945                        if ( $2 ) {                                                                     // field declarator ?
    19391946                                $$ = distAttr( $1, $2 );
    1940                         } else if ( $1->type && $1->type->kind == TypeData::Aggregate && $1->type->aggregate.anon ) {
     1947                        } else if ( $1->type && $1->type->kind == TypeData::Aggregate ) {
    19411948                                $$ = DeclarationNode::newName( nullptr );
    19421949                                $$ = distAttr( $1, $$ );                                // mark all fields in list
     
    19601967                        } // if
    19611968                }
    1962         | INLINE type_specifier field_abstract_list ';'         // CFA
     1969        | INLINE type_specifier field_abstract_list_opt ';'     // CFA
    19631970                {
    19641971                        $3->inLine = true;
    19651972                        $$ = distAttr( $2, $3 );                                        // mark all fields in list
     1973                        distInl( $3 );
    19661974                }
    19671975        | typedef_declaration ';'                                                       // CFA
     
    19841992
    19851993field_declarator:
    1986         bit_subrange_size                                                                       // no field name
     1994        bit_subrange_size                                                                       // C special case, no field name
    19871995                { $$ = DeclarationNode::newBitfield( $1 ); }
    19881996        | variable_declarator bit_subrange_size_opt
     
    19942002        ;
    19952003
    1996 field_abstract_list:
    1997         field_abstract_opt
    1998         | field_abstract_list ',' attribute_list_opt field_abstract_opt
    1999                 { $$ = $1->appendList( $4->addQualifiers( $3 ) ); }
    2000         ;
    2001 
    2002 field_abstract_opt:
     2004field_abstract_list_opt:
    20032005        // empty
    20042006                { $$ = DeclarationNode::newName( nullptr ); }
    2005         | bit_subrange_size                                                                     // no field name
    2006                 // A semantic check is required to ensure bit_subrange only appears on integral types.
    2007                 { $$ = DeclarationNode::newBitfield( $1 ); }
    2008         | variable_abstract_declarator
     2007        | field_abstract
     2008        | field_abstract_list_opt ',' attribute_list_opt field_abstract
     2009                { $$ = $1->appendList( $4->addQualifiers( $3 ) ); }
     2010        ;
     2011
     2012field_abstract:
     2013        //      no bit fields
     2014        variable_abstract_declarator
    20092015        ;
    20102016
  • src/tests/.expect/attributes.x64.txt

    r679a260 re07caa2  
    8888    __attribute__ ((used,unused,unused)) signed int __f7__i_1;
    8989    __attribute__ ((used,used,unused)) signed int __f8__i_1;
    90     __attribute__ ((unused)) signed int __anonymous_object0;
    9190    __attribute__ ((unused,unused)) signed int *__f9__Pi_1;
    9291};
     
    103102static inline void ___constructor__F_4sFdliiiiiii_autogen___1(struct Fdl *___dst__4sFdl_1, __attribute__ ((unused)) signed int __f1__i_1, __attribute__ ((unused)) signed int __f2__i_1, __attribute__ ((unused,unused)) signed int __f3__i_1, __attribute__ ((unused)) signed int __f4__i_1, __attribute__ ((unused,unused)) signed int __f5__i_1, signed int __f6__i_1, __attribute__ ((unused,unused)) signed int __f7__i_1);
    104103static inline void ___constructor__F_4sFdliiiiiiii_autogen___1(struct Fdl *___dst__4sFdl_1, __attribute__ ((unused)) signed int __f1__i_1, __attribute__ ((unused)) signed int __f2__i_1, __attribute__ ((unused,unused)) signed int __f3__i_1, __attribute__ ((unused)) signed int __f4__i_1, __attribute__ ((unused,unused)) signed int __f5__i_1, signed int __f6__i_1, __attribute__ ((unused,unused)) signed int __f7__i_1, __attribute__ ((unused)) signed int __f8__i_1);
    105 static inline void ___constructor__F_4sFdliiiiiiiii_autogen___1(struct Fdl *___dst__4sFdl_1, __attribute__ ((unused)) signed int __f1__i_1, __attribute__ ((unused)) signed int __f2__i_1, __attribute__ ((unused,unused)) signed int __f3__i_1, __attribute__ ((unused)) signed int __f4__i_1, __attribute__ ((unused,unused)) signed int __f5__i_1, signed int __f6__i_1, __attribute__ ((unused,unused)) signed int __f7__i_1, __attribute__ ((unused)) signed int __f8__i_1, __attribute__ ((unused)) signed int __anonymous_object1);
    106 static inline void ___constructor__F_4sFdliiiiiiiiiPi_autogen___1(struct Fdl *___dst__4sFdl_1, __attribute__ ((unused)) signed int __f1__i_1, __attribute__ ((unused)) signed int __f2__i_1, __attribute__ ((unused,unused)) signed int __f3__i_1, __attribute__ ((unused)) signed int __f4__i_1, __attribute__ ((unused,unused)) signed int __f5__i_1, signed int __f6__i_1, __attribute__ ((unused,unused)) signed int __f7__i_1, __attribute__ ((unused)) signed int __f8__i_1, __attribute__ ((unused)) signed int __anonymous_object2, __attribute__ ((unused,unused)) signed int *__f9__Pi_1);
     104static inline void ___constructor__F_4sFdliiiiiiiiPi_autogen___1(struct Fdl *___dst__4sFdl_1, __attribute__ ((unused)) signed int __f1__i_1, __attribute__ ((unused)) signed int __f2__i_1, __attribute__ ((unused,unused)) signed int __f3__i_1, __attribute__ ((unused)) signed int __f4__i_1, __attribute__ ((unused,unused)) signed int __f5__i_1, signed int __f6__i_1, __attribute__ ((unused,unused)) signed int __f7__i_1, __attribute__ ((unused)) signed int __f8__i_1, __attribute__ ((unused,unused)) signed int *__f9__Pi_1);
    107105static inline void ___constructor__F_4sFdl_autogen___1(struct Fdl *___dst__4sFdl_1){
    108106    ((void)((*___dst__4sFdl_1).__f1__i_1) /* ?{} */);
     
    114112    ((void)((*___dst__4sFdl_1).__f7__i_1) /* ?{} */);
    115113    ((void)((*___dst__4sFdl_1).__f8__i_1) /* ?{} */);
    116     ((void)((*___dst__4sFdl_1).__anonymous_object0) /* ?{} */);
    117114    ((void)((*___dst__4sFdl_1).__f9__Pi_1) /* ?{} */);
    118115}
     
    126123    ((void)((*___dst__4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1) /* ?{} */);
    127124    ((void)((*___dst__4sFdl_1).__f8__i_1=___src__4sFdl_1.__f8__i_1) /* ?{} */);
    128     ((void)((*___dst__4sFdl_1).__anonymous_object0=___src__4sFdl_1.__anonymous_object0) /* ?{} */);
    129125    ((void)((*___dst__4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1) /* ?{} */);
    130126}
    131127static inline void ___destructor__F_4sFdl_autogen___1(struct Fdl *___dst__4sFdl_1){
    132128    ((void)((*___dst__4sFdl_1).__f9__Pi_1) /* ^?{} */);
    133     ((void)((*___dst__4sFdl_1).__anonymous_object0) /* ^?{} */);
    134129    ((void)((*___dst__4sFdl_1).__f8__i_1) /* ^?{} */);
    135130    ((void)((*___dst__4sFdl_1).__f7__i_1) /* ^?{} */);
     
    151146    ((void)((*___dst__4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1));
    152147    ((void)((*___dst__4sFdl_1).__f8__i_1=___src__4sFdl_1.__f8__i_1));
    153     ((void)((*___dst__4sFdl_1).__anonymous_object0=___src__4sFdl_1.__anonymous_object0));
    154148    ((void)((*___dst__4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1));
    155149    ((void)___constructor__F_4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), (*___dst__4sFdl_1)));
     
    165159    ((void)((*___dst__4sFdl_1).__f7__i_1) /* ?{} */);
    166160    ((void)((*___dst__4sFdl_1).__f8__i_1) /* ?{} */);
    167     ((void)((*___dst__4sFdl_1).__anonymous_object0) /* ?{} */);
    168161    ((void)((*___dst__4sFdl_1).__f9__Pi_1) /* ?{} */);
    169162}
     
    177170    ((void)((*___dst__4sFdl_1).__f7__i_1) /* ?{} */);
    178171    ((void)((*___dst__4sFdl_1).__f8__i_1) /* ?{} */);
    179     ((void)((*___dst__4sFdl_1).__anonymous_object0) /* ?{} */);
    180172    ((void)((*___dst__4sFdl_1).__f9__Pi_1) /* ?{} */);
    181173}
     
    189181    ((void)((*___dst__4sFdl_1).__f7__i_1) /* ?{} */);
    190182    ((void)((*___dst__4sFdl_1).__f8__i_1) /* ?{} */);
    191     ((void)((*___dst__4sFdl_1).__anonymous_object0) /* ?{} */);
    192183    ((void)((*___dst__4sFdl_1).__f9__Pi_1) /* ?{} */);
    193184}
     
    201192    ((void)((*___dst__4sFdl_1).__f7__i_1) /* ?{} */);
    202193    ((void)((*___dst__4sFdl_1).__f8__i_1) /* ?{} */);
    203     ((void)((*___dst__4sFdl_1).__anonymous_object0) /* ?{} */);
    204194    ((void)((*___dst__4sFdl_1).__f9__Pi_1) /* ?{} */);
    205195}
     
    213203    ((void)((*___dst__4sFdl_1).__f7__i_1) /* ?{} */);
    214204    ((void)((*___dst__4sFdl_1).__f8__i_1) /* ?{} */);
    215     ((void)((*___dst__4sFdl_1).__anonymous_object0) /* ?{} */);
    216205    ((void)((*___dst__4sFdl_1).__f9__Pi_1) /* ?{} */);
    217206}
     
    225214    ((void)((*___dst__4sFdl_1).__f7__i_1) /* ?{} */);
    226215    ((void)((*___dst__4sFdl_1).__f8__i_1) /* ?{} */);
    227     ((void)((*___dst__4sFdl_1).__anonymous_object0) /* ?{} */);
    228216    ((void)((*___dst__4sFdl_1).__f9__Pi_1) /* ?{} */);
    229217}
     
    237225    ((void)((*___dst__4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
    238226    ((void)((*___dst__4sFdl_1).__f8__i_1) /* ?{} */);
    239     ((void)((*___dst__4sFdl_1).__anonymous_object0) /* ?{} */);
    240227    ((void)((*___dst__4sFdl_1).__f9__Pi_1) /* ?{} */);
    241228}
     
    249236    ((void)((*___dst__4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
    250237    ((void)((*___dst__4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);
    251     ((void)((*___dst__4sFdl_1).__anonymous_object0) /* ?{} */);
    252     ((void)((*___dst__4sFdl_1).__f9__Pi_1) /* ?{} */);
    253 }
    254 static inline void ___constructor__F_4sFdliiiiiiiii_autogen___1(struct Fdl *___dst__4sFdl_1, __attribute__ ((unused)) signed int __f1__i_1, __attribute__ ((unused)) signed int __f2__i_1, __attribute__ ((unused,unused)) signed int __f3__i_1, __attribute__ ((unused)) signed int __f4__i_1, __attribute__ ((unused,unused)) signed int __f5__i_1, signed int __f6__i_1, __attribute__ ((unused,unused)) signed int __f7__i_1, __attribute__ ((unused)) signed int __f8__i_1, __attribute__ ((unused)) signed int __anonymous_object3){
     238    ((void)((*___dst__4sFdl_1).__f9__Pi_1) /* ?{} */);
     239}
     240static inline void ___constructor__F_4sFdliiiiiiiiPi_autogen___1(struct Fdl *___dst__4sFdl_1, __attribute__ ((unused)) signed int __f1__i_1, __attribute__ ((unused)) signed int __f2__i_1, __attribute__ ((unused,unused)) signed int __f3__i_1, __attribute__ ((unused)) signed int __f4__i_1, __attribute__ ((unused,unused)) signed int __f5__i_1, signed int __f6__i_1, __attribute__ ((unused,unused)) signed int __f7__i_1, __attribute__ ((unused)) signed int __f8__i_1, __attribute__ ((unused,unused)) signed int *__f9__Pi_1){
    255241    ((void)((*___dst__4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
    256242    ((void)((*___dst__4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
     
    261247    ((void)((*___dst__4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
    262248    ((void)((*___dst__4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);
    263     ((void)((*___dst__4sFdl_1).__anonymous_object0=__anonymous_object3) /* ?{} */);
    264     ((void)((*___dst__4sFdl_1).__f9__Pi_1) /* ?{} */);
    265 }
    266 static inline void ___constructor__F_4sFdliiiiiiiiiPi_autogen___1(struct Fdl *___dst__4sFdl_1, __attribute__ ((unused)) signed int __f1__i_1, __attribute__ ((unused)) signed int __f2__i_1, __attribute__ ((unused,unused)) signed int __f3__i_1, __attribute__ ((unused)) signed int __f4__i_1, __attribute__ ((unused,unused)) signed int __f5__i_1, signed int __f6__i_1, __attribute__ ((unused,unused)) signed int __f7__i_1, __attribute__ ((unused)) signed int __f8__i_1, __attribute__ ((unused)) signed int __anonymous_object4, __attribute__ ((unused,unused)) signed int *__f9__Pi_1){
    267     ((void)((*___dst__4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
    268     ((void)((*___dst__4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
    269     ((void)((*___dst__4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
    270     ((void)((*___dst__4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
    271     ((void)((*___dst__4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);
    272     ((void)((*___dst__4sFdl_1).__f6__i_1=__f6__i_1) /* ?{} */);
    273     ((void)((*___dst__4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
    274     ((void)((*___dst__4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);
    275     ((void)((*___dst__4sFdl_1).__anonymous_object0=__anonymous_object4) /* ?{} */);
    276249    ((void)((*___dst__4sFdl_1).__f9__Pi_1=__f9__Pi_1) /* ?{} */);
    277250}
     
    293266    __attribute__ ((unused)) signed int **const ___retval_f2__CPPi_1;
    294267}
    295 __attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object5))[];
     268__attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object0))[];
    296269__attribute__ ((unused,unused)) signed int (*__f3__FPA0i_i__1(signed int __p__i_1))[]{
    297270    __attribute__ ((unused)) signed int (*___retval_f3__PA0i_1)[];
    298271}
    299 __attribute__ ((unused,used,unused)) signed int (*__f4__FFi_i____1())(signed int __anonymous_object6);
    300 __attribute__ ((unused,unused)) signed int (*__f4__FFi_i____1())(signed int __anonymous_object7){
    301     __attribute__ ((unused)) signed int (*___retval_f4__Fi_i__1)(signed int __anonymous_object8);
     272__attribute__ ((unused,used,unused)) signed int (*__f4__FFi_i____1())(signed int __anonymous_object1);
     273__attribute__ ((unused,unused)) signed int (*__f4__FFi_i____1())(signed int __anonymous_object2){
     274    __attribute__ ((unused)) signed int (*___retval_f4__Fi_i__1)(signed int __anonymous_object3);
    302275}
    303276signed int __vtr__Fi___1(){
     
    329302signed int __tpr2__Fi_PPi__1(__attribute__ ((unused,unused,unused,unused,unused,unused)) signed int **__Foo__PPi_1);
    330303signed int __tpr3__Fi_Pi__1(__attribute__ ((unused,unused,unused)) signed int *__Foo__Pi_1);
    331 signed int __tpr4__Fi_Fi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object9)(__attribute__ ((unused,unused)) signed int __anonymous_object10[((unsigned long int )5)]));
     304signed int __tpr4__Fi_Fi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object4)(__attribute__ ((unused,unused)) signed int __anonymous_object5[((unsigned long int )5)]));
    332305signed int __tpr5__Fi_Fi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__Fi___1)());
    333306signed int __tpr6__Fi_Fi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__Fi___1)());
    334 signed int __tpr7__Fi_Fi_Fi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object11)(__attribute__ ((unused)) signed int (*__anonymous_object12)(__attribute__ ((unused,unused)) signed int __anonymous_object13)));
     307signed int __tpr7__Fi_Fi_Fi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object6)(__attribute__ ((unused)) signed int (*__anonymous_object7)(__attribute__ ((unused,unused)) signed int __anonymous_object8)));
    335308signed int __ad__Fi___1(){
    336309    __attribute__ ((unused)) signed int ___retval_ad__i_1;
     
    386359    ((void)sizeof(enum __anonymous4 ));
    387360}
    388 signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object14, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object15);
    389 signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object16, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object17);
    390 signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object18, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object19);
    391 signed int __apd4__Fi_Fi__Fi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object20)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object21)());
    392 signed int __apd5__Fi_Fi_i_Fi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object22)(__attribute__ ((unused)) signed int __anonymous_object23), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object24)(__attribute__ ((unused)) signed int __anonymous_object25));
    393 signed int __apd6__Fi_Fi__Fi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object26)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object27)());
    394 signed int __apd7__Fi_Fi_i_Fi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object28)(__attribute__ ((unused)) signed int __anonymous_object29), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object30)(__attribute__ ((unused)) signed int __anonymous_object31));
     361signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object9, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object10);
     362signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object11, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object12);
     363signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object13, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object14);
     364signed int __apd4__Fi_Fi__Fi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object15)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object16)());
     365signed int __apd5__Fi_Fi_i_Fi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object17)(__attribute__ ((unused)) signed int __anonymous_object18), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object19)(__attribute__ ((unused)) signed int __anonymous_object20));
     366signed int __apd6__Fi_Fi__Fi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object21)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object22)());
     367signed int __apd7__Fi_Fi_i_Fi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object23)(__attribute__ ((unused)) signed int __anonymous_object24), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object25)(__attribute__ ((unused)) signed int __anonymous_object26));
    395368struct Vad {
    396     __attribute__ ((unused)) signed int __anonymous_object32;
    397     __attribute__ ((unused,unused)) signed int *__anonymous_object33;
    398     __attribute__ ((unused,unused)) signed int __anonymous_object34[((unsigned long int )10)];
    399     __attribute__ ((unused,unused)) signed int (*__anonymous_object35)();
     369    __attribute__ ((unused)) signed int __anonymous_object27;
     370    __attribute__ ((unused)) signed int __anonymous_object28:4;
     371    __attribute__ ((unused)) signed int __anonymous_object29:4;
     372    __attribute__ ((unused,unused)) signed int __anonymous_object30:6;
    400373};
    401374static inline void ___constructor__F_4sVad_autogen___1(struct Vad *___dst__4sVad_1);
     
    403376static inline void ___destructor__F_4sVad_autogen___1(struct Vad *___dst__4sVad_1);
    404377static inline struct Vad ___operator_assign__F4sVad_4sVad4sVad_autogen___1(struct Vad *___dst__4sVad_1, struct Vad ___src__4sVad_1);
    405 static inline void ___constructor__F_4sVadi_autogen___1(struct Vad *___dst__4sVad_1, __attribute__ ((unused)) signed int __anonymous_object36);
    406 static inline void ___constructor__F_4sVadiPi_autogen___1(struct Vad *___dst__4sVad_1, __attribute__ ((unused)) signed int __anonymous_object37, __attribute__ ((unused,unused)) signed int *__anonymous_object38);
    407 static inline void ___constructor__F_4sVadiPiA0i_autogen___1(struct Vad *___dst__4sVad_1, __attribute__ ((unused)) signed int __anonymous_object39, __attribute__ ((unused,unused)) signed int *__anonymous_object40, __attribute__ ((unused,unused)) signed int __anonymous_object41[((unsigned long int )10)]);
    408 static inline void ___constructor__F_4sVadiPiA0iFi___autogen___1(struct Vad *___dst__4sVad_1, __attribute__ ((unused)) signed int __anonymous_object42, __attribute__ ((unused,unused)) signed int *__anonymous_object43, __attribute__ ((unused,unused)) signed int __anonymous_object44[((unsigned long int )10)], __attribute__ ((unused,unused)) signed int (*__anonymous_object45)());
     378static inline void ___constructor__F_4sVadi_autogen___1(struct Vad *___dst__4sVad_1, __attribute__ ((unused)) signed int __anonymous_object31);
    409379static inline void ___constructor__F_4sVad_autogen___1(struct Vad *___dst__4sVad_1){
    410     ((void)((*___dst__4sVad_1).__anonymous_object32) /* ?{} */);
    411     ((void)((*___dst__4sVad_1).__anonymous_object33) /* ?{} */);
    412     {
    413         signed int _index0 = 0;
    414         for (;(_index0<10);((void)(++_index0))) {
    415             ((void)((*___dst__4sVad_1).__anonymous_object34[((signed long int )_index0)]) /* ?{} */);
    416         }
    417 
    418     }
    419 
    420     ((void)((*___dst__4sVad_1).__anonymous_object35) /* ?{} */);
     380    ((void)((*___dst__4sVad_1).__anonymous_object27) /* ?{} */);
    421381}
    422382static inline void ___constructor__F_4sVad4sVad_autogen___1(struct Vad *___dst__4sVad_1, struct Vad ___src__4sVad_1){
    423     ((void)((*___dst__4sVad_1).__anonymous_object32=___src__4sVad_1.__anonymous_object32) /* ?{} */);
    424     ((void)((*___dst__4sVad_1).__anonymous_object33=___src__4sVad_1.__anonymous_object33) /* ?{} */);
    425     {
    426         signed int _index1 = 0;
    427         for (;(_index1<10);((void)(++_index1))) {
    428             ((void)((*___dst__4sVad_1).__anonymous_object34[((signed long int )_index1)]=___src__4sVad_1.__anonymous_object34[((signed long int )_index1)]) /* ?{} */);
    429         }
    430 
    431     }
    432 
    433     ((void)((*___dst__4sVad_1).__anonymous_object35=___src__4sVad_1.__anonymous_object35) /* ?{} */);
     383    ((void)((*___dst__4sVad_1).__anonymous_object27=___src__4sVad_1.__anonymous_object27) /* ?{} */);
    434384}
    435385static inline void ___destructor__F_4sVad_autogen___1(struct Vad *___dst__4sVad_1){
    436     ((void)((*___dst__4sVad_1).__anonymous_object35) /* ^?{} */);
    437     {
    438         signed int _index2 = (10-1);
    439         for (;(_index2>=0);((void)(--_index2))) {
    440             ((void)((*___dst__4sVad_1).__anonymous_object34[((signed long int )_index2)]) /* ^?{} */);
    441         }
    442 
    443     }
    444 
    445     ((void)((*___dst__4sVad_1).__anonymous_object33) /* ^?{} */);
    446     ((void)((*___dst__4sVad_1).__anonymous_object32) /* ^?{} */);
     386    ((void)((*___dst__4sVad_1).__anonymous_object27) /* ^?{} */);
    447387}
    448388static inline struct Vad ___operator_assign__F4sVad_4sVad4sVad_autogen___1(struct Vad *___dst__4sVad_1, struct Vad ___src__4sVad_1){
    449389    struct Vad ___ret__4sVad_1;
    450     ((void)((*___dst__4sVad_1).__anonymous_object32=___src__4sVad_1.__anonymous_object32));
    451     ((void)((*___dst__4sVad_1).__anonymous_object33=___src__4sVad_1.__anonymous_object33));
    452     {
    453         signed int _index3 = 0;
    454         for (;(_index3<10);((void)(++_index3))) {
    455             ((void)((*___dst__4sVad_1).__anonymous_object34[((signed long int )_index3)]=___src__4sVad_1.__anonymous_object34[((signed long int )_index3)]));
    456         }
    457 
    458     }
    459 
    460     ((void)((*___dst__4sVad_1).__anonymous_object35=___src__4sVad_1.__anonymous_object35));
     390    ((void)((*___dst__4sVad_1).__anonymous_object27=___src__4sVad_1.__anonymous_object27));
    461391    ((void)___constructor__F_4sVad4sVad_autogen___1((&___ret__4sVad_1), (*___dst__4sVad_1)));
    462392    return ___ret__4sVad_1;
    463393}
    464 static inline void ___constructor__F_4sVadi_autogen___1(struct Vad *___dst__4sVad_1, __attribute__ ((unused)) signed int __anonymous_object46){
    465     ((void)((*___dst__4sVad_1).__anonymous_object32=__anonymous_object46) /* ?{} */);
    466     ((void)((*___dst__4sVad_1).__anonymous_object33) /* ?{} */);
    467     {
    468         signed int _index4 = 0;
    469         for (;(_index4<10);((void)(++_index4))) {
    470             ((void)((*___dst__4sVad_1).__anonymous_object34[((signed long int )_index4)]) /* ?{} */);
    471         }
    472 
    473     }
    474 
    475     ((void)((*___dst__4sVad_1).__anonymous_object35) /* ?{} */);
    476 }
    477 static inline void ___constructor__F_4sVadiPi_autogen___1(struct Vad *___dst__4sVad_1, __attribute__ ((unused)) signed int __anonymous_object47, __attribute__ ((unused,unused)) signed int *__anonymous_object48){
    478     ((void)((*___dst__4sVad_1).__anonymous_object32=__anonymous_object47) /* ?{} */);
    479     ((void)((*___dst__4sVad_1).__anonymous_object33=__anonymous_object48) /* ?{} */);
    480     {
    481         signed int _index5 = 0;
    482         for (;(_index5<10);((void)(++_index5))) {
    483             ((void)((*___dst__4sVad_1).__anonymous_object34[((signed long int )_index5)]) /* ?{} */);
    484         }
    485 
    486     }
    487 
    488     ((void)((*___dst__4sVad_1).__anonymous_object35) /* ?{} */);
    489 }
    490 static inline void ___constructor__F_4sVadiPiA0i_autogen___1(struct Vad *___dst__4sVad_1, __attribute__ ((unused)) signed int __anonymous_object49, __attribute__ ((unused,unused)) signed int *__anonymous_object50, __attribute__ ((unused,unused)) signed int __anonymous_object51[((unsigned long int )10)]){
    491     ((void)((*___dst__4sVad_1).__anonymous_object32=__anonymous_object49) /* ?{} */);
    492     ((void)((*___dst__4sVad_1).__anonymous_object33=__anonymous_object50) /* ?{} */);
    493     {
    494         signed int _index6 = 0;
    495         for (;(_index6<10);((void)(++_index6))) {
    496             ((void)((*___dst__4sVad_1).__anonymous_object34[((signed long int )_index6)]=__anonymous_object51[((signed long int )_index6)]) /* ?{} */);
    497         }
    498 
    499     }
    500 
    501     ((void)((*___dst__4sVad_1).__anonymous_object35) /* ?{} */);
    502 }
    503 static inline void ___constructor__F_4sVadiPiA0iFi___autogen___1(struct Vad *___dst__4sVad_1, __attribute__ ((unused)) signed int __anonymous_object52, __attribute__ ((unused,unused)) signed int *__anonymous_object53, __attribute__ ((unused,unused)) signed int __anonymous_object54[((unsigned long int )10)], __attribute__ ((unused,unused)) signed int (*__anonymous_object55)()){
    504     ((void)((*___dst__4sVad_1).__anonymous_object32=__anonymous_object52) /* ?{} */);
    505     ((void)((*___dst__4sVad_1).__anonymous_object33=__anonymous_object53) /* ?{} */);
    506     {
    507         signed int _index7 = 0;
    508         for (;(_index7<10);((void)(++_index7))) {
    509             ((void)((*___dst__4sVad_1).__anonymous_object34[((signed long int )_index7)]=__anonymous_object54[((signed long int )_index7)]) /* ?{} */);
    510         }
    511 
    512     }
    513 
    514     ((void)((*___dst__4sVad_1).__anonymous_object35=__anonymous_object55) /* ?{} */);
    515 }
     394static inline void ___constructor__F_4sVadi_autogen___1(struct Vad *___dst__4sVad_1, __attribute__ ((unused)) signed int __anonymous_object32){
     395    ((void)((*___dst__4sVad_1).__anonymous_object27=__anonymous_object32) /* ?{} */);
     396}
  • src/tests/attributes.c

    r679a260 re07caa2  
    1010// Created On       : Mon Feb  6 16:07:02 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jul  8 21:12:07 2018
    13 // Update Count     : 8
     12// Last Modified On : Thu Jul 19 13:50:51 2018
     13// Update Count     : 15
    1414//
    1515
     
    4242    __attribute__(( unused )) int f5 __attribute__(( unused ));
    4343    __attribute__(( used )) int f6 __attribute__(( packed )), f7 __attribute__(( unused )) __attribute__(( unused )), __attribute__(( used )) f8 __attribute__(( unused ));
    44     int __attribute__(( unused ));
    4544    int ( ( * (f9) __attribute__(( unused )) ) __attribute__(( unused )) );
    4645};
     
    149148struct Vad {
    150149    int __attribute__(( unused ));
    151     int __attribute__(( unused )) * __attribute__(( unused ));
    152     int __attribute__(( unused )) [10] __attribute__(( unused ));
    153     int __attribute__(( unused )) (*)() __attribute__(( unused ));
     150    int __attribute__(( unused )) :4;
     151    int __attribute__(( unused )) :4, __attribute__(( unused )) :6;
    154152};
    155153
Note: See TracChangeset for help on using the changeset viewer.