Changeset 8217e8f for src/Parser
- Timestamp:
- Aug 14, 2017, 2:07:34 PM (7 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:
- 6cfe8bb
- Parents:
- 36a5a77 (diff), bd46af4 (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. - Location:
- src/Parser
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r36a5a77 r8217e8f 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:55:00 201713 // Update Count : 102 012 // Last Modified On : Thr Aug 10 17:02:00 2017 13 // Update Count : 1021 14 14 // 15 15 … … 275 275 return newnode; 276 276 } // DeclarationNode::newEnumConstant 277 278 DeclarationNode * DeclarationNode::newTreeStruct( Aggregate kind, const string * name, const string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body ) {279 assert( name );280 DeclarationNode * newnode = new DeclarationNode;281 newnode->type = new TypeData( TypeData::Aggregate );282 newnode->type->aggregate.kind = kind;283 newnode->type->aggregate.name = name;284 newnode->type->aggregate.actuals = actuals;285 newnode->type->aggregate.fields = fields;286 newnode->type->aggregate.body = body;287 newnode->type->aggregate.tagged = true;288 newnode->type->aggregate.parent = parent;289 return newnode;290 } // DeclarationNode::newTreeStruct291 277 292 278 DeclarationNode * DeclarationNode::newName( string * name ) { -
src/Parser/ParseNode.h
r36a5a77 r8217e8f 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:28:16 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Jul 27 12:08:08201713 // Update Count : 78 811 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu Aug 10 16:54:00 2017 13 // Update Count : 789 14 14 // 15 15 … … 248 248 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 249 249 250 // Perhaps this would best fold into newAggragate.251 static DeclarationNode * newTreeStruct( Aggregate kind, const std::string * name, const std::string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body );252 253 250 DeclarationNode(); 254 251 ~DeclarationNode(); … … 335 332 336 333 static UniqueName anonymous; 337 338 // Temp to test TreeStruct339 const std::string * parent_name;340 334 }; // DeclarationNode 341 335 -
src/Parser/TypeData.cc
r36a5a77 r8217e8f 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Aug 9 13:50:00 201713 // Update Count : 56 712 // Last Modified On : Mon Aug 14 10:41:00 2017 13 // Update Count : 568 14 14 // 15 15 … … 64 64 aggregate.fields = nullptr; 65 65 aggregate.body = false; 66 aggregate.tagged = false;67 aggregate.parent = nullptr;68 66 break; 69 67 case AggregateInst: … … 125 123 delete aggregate.actuals; 126 124 delete aggregate.fields; 127 delete aggregate.parent;128 125 // delete aggregate; 129 126 break; … … 640 637 switch ( td->aggregate.kind ) { 641 638 case DeclarationNode::Struct: 642 if ( td->aggregate.tagged ) {643 at = new StructDecl( *td->aggregate.name, td->aggregate.parent, attributes, linkage );644 buildForall( td->aggregate.params, at->get_parameters() );645 break;646 }647 639 case DeclarationNode::Coroutine: 648 640 case DeclarationNode::Monitor: … … 652 644 break; 653 645 case DeclarationNode::Union: 654 at = new UnionDecl( *td->aggregate.name, attributes );646 at = new UnionDecl( *td->aggregate.name, attributes, linkage ); 655 647 buildForall( td->aggregate.params, at->get_parameters() ); 656 648 break; 657 649 case DeclarationNode::Trait: 658 at = new TraitDecl( *td->aggregate.name, attributes );650 at = new TraitDecl( *td->aggregate.name, attributes, linkage ); 659 651 buildList( td->aggregate.params, at->get_parameters() ); 660 652 break; … … 673 665 case TypeData::Enum: { 674 666 if ( type->enumeration.body ) { 675 EnumDecl * typedecl = buildEnum( type, attributes );667 EnumDecl * typedecl = buildEnum( type, attributes, linkage ); 676 668 return new EnumInstType( buildQualifiers( type ), typedecl ); 677 669 } else { … … 778 770 } // buildSymbolic 779 771 780 EnumDecl * buildEnum( const TypeData * td, std::list< Attribute * > attributes ) {772 EnumDecl * buildEnum( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) { 781 773 assert( td->kind == TypeData::Enum ); 782 EnumDecl * ret = new EnumDecl( *td->enumeration.name, attributes );774 EnumDecl * ret = new EnumDecl( *td->enumeration.name, attributes, linkage ); 783 775 buildList( td->enumeration.constants, ret->get_members() ); 784 776 list< Declaration * >::iterator members = ret->get_members().begin(); … … 831 823 return buildAggregate( td, attributes, linkage ); 832 824 } else if ( td->kind == TypeData::Enum ) { 833 return buildEnum( td, attributes );825 return buildEnum( td, attributes, linkage ); 834 826 } else if ( td->kind == TypeData::Symbolic ) { 835 827 return buildSymbolic( td, name, scs, linkage ); -
src/Parser/TypeData.h
r36a5a77 r8217e8f 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 15:18:36 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Jul 22 09:32:47201713 // Update Count : 18 811 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Aug 14 10:38:00 2017 13 // Update Count : 189 14 14 // 15 15 … … 108 108 ReferenceToType * buildAggInst( const TypeData * ); 109 109 TypeDecl * buildVariable( const TypeData * ); 110 EnumDecl * buildEnum( const TypeData *, std::list< Attribute * > );110 EnumDecl * buildEnum( const TypeData *, std::list< Attribute * >, LinkageSpec::Spec ); 111 111 TypeInstType * buildSymbolicInst( const TypeData * ); 112 112 TupleType * buildTuple( const TypeData * );
Note: See TracChangeset
for help on using the changeset viewer.