Ignore:
Timestamp:
Feb 6, 2017, 4:19:41 PM (7 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/SynTree/Declaration.h

    ra362f97 rc0aa336  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 13 13:37:33 2016
    13 // Update Count     : 49
     12// Last Modified On : Fri Jan 20 15:07:29 2017
     13// Update Count     : 53
    1414//
    1515
     
    225225        typedef Declaration Parent;
    226226  public:
    227         AggregateDecl( const std::string &name );
     227        AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() );
    228228        AggregateDecl( const AggregateDecl &other );
    229229        virtual ~AggregateDecl();
     
    231231        std::list<Declaration*>& get_members() { return members; }
    232232        std::list<TypeDecl*>& get_parameters() { return parameters; }
     233
     234        std::list< Attribute * >& get_attributes() { return attributes; }
     235        const std::list< Attribute * >& get_attributes() const { return attributes; }
    233236
    234237        bool has_body() const { return body; }
     
    244247        std::list<TypeDecl*> parameters;
    245248        bool body;
     249        std::list< Attribute * > attributes;
    246250};
    247251
     
    249253        typedef AggregateDecl Parent;
    250254  public:
    251         StructDecl( const std::string &name ) : Parent( name ) {}
     255        StructDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes ) {}
    252256        StructDecl( const StructDecl &other ) : Parent( other ) {}
    253257
     
    262266        typedef AggregateDecl Parent;
    263267  public:
    264         UnionDecl( const std::string &name ) : Parent( name ) {}
     268        UnionDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes ) {}
    265269        UnionDecl( const UnionDecl &other ) : Parent( other ) {}
    266270
     
    275279        typedef AggregateDecl Parent;
    276280  public:
    277         EnumDecl( const std::string &name ) : Parent( name ) {}
     281        EnumDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes ) {}
    278282        EnumDecl( const EnumDecl &other ) : Parent( other ) {}
    279283
     
    288292        typedef AggregateDecl Parent;
    289293  public:
    290         TraitDecl( const std::string &name ) : Parent( name ) {}
     294        TraitDecl( const std::string &name, const std::list< Attribute * > & attributes ) : Parent( name ) {
     295                assertf( attributes.empty(), "attribute unsupported for traits" );
     296        }
    291297        TraitDecl( const TraitDecl &other ) : Parent( other ) {}
    292298
Note: See TracChangeset for help on using the changeset viewer.