Ignore:
Timestamp:
Jun 13, 2015, 8:30:25 AM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
a1d5d2a
Parents:
7bcf74e
Message:

unify and fix storage class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r7bcf74e r68cd1ce  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jun  7 22:03:43 2015
    13 // Update Count     : 7
     12// Last Modified On : Fri Jun 12 23:55:26 2015
     13// Update Count     : 24
    1414//
    1515
     
    2121#include "Mutator.h"
    2222#include "Parser/LinkageSpec.h"
     23#include "Parser/ParseNode.h"
    2324
    2425class Declaration {
    2526  public:
    26         enum StorageClass { 
    27                 NoStorageClass,
    28                 Extern,
    29                 Static,
    30                 Auto,
    31                 Register,
    32                 Inline,
    33                 Fortran,
    34         };     
    35 
    36         Declaration( const std::string &name, StorageClass sc, LinkageSpec::Type linkage );
     27        Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage );
    3728        Declaration( const Declaration &other );
    3829        virtual ~Declaration();
     
    4031        const std::string &get_name() const { return name; }
    4132        void set_name( std::string newValue ) { name = newValue; }
    42         StorageClass get_storageClass() const { return storageClass; }
    43         void set_storageClass( StorageClass newValue ) { storageClass = newValue; }
     33        DeclarationNode::StorageClass get_storageClass() const { return storageClass; }
     34        void set_storageClass( DeclarationNode::StorageClass newValue ) { storageClass = newValue; }
    4435        LinkageSpec::Type get_linkage() const { return linkage; }
    4536        void set_linkage( LinkageSpec::Type newValue ) { linkage = newValue; }
     
    5344        virtual void printShort( std::ostream &os, int indent = 0 ) const = 0;
    5445
    55         static const char* storageClassName[]; 
    56 
    5746        static void dumpIds( std::ostream &os );
    5847        static Declaration *declFromId( UniqueId id );
    5948  private:
    6049        std::string name;
    61         StorageClass storageClass;
     50        DeclarationNode::StorageClass storageClass;
    6251        LinkageSpec::Type linkage;
    6352        UniqueId uniqueId;
     
    6655class DeclarationWithType : public Declaration {
    6756  public:
    68         DeclarationWithType( const std::string &name, StorageClass sc, LinkageSpec::Type linkage );
     57        DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage );
    6958        DeclarationWithType( const DeclarationWithType &other );
    7059        virtual ~DeclarationWithType();
     
    8675        typedef DeclarationWithType Parent;
    8776  public:
    88         ObjectDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init );
     77        ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init );
    8978        ObjectDecl( const ObjectDecl &other );
    9079        virtual ~ObjectDecl();
     
    112101        typedef DeclarationWithType Parent;
    113102  public:
    114         FunctionDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline );
     103        FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline );
    115104        FunctionDecl( const FunctionDecl &other );
    116105        virtual ~FunctionDecl();
     
    144133        typedef Declaration Parent;
    145134  public:
    146         NamedTypeDecl( const std::string &name, StorageClass sc, Type *type );
     135        NamedTypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type );
    147136        NamedTypeDecl( const TypeDecl &other );
    148137        virtual ~NamedTypeDecl();
     
    169158        enum Kind { Any, Dtype, Ftype };
    170159
    171         TypeDecl( const std::string &name, StorageClass sc, Type *type, Kind kind );
     160        TypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type, Kind kind );
    172161        TypeDecl( const TypeDecl &other );
    173162
     
    185174        typedef NamedTypeDecl Parent;
    186175  public:
    187         TypedefDecl( const std::string &name, StorageClass sc, Type *type ) : Parent( name, sc, type ) {}
     176        TypedefDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type ) : Parent( name, sc, type ) {}
    188177        TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
    189178
Note: See TracChangeset for help on using the changeset viewer.