Ignore:
Timestamp:
Feb 6, 2017, 4:19:41 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
b4d65c7
Parents:
a362f97
Message:

third attempt at gcc attributes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypeData.cc

    ra362f97 rc0aa336  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jan 13 15:47:37 2017
    13 // Update Count     : 423
     12// Last Modified On : Fri Jan 27 15:28:56 2017
     13// Update Count     : 428
    1414//
    1515
     
    617617} // buildPointer
    618618
    619 AggregateDecl * buildAggregate( const TypeData * td ) {
     619AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes ) {
    620620        assert( td->kind == TypeData::Aggregate );
    621621        AggregateDecl * at;
    622622        switch ( td->aggregate.kind ) {
    623623          case DeclarationNode::Struct:
    624                 at = new StructDecl( *td->aggregate.name );
     624                at = new StructDecl( *td->aggregate.name, attributes );
    625625                buildForall( td->aggregate.params, at->get_parameters() );
    626626                break;
    627627          case DeclarationNode::Union:
    628                 at = new UnionDecl( *td->aggregate.name );
     628                at = new UnionDecl( *td->aggregate.name, attributes );
    629629                buildForall( td->aggregate.params, at->get_parameters() );
    630630                break;
    631631          case DeclarationNode::Trait:
    632                 at = new TraitDecl( *td->aggregate.name );
     632                at = new TraitDecl( *td->aggregate.name, attributes );
    633633                buildList( td->aggregate.params, at->get_parameters() );
    634634                break;
     
    685685} // buildSymbolic
    686686
    687 EnumDecl * buildEnum( const TypeData * td ) {
     687EnumDecl * buildEnum( const TypeData * td, std::list< Attribute * > attributes ) {
    688688        assert( td->kind == TypeData::Enum );
    689         EnumDecl * ret = new EnumDecl( *td->enumeration.name );
     689        EnumDecl * ret = new EnumDecl( *td->enumeration.name, attributes );
    690690        buildList( td->enumeration.constants, ret->get_members() );
    691691        list< Declaration * >::iterator members = ret->get_members().begin();
     
    746746                return decl->set_asmName( asmName );
    747747        } else if ( td->kind == TypeData::Aggregate ) {
    748                 return buildAggregate( td );
     748                return buildAggregate( td, attributes );
    749749        } else if ( td->kind == TypeData::Enum ) {
    750                 return buildEnum( td );
     750                return buildEnum( td, attributes );
    751751        } else if ( td->kind == TypeData::Symbolic ) {
    752752                return buildSymbolic( td, name, sc );
    753753        } else {
    754                 return (new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, list< Attribute * >(), isInline, isNoreturn ))->set_asmName( asmName );
     754                return (new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, attributes, isInline, isNoreturn ))->set_asmName( asmName );
    755755        } // if
    756756        return nullptr;
Note: See TracChangeset for help on using the changeset viewer.