Changeset 409433da
- Timestamp:
- Mar 17, 2017, 5:34:05 PM (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:
- 89d129c
- Parents:
- 615a096
- Location:
- src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r615a096 r409433da 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 17 08:46:05201713 // Update Count : 101 712 // Last Modified On : Fri Mar 17 15:46:33 2017 13 // Update Count : 1018 14 14 // 15 15 … … 36 36 const char * DeclarationNode::signednessNames[] = { "signed", "unsigned", "NoSignednessNames" }; 37 37 const char * DeclarationNode::lengthNames[] = { "short", "long", "long long", "NoLengthNames" }; 38 const char * DeclarationNode::aggregateNames[] = { "struct", "union", " context", "NoAggregateNames" };38 const char * DeclarationNode::aggregateNames[] = { "struct", "union", "trait", "coroutine", "monitor", "thread", "NoAggregateNames" }; 39 39 const char * DeclarationNode::typeClassNames[] = { "otype", "dtype", "ftype", "NoTypeClassNames" }; 40 40 const char * DeclarationNode::builtinTypeNames[] = { "__builtin_va_list", "NoBuiltinTypeNames" }; -
src/Parser/ParseNode.h
r615a096 r409433da 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 16 08:32:43201713 // Update Count : 77 612 // Last Modified On : Fri Mar 17 15:42:18 2017 13 // Update Count : 777 14 14 // 15 15 … … 205 205 enum Signedness { Signed, Unsigned, NoSignedness }; 206 206 enum Length { Short, Long, LongLong, NoLength }; 207 enum Aggregate { Struct, Union, Trait, NoAggregate };207 enum Aggregate { Struct, Union, Trait, Coroutine, Monitor, Thread, NoAggregate }; 208 208 enum TypeClass { Otype, Dtype, Ftype, Ttype, NoTypeClass }; 209 209 enum BuiltinType { Valist, Zero, One, NoBuiltinType }; -
src/Parser/TypeData.cc
r615a096 r409433da 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 17 08:46:10201713 // Update Count : 56 012 // Last Modified On : Fri Mar 17 15:52:43 2017 13 // Update Count : 563 14 14 // 15 15 … … 619 619 switch ( td->aggregate.kind ) { 620 620 case DeclarationNode::Struct: 621 at = new StructDecl( *td->aggregate.name, attributes ); 621 case DeclarationNode::Coroutine: 622 case DeclarationNode::Monitor: 623 case DeclarationNode::Thread: 624 at = new StructDecl( *td->aggregate.name, td->aggregate.kind, attributes ); 622 625 buildForall( td->aggregate.params, at->get_parameters() ); 623 626 break; … … 656 659 switch ( type->aggregate.kind ) { 657 660 case DeclarationNode::Struct: 661 case DeclarationNode::Coroutine: 662 case DeclarationNode::Monitor: 663 case DeclarationNode::Thread: 658 664 ret = new StructInstType( buildQualifiers( type ), (StructDecl *)typedecl ); 659 665 break; … … 671 677 switch ( type->aggregate.kind ) { 672 678 case DeclarationNode::Struct: 679 case DeclarationNode::Coroutine: 680 case DeclarationNode::Monitor: 681 case DeclarationNode::Thread: 673 682 ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name ); 674 683 break; … … 703 712 switch ( type->aggregate.kind ) { 704 713 case DeclarationNode::Struct: 714 case DeclarationNode::Coroutine: 715 case DeclarationNode::Monitor: 716 case DeclarationNode::Thread: 705 717 ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name ); 706 718 break; -
src/Parser/parser.yy
r615a096 r409433da 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 16 12:57:03201713 // Update Count : 231 612 // Last Modified On : Fri Mar 17 15:42:22 2017 13 // Update Count : 2317 14 14 // 15 15 … … 1638 1638 { $$ = DeclarationNode::Union; } 1639 1639 | COROUTINE 1640 { $$ = DeclarationNode:: Struct; }1640 { $$ = DeclarationNode::Coroutine; } 1641 1641 | MONITOR 1642 { $$ = DeclarationNode:: Struct; }1642 { $$ = DeclarationNode::Monitor; } 1643 1643 | THREAD 1644 { $$ = DeclarationNode:: Struct; }1644 { $$ = DeclarationNode::Thread; } 1645 1645 ; 1646 1646 -
src/SynTree/Declaration.h
r615a096 r409433da 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 16 08:34:11201713 // Update Count : 1 1812 // Last Modified On : Fri Mar 17 16:05:08 2017 13 // Update Count : 121 14 14 // 15 15 … … 255 255 typedef AggregateDecl Parent; 256 256 public: 257 StructDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes) {}257 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes ), kind( kind ) {} 258 258 StructDecl( const StructDecl &other ) : Parent( other ) {} 259 259 260 bool is_coroutine() { return kind == DeclarationNode::Coroutine; } 261 bool is_monitor() { return kind == DeclarationNode::Monitor; } 262 bool is_thread() { return kind == DeclarationNode::Thread; } 263 260 264 virtual StructDecl *clone() const { return new StructDecl( *this ); } 261 265 virtual void accept( Visitor &v ) { v.visit( this ); } 262 266 virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); } 263 267 private: 268 DeclarationNode::Aggregate kind; 264 269 virtual std::string typeString() const; 265 270 };
Note: See TracChangeset
for help on using the changeset viewer.