Changeset b1e63ac5 for src/SynTree/Declaration.h
- Timestamp:
- Jul 4, 2017, 9:40:16 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:
- 208e5be
- Parents:
- 9c951e3 (diff), f7cb0bc (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
r9c951e3 rb1e63ac5 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Mar 17 16:05:08201713 // Update Count : 12 111 // Last Modified By : Andrew Beach 12 // Last Modified On : Tus Jun 27 15:31:00 2017 13 // Update Count : 122 14 14 // 15 15 … … 194 194 }; 195 195 196 TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind );196 TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, Type * init = nullptr ); 197 197 TypeDecl( const TypeDecl &other ); 198 virtual ~TypeDecl(); 198 199 199 200 Kind get_kind() const { return kind; } 201 202 Type * get_init() const { return init; } 203 TypeDecl * set_init( Type * newValue ) { init = newValue; return this; } 200 204 201 205 bool isComplete() const { return kind == Any || sized; } … … 209 213 virtual void accept( Visitor &v ) { v.visit( this ); } 210 214 virtual TypeDecl *acceptMutator( Mutator &m ) { return m.mutate( this ); } 215 virtual void print( std::ostream &os, int indent = 0 ) const; 216 211 217 private: 212 218 Kind kind; 219 Type * init; 213 220 bool sized; 214 221 }; … … 231 238 typedef Declaration Parent; 232 239 public: 233 AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() );240 AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ); 234 241 AggregateDecl( const AggregateDecl &other ); 235 242 virtual ~AggregateDecl(); … … 259 266 typedef AggregateDecl Parent; 260 267 public: 261 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes), kind( kind ) {}268 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {} 262 269 StructDecl( const StructDecl &other ) : Parent( other ) {} 263 270 … … 277 284 typedef AggregateDecl Parent; 278 285 public: 279 UnionDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes) {}286 UnionDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {} 280 287 UnionDecl( const UnionDecl &other ) : Parent( other ) {} 281 288 … … 290 297 typedef AggregateDecl Parent; 291 298 public: 292 EnumDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes) {}299 EnumDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {} 293 300 EnumDecl( const EnumDecl &other ) : Parent( other ) {} 294 301
Note:
See TracChangeset
for help on using the changeset viewer.