Changeset c0aa336 for src/Parser/TypeData.cc
- Timestamp:
- Feb 6, 2017, 4:19:41 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:
- b4d65c7
- Parents:
- a362f97
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TypeData.cc
ra362f97 rc0aa336 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jan 13 15:47:37201713 // Update Count : 42 312 // Last Modified On : Fri Jan 27 15:28:56 2017 13 // Update Count : 428 14 14 // 15 15 … … 617 617 } // buildPointer 618 618 619 AggregateDecl * buildAggregate( const TypeData * td ) {619 AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes ) { 620 620 assert( td->kind == TypeData::Aggregate ); 621 621 AggregateDecl * at; 622 622 switch ( td->aggregate.kind ) { 623 623 case DeclarationNode::Struct: 624 at = new StructDecl( *td->aggregate.name );624 at = new StructDecl( *td->aggregate.name, attributes ); 625 625 buildForall( td->aggregate.params, at->get_parameters() ); 626 626 break; 627 627 case DeclarationNode::Union: 628 at = new UnionDecl( *td->aggregate.name );628 at = new UnionDecl( *td->aggregate.name, attributes ); 629 629 buildForall( td->aggregate.params, at->get_parameters() ); 630 630 break; 631 631 case DeclarationNode::Trait: 632 at = new TraitDecl( *td->aggregate.name );632 at = new TraitDecl( *td->aggregate.name, attributes ); 633 633 buildList( td->aggregate.params, at->get_parameters() ); 634 634 break; … … 685 685 } // buildSymbolic 686 686 687 EnumDecl * buildEnum( const TypeData * td ) {687 EnumDecl * buildEnum( const TypeData * td, std::list< Attribute * > attributes ) { 688 688 assert( td->kind == TypeData::Enum ); 689 EnumDecl * ret = new EnumDecl( *td->enumeration.name );689 EnumDecl * ret = new EnumDecl( *td->enumeration.name, attributes ); 690 690 buildList( td->enumeration.constants, ret->get_members() ); 691 691 list< Declaration * >::iterator members = ret->get_members().begin(); … … 746 746 return decl->set_asmName( asmName ); 747 747 } else if ( td->kind == TypeData::Aggregate ) { 748 return buildAggregate( td );748 return buildAggregate( td, attributes ); 749 749 } else if ( td->kind == TypeData::Enum ) { 750 return buildEnum( td );750 return buildEnum( td, attributes ); 751 751 } else if ( td->kind == TypeData::Symbolic ) { 752 752 return buildSymbolic( td, name, sc ); 753 753 } else { 754 return (new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, list< Attribute * >(), isInline, isNoreturn ))->set_asmName( asmName );754 return (new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, attributes, isInline, isNoreturn ))->set_asmName( asmName ); 755 755 } // if 756 756 return nullptr;
Note: See TracChangeset
for help on using the changeset viewer.