Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r3a5131ed ra7c90d4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 16 14:53:35 2017
    13 // Update Count     : 57
     12// Last Modified On : Tue Mar  7 07:40:42 2017
     13// Update Count     : 113
    1414//
    1515
     
    2828class Declaration : public BaseSyntaxNode {
    2929  public:
    30         Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage );
     30        Declaration( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage );
    3131        Declaration( const Declaration &other );
    3232        virtual ~Declaration();
     
    3434        const std::string &get_name() const { return name; }
    3535        void set_name( std::string newValue ) { name = newValue; }
    36         DeclarationNode::StorageClass get_storageClass() const { return storageClass; }
    37         void set_storageClass( DeclarationNode::StorageClass newValue ) { storageClass = newValue; }
     36
     37        DeclarationNode::StorageClasses get_storageClasses() const { return storageClasses; }
     38
    3839        LinkageSpec::Spec get_linkage() const { return linkage; }
    3940        void set_linkage( LinkageSpec::Spec newValue ) { linkage = newValue; }
    40         bool get_isInline() const { return isInline; }
    41         void set_isInline( bool newValue ) { isInline = newValue; }
    42         bool get_isNoreturn() const { return isNoreturn; }
    43         void set_isNoreturn( bool newValue ) { isNoreturn = newValue; }
     41
    4442        UniqueId get_uniqueId() const { return uniqueId; }
     43
    4544        bool get_extension() const { return extension; }
    4645        Declaration *set_extension( bool exten ) { extension = exten; return this; }
     
    5756  private:
    5857        std::string name;
    59         DeclarationNode::StorageClass storageClass;
     58        DeclarationNode::StorageClasses storageClasses;
    6059        LinkageSpec::Spec linkage;
    61         bool isInline, isNoreturn;
    6260        UniqueId uniqueId;
    6361        bool extension = false;
     
    6664class DeclarationWithType : public Declaration {
    6765  public:
    68         DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes );
     66        DeclarationWithType( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, DeclarationNode::FuncSpecifiers fs );
    6967        DeclarationWithType( const DeclarationWithType &other );
    7068        virtual ~DeclarationWithType();
     
    8381        std::list< Attribute * >& get_attributes() { return attributes; }
    8482        const std::list< Attribute * >& get_attributes() const { return attributes; }
     83
     84        DeclarationNode::FuncSpecifiers get_funcSpec() const { return fs; }
     85        //void set_functionSpecifiers( DeclarationNode::FuncSpecifiers newValue ) { fs = newValue; }
    8586
    8687        virtual DeclarationWithType *clone() const = 0;
     
    9798        ConstantExpr *asmName;
    9899        std::list< Attribute * > attributes;
     100        DeclarationNode::FuncSpecifiers fs;
    99101};
    100102
     
    102104        typedef DeclarationWithType Parent;
    103105  public:
    104         ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes = std::list< Attribute * >(), bool isInline = false, bool isNoreturn = false );
     106        ObjectDecl( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init,
     107                                const std::list< Attribute * > attributes = std::list< Attribute * >(), DeclarationNode::FuncSpecifiers fs = DeclarationNode::FuncSpecifiers() );
    105108        ObjectDecl( const ObjectDecl &other );
    106109        virtual ~ObjectDecl();
     
    129132        typedef DeclarationWithType Parent;
    130133  public:
    131         FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, const std::list< Attribute * > attributes = std::list< Attribute * >() );
     134        FunctionDecl( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements,
     135                                  const std::list< Attribute * > attributes = std::list< Attribute * >(), DeclarationNode::FuncSpecifiers fs = DeclarationNode::FuncSpecifiers() );
    132136        FunctionDecl( const FunctionDecl &other );
    133137        virtual ~FunctionDecl();
     
    154158        typedef Declaration Parent;
    155159  public:
    156         NamedTypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type );
     160        NamedTypeDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *type );
    157161        NamedTypeDecl( const NamedTypeDecl &other );
    158162        virtual ~NamedTypeDecl();
     
    189193        };
    190194
    191         TypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type, Kind kind );
     195        TypeDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *type, Kind kind );
    192196        TypeDecl( const TypeDecl &other );
    193197
     
    210214        typedef NamedTypeDecl Parent;
    211215  public:
    212         TypedefDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type ) : Parent( name, sc, type ) {}
     216        TypedefDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *type ) : Parent( name, scs, type ) {}
    213217        TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
    214218
Note: See TracChangeset for help on using the changeset viewer.