Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    ra7c90d4 r3a5131ed  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Mar  7 07:40:42 2017
    13 // Update Count     : 113
     12// Last Modified On : Thu Feb 16 14:53:35 2017
     13// Update Count     : 57
    1414//
    1515
     
    2828class Declaration : public BaseSyntaxNode {
    2929  public:
    30         Declaration( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage );
     30        Declaration( const std::string &name, DeclarationNode::StorageClass sc, 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 
    37         DeclarationNode::StorageClasses get_storageClasses() const { return storageClasses; }
    38 
     36        DeclarationNode::StorageClass get_storageClass() const { return storageClass; }
     37        void set_storageClass( DeclarationNode::StorageClass newValue ) { storageClass = newValue; }
    3938        LinkageSpec::Spec get_linkage() const { return linkage; }
    4039        void set_linkage( LinkageSpec::Spec newValue ) { linkage = newValue; }
    41 
     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; }
    4244        UniqueId get_uniqueId() const { return uniqueId; }
    43 
    4445        bool get_extension() const { return extension; }
    4546        Declaration *set_extension( bool exten ) { extension = exten; return this; }
     
    5657  private:
    5758        std::string name;
    58         DeclarationNode::StorageClasses storageClasses;
     59        DeclarationNode::StorageClass storageClass;
    5960        LinkageSpec::Spec linkage;
     61        bool isInline, isNoreturn;
    6062        UniqueId uniqueId;
    6163        bool extension = false;
     
    6466class DeclarationWithType : public Declaration {
    6567  public:
    66         DeclarationWithType( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, DeclarationNode::FuncSpecifiers fs );
     68        DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes );
    6769        DeclarationWithType( const DeclarationWithType &other );
    6870        virtual ~DeclarationWithType();
     
    8183        std::list< Attribute * >& get_attributes() { return attributes; }
    8284        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; }
    8685
    8786        virtual DeclarationWithType *clone() const = 0;
     
    9897        ConstantExpr *asmName;
    9998        std::list< Attribute * > attributes;
    100         DeclarationNode::FuncSpecifiers fs;
    10199};
    102100
     
    104102        typedef DeclarationWithType Parent;
    105103  public:
    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() );
     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 );
    108105        ObjectDecl( const ObjectDecl &other );
    109106        virtual ~ObjectDecl();
     
    132129        typedef DeclarationWithType Parent;
    133130  public:
    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() );
     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 * >() );
    136132        FunctionDecl( const FunctionDecl &other );
    137133        virtual ~FunctionDecl();
     
    158154        typedef Declaration Parent;
    159155  public:
    160         NamedTypeDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *type );
     156        NamedTypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type );
    161157        NamedTypeDecl( const NamedTypeDecl &other );
    162158        virtual ~NamedTypeDecl();
     
    193189        };
    194190
    195         TypeDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *type, Kind kind );
     191        TypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type, Kind kind );
    196192        TypeDecl( const TypeDecl &other );
    197193
     
    214210        typedef NamedTypeDecl Parent;
    215211  public:
    216         TypedefDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *type ) : Parent( name, scs, type ) {}
     212        TypedefDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type ) : Parent( name, sc, type ) {}
    217213        TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
    218214
Note: See TracChangeset for help on using the changeset viewer.