Changeset a7c90d4 for src/SynTree
- Timestamp:
- Mar 7, 2017, 8:33:43 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 64cb860, c3396e0
- Parents:
- 7fe2498
- Location:
- src/SynTree
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/SynTree/AggregateDecl.cc ¶
r7fe2498 ra7c90d4 10 10 // Created On : Sun May 17 23:56:39 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Feb 6 15:31:23201713 // Update Count : 1 712 // Last Modified On : Tue Mar 7 07:31:47 2017 13 // Update Count : 19 14 14 // 15 15 … … 20 20 21 21 22 AggregateDecl::AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes ) : Parent( name, DeclarationNode:: NoStorageClass, LinkageSpec::Cforall ), body( false ), attributes( attributes ) {22 AggregateDecl::AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes ) : Parent( name, DeclarationNode::StorageClasses(), LinkageSpec::Cforall ), body( false ), attributes( attributes ) { 23 23 } 24 24 -
TabularUnified src/SynTree/Declaration.cc ¶
r7fe2498 ra7c90d4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 1 20:11:57201713 // Update Count : 1712 // Last Modified On : Tue Mar 7 07:31:11 2017 13 // Update Count : 23 14 14 // 15 15 … … 27 27 static IdMapType idMap; 28 28 29 Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage )30 : name( name ), storageClass ( sc), linkage( linkage ), uniqueId( 0 ) {29 Declaration::Declaration( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage ) 30 : name( name ), storageClasses( scs ), linkage( linkage ), uniqueId( 0 ) { 31 31 } 32 32 33 33 Declaration::Declaration( const Declaration &other ) 34 : name( other.name ), storageClass ( other.storageClass ), linkage( other.linkage ), uniqueId( other.uniqueId ) {34 : name( other.name ), storageClasses( other.storageClasses ), linkage( other.linkage ), uniqueId( other.uniqueId ) { 35 35 } 36 36 … … 66 66 67 67 68 AsmDecl::AsmDecl( AsmStmt *stmt ) : Declaration( "", DeclarationNode:: NoStorageClass, LinkageSpec::C ), stmt( stmt ) {68 AsmDecl::AsmDecl( AsmStmt *stmt ) : Declaration( "", DeclarationNode::StorageClasses(), LinkageSpec::C ), stmt( stmt ) { 69 69 } 70 70 -
TabularUnified src/SynTree/Declaration.h ¶
r7fe2498 ra7c90d4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 3 20:59:27201713 // Update Count : 9612 // Last Modified On : Tue Mar 7 07:40:42 2017 13 // Update Count : 113 14 14 // 15 15 … … 28 28 class Declaration : public BaseSyntaxNode { 29 29 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 ); 31 31 Declaration( const Declaration &other ); 32 32 virtual ~Declaration(); … … 34 34 const std::string &get_name() const { return name; } 35 35 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 38 39 LinkageSpec::Spec get_linkage() const { return linkage; } 39 40 void set_linkage( LinkageSpec::Spec newValue ) { linkage = newValue; } 41 40 42 UniqueId get_uniqueId() const { return uniqueId; } 43 41 44 bool get_extension() const { return extension; } 42 45 Declaration *set_extension( bool exten ) { extension = exten; return this; } … … 53 56 private: 54 57 std::string name; 55 DeclarationNode::StorageClass storageClass;58 DeclarationNode::StorageClasses storageClasses; 56 59 LinkageSpec::Spec linkage; 57 60 UniqueId uniqueId; … … 61 64 class DeclarationWithType : public Declaration { 62 65 public: 63 DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, DeclarationNode::FuncSpec fs = DeclarationNode::FuncSpec());66 DeclarationWithType( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, DeclarationNode::FuncSpecifiers fs ); 64 67 DeclarationWithType( const DeclarationWithType &other ); 65 68 virtual ~DeclarationWithType(); … … 79 82 const std::list< Attribute * >& get_attributes() const { return attributes; } 80 83 81 DeclarationNode::FuncSpec get_funcSpec() const { return fs; }82 void set_functionSpecifiers( DeclarationNode::FuncSpecnewValue ) { fs = newValue; }84 DeclarationNode::FuncSpecifiers get_funcSpec() const { return fs; } 85 //void set_functionSpecifiers( DeclarationNode::FuncSpecifiers newValue ) { fs = newValue; } 83 86 84 87 virtual DeclarationWithType *clone() const = 0; … … 95 98 ConstantExpr *asmName; 96 99 std::list< Attribute * > attributes; 97 DeclarationNode::FuncSpec fs;100 DeclarationNode::FuncSpecifiers fs; 98 101 }; 99 102 … … 101 104 typedef DeclarationWithType Parent; 102 105 public: 103 ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init,104 const std::list< Attribute * > attributes = std::list< Attribute * >(), DeclarationNode::FuncSpec fs = DeclarationNode::FuncSpec() );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() ); 105 108 ObjectDecl( const ObjectDecl &other ); 106 109 virtual ~ObjectDecl(); … … 129 132 typedef DeclarationWithType Parent; 130 133 public: 131 FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements,132 const std::list< Attribute * > attributes = std::list< Attribute * >(), DeclarationNode::FuncSpec fs = DeclarationNode::FuncSpec() );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() ); 133 136 FunctionDecl( const FunctionDecl &other ); 134 137 virtual ~FunctionDecl(); … … 155 158 typedef Declaration Parent; 156 159 public: 157 NamedTypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type );160 NamedTypeDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *type ); 158 161 NamedTypeDecl( const NamedTypeDecl &other ); 159 162 virtual ~NamedTypeDecl(); … … 190 193 }; 191 194 192 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 ); 193 196 TypeDecl( const TypeDecl &other ); 194 197 … … 211 214 typedef NamedTypeDecl Parent; 212 215 public: 213 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 ) {} 214 217 TypedefDecl( const TypedefDecl &other ) : Parent( other ) {} 215 218 -
TabularUnified src/SynTree/DeclarationWithType.cc ¶
r7fe2498 ra7c90d4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 3 20:59:28201713 // Update Count : 1912 // Last Modified On : Tue Mar 7 07:32:14 2017 13 // Update Count : 23 14 14 // 15 15 … … 19 19 #include "Common/utility.h" 20 20 21 DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, DeclarationNode::FuncSpecfs )22 : Declaration( name, sc , linkage ), asmName( nullptr ), attributes( attributes ), fs( fs ) {21 DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, DeclarationNode::FuncSpecifiers fs ) 22 : Declaration( name, scs, linkage ), asmName( nullptr ), attributes( attributes ), fs( fs ) { 23 23 } 24 24 25 25 DeclarationWithType::DeclarationWithType( const DeclarationWithType &other ) 26 : Declaration( other ), mangleName( other.mangleName ), scopeLevel( other.scopeLevel ), fs( other.fs ) {26 : Declaration( other ), mangleName( other.mangleName ), scopeLevel( other.scopeLevel ), fs( other.fs ) { 27 27 cloneAll( other.attributes, attributes ); 28 28 asmName = maybeClone( other.asmName ); -
TabularUnified src/SynTree/FunctionDecl.cc ¶
r7fe2498 ra7c90d4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 3 21:29:41201713 // Update Count : 5512 // Last Modified On : Tue Mar 7 07:54:58 2017 13 // Update Count : 68 14 14 // 15 15 … … 26 26 extern bool translation_unit_nomain; 27 27 28 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, std::list< Attribute * > attributes, DeclarationNode::FuncSpec fs ) 29 : Parent( name, sc, linkage, attributes, fs ), type( type ), statements( statements ) { 30 set_functionSpecifiers( fs ); 31 28 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, std::list< Attribute * > attributes, DeclarationNode::FuncSpecifiers fs ) 29 : Parent( name, scs, linkage, attributes, fs ), type( type ), statements( statements ) { 32 30 // hack forcing the function "main" to have Cforall linkage to replace main even if it is inside an extern 33 31 if ( name == "main" ) { … … 37 35 38 36 FunctionDecl::FunctionDecl( const FunctionDecl &other ) 39 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) {37 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) { 40 38 } 41 39 … … 67 65 printAll( get_attributes(), os, indent ); 68 66 69 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 70 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 71 } // if 67 DeclarationNode::print_StorageClass( os, get_storageClasses() ); 72 68 DeclarationNode::print_FuncSpec( os, get_funcSpec() ); 73 69 … … 95 91 // xxx - should printShort print attributes? 96 92 97 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 98 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 99 } // if 93 DeclarationNode::print_StorageClass( os, get_storageClasses() ); 100 94 DeclarationNode::print_FuncSpec( os, get_funcSpec() ); 101 95 -
TabularUnified src/SynTree/NamedTypeDecl.cc ¶
r7fe2498 ra7c90d4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 28 16:13:24201713 // Update Count : 412 // Last Modified On : Tue Mar 7 07:39:41 2017 13 // Update Count : 10 14 14 // 15 15 … … 18 18 #include "Common/utility.h" 19 19 20 NamedTypeDecl::NamedTypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *base )21 : Parent( name, sc , LinkageSpec::Cforall ), base( base ) {}20 NamedTypeDecl::NamedTypeDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *base ) 21 : Parent( name, scs, LinkageSpec::Cforall ), base( base ) {} 22 22 23 23 NamedTypeDecl::NamedTypeDecl( const NamedTypeDecl &other ) … … 39 39 os << get_name() << ": "; 40 40 } // if 41 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 42 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 43 } // if 41 DeclarationNode::print_StorageClass( os, get_storageClasses() ); 44 42 os << typeString(); 45 43 if ( base ) { … … 63 61 os << get_name() << ": "; 64 62 } // if 65 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 66 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 67 } // if 63 DeclarationNode::print_StorageClass( os, get_storageClasses() ); 68 64 os << typeString(); 69 65 if ( base ) { -
TabularUnified src/SynTree/ObjectDecl.cc ¶
r7fe2498 ra7c90d4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 3 20:59:27201713 // Update Count : 4512 // Last Modified On : Tue Mar 7 07:55:24 2017 13 // Update Count : 54 14 14 // 15 15 … … 22 22 #include "Statement.h" 23 23 24 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, DeclarationNode::FuncSpec fs ) 25 : Parent( name, sc, linkage, attributes, fs ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) { 26 set_functionSpecifiers( fs ); 24 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, DeclarationNode::FuncSpecifiers fs ) 25 : Parent( name, scs, linkage, attributes, fs ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) { 27 26 } 28 27 … … 48 47 printAll( get_attributes(), os, indent ); 49 48 50 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 51 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 52 } // if 49 DeclarationNode::print_StorageClass( os, get_storageClasses() ); 53 50 54 51 if ( get_type() ) { … … 84 81 // xxx - should printShort print attributes? 85 82 86 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 87 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 88 } // if 83 DeclarationNode::print_StorageClass( os, get_storageClasses() ); 89 84 90 85 if ( get_type() ) { -
TabularUnified src/SynTree/TypeDecl.cc ¶
r7fe2498 ra7c90d4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 13 08:14:35 201513 // Update Count : 212 // Last Modified On : Tue Mar 7 07:39:09 2017 13 // Update Count : 4 14 14 // 15 15 … … 18 18 #include "Common/utility.h" 19 19 20 TypeDecl::TypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type, Kind kind ) : Parent( name, sc, type ), kind( kind ), sized( kind == Any || kind == Ttype ) {20 TypeDecl::TypeDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *type, Kind kind ) : Parent( name, scs, type ), kind( kind ), sized( kind == Any || kind == Ttype ) { 21 21 } 22 22
Note: See TracChangeset
for help on using the changeset viewer.