Ignore:
Timestamp:
Aug 4, 2016, 4:10:06 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
4819cac
Parents:
73bf8cf2
Message:

add gcc attributes to ObjectDecl?, hoist destructed static variables, add breaks to end of generated switch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r73bf8cf2 rf9cebb5  
    6464class DeclarationWithType : public Declaration {
    6565  public:
    66         DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage );
     66        DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, const std::list< Attribute * > & attributes );
    6767        DeclarationWithType( const DeclarationWithType &other );
    6868        virtual ~DeclarationWithType();
     
    7575        int get_scopeLevel() const { return scopeLevel; }
    7676        void set_scopeLevel( int newValue ) { scopeLevel = newValue; }
     77
     78        std::list< Attribute * >& get_attributes() { return attributes; }
     79        const std::list< Attribute * >& get_attributes() const { return attributes; }
    7780
    7881        virtual DeclarationWithType *clone() const = 0;
     
    8790        // shadowed identifiers can be accessed
    8891        int scopeLevel = 0;
     92
     93        std::list< Attribute * > attributes;
    8994};
    9095
     
    9297        typedef DeclarationWithType Parent;
    9398  public:
    94         ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, bool isInline = false, bool isNoreturn = false );
     99        ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes = std::list< Attribute * >(), bool isInline = false, bool isNoreturn = false );
    95100        ObjectDecl( const ObjectDecl &other );
    96101        virtual ~ObjectDecl();
     
    131136        std::list< std::string >& get_oldIdents() { return oldIdents; }
    132137        std::list< Declaration* >& get_oldDecls() { return oldDecls; }
    133         std::list< Attribute * >& get_attributes() { return attributes; }
    134138
    135139        virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); }
     
    143147        std::list< std::string > oldIdents;
    144148        std::list< Declaration* > oldDecls;
    145         std::list< Attribute * > attributes;
    146149};
    147150
Note: See TracChangeset for help on using the changeset viewer.