Changeset b5b0907 for src/SynTree/Declaration.h
- Timestamp:
- Jun 15, 2015, 12:45:26 PM (9 years ago)
- 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:
- 94b4364
- Parents:
- ea9b9d3 (diff), a1d5d2a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
rea9b9d3 rb5b0907 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jun 7 22:03:43201513 // Update Count : 712 // Last Modified On : Fri Jun 12 23:55:26 2015 13 // Update Count : 24 14 14 // 15 15 … … 21 21 #include "Mutator.h" 22 22 #include "Parser/LinkageSpec.h" 23 #include "Parser/ParseNode.h" 23 24 24 25 class Declaration { 25 26 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 ); 37 28 Declaration( const Declaration &other ); 38 29 virtual ~Declaration(); … … 40 31 const std::string &get_name() const { return name; } 41 32 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; } 44 35 LinkageSpec::Type get_linkage() const { return linkage; } 45 36 void set_linkage( LinkageSpec::Type newValue ) { linkage = newValue; } … … 53 44 virtual void printShort( std::ostream &os, int indent = 0 ) const = 0; 54 45 55 static const char* storageClassName[];56 57 46 static void dumpIds( std::ostream &os ); 58 47 static Declaration *declFromId( UniqueId id ); 59 48 private: 60 49 std::string name; 61 StorageClass storageClass;50 DeclarationNode::StorageClass storageClass; 62 51 LinkageSpec::Type linkage; 63 52 UniqueId uniqueId; … … 66 55 class DeclarationWithType : public Declaration { 67 56 public: 68 DeclarationWithType( const std::string &name, StorageClass sc, LinkageSpec::Type linkage );57 DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage ); 69 58 DeclarationWithType( const DeclarationWithType &other ); 70 59 virtual ~DeclarationWithType(); … … 86 75 typedef DeclarationWithType Parent; 87 76 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 ); 89 78 ObjectDecl( const ObjectDecl &other ); 90 79 virtual ~ObjectDecl(); … … 112 101 typedef DeclarationWithType Parent; 113 102 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 ); 115 104 FunctionDecl( const FunctionDecl &other ); 116 105 virtual ~FunctionDecl(); … … 144 133 typedef Declaration Parent; 145 134 public: 146 NamedTypeDecl( const std::string &name, StorageClass sc, Type *type );135 NamedTypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type ); 147 136 NamedTypeDecl( const TypeDecl &other ); 148 137 virtual ~NamedTypeDecl(); … … 169 158 enum Kind { Any, Dtype, Ftype }; 170 159 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 ); 172 161 TypeDecl( const TypeDecl &other ); 173 162 … … 185 174 typedef NamedTypeDecl Parent; 186 175 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 ) {} 188 177 TypedefDecl( const TypedefDecl &other ) : Parent( other ) {} 189 178
Note: See TracChangeset
for help on using the changeset viewer.