Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypeData.cc

    rcbce272 rbd46af4  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Aug  9 13:50:00 2017
    13 // Update Count     : 567
     12// Last Modified On : Mon Aug 14 10:41:00 2017
     13// Update Count     : 568
    1414//
    1515
     
    6363                aggregate.fields = nullptr;
    6464                aggregate.body = false;
    65                 aggregate.tagged = false;
    66                 aggregate.parent = nullptr;
    6765                break;
    6866          case AggregateInst:
     
    123121                delete aggregate.actuals;
    124122                delete aggregate.fields;
    125                 delete aggregate.parent;
    126123                // delete aggregate;
    127124                break;
     
    624621        switch ( td->aggregate.kind ) {
    625622          case DeclarationNode::Struct:
    626                 if ( td->aggregate.tagged ) {
    627                         at = new StructDecl( *td->aggregate.name, td->aggregate.parent, attributes, linkage );
    628                         buildForall( td->aggregate.params, at->get_parameters() );
    629                         break;
    630                 }
    631623          case DeclarationNode::Coroutine:
    632624          case DeclarationNode::Monitor:
     
    636628                break;
    637629          case DeclarationNode::Union:
    638                 at = new UnionDecl( *td->aggregate.name, attributes );
     630                at = new UnionDecl( *td->aggregate.name, attributes, linkage );
    639631                buildForall( td->aggregate.params, at->get_parameters() );
    640632                break;
    641633          case DeclarationNode::Trait:
    642                 at = new TraitDecl( *td->aggregate.name, attributes );
     634                at = new TraitDecl( *td->aggregate.name, attributes, linkage );
    643635                buildList( td->aggregate.params, at->get_parameters() );
    644636                break;
     
    657649          case TypeData::Enum: {
    658650                  if ( type->enumeration.body ) {
    659                           EnumDecl * typedecl = buildEnum( type, attributes );
     651                          EnumDecl * typedecl = buildEnum( type, attributes, linkage );
    660652                          return new EnumInstType( buildQualifiers( type ), typedecl );
    661653                  } else {
     
    762754} // buildSymbolic
    763755
    764 EnumDecl * buildEnum( const TypeData * td, std::list< Attribute * > attributes ) {
     756EnumDecl * buildEnum( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) {
    765757        assert( td->kind == TypeData::Enum );
    766         EnumDecl * ret = new EnumDecl( *td->enumeration.name, attributes );
     758        EnumDecl * ret = new EnumDecl( *td->enumeration.name, attributes, linkage );
    767759        buildList( td->enumeration.constants, ret->get_members() );
    768760        list< Declaration * >::iterator members = ret->get_members().begin();
     
    815807                return buildAggregate( td, attributes, linkage );
    816808        } else if ( td->kind == TypeData::Enum ) {
    817                 return buildEnum( td, attributes );
     809                return buildEnum( td, attributes, linkage );
    818810        } else if ( td->kind == TypeData::Symbolic ) {
    819811                return buildSymbolic( td, name, scs, linkage );
Note: See TracChangeset for help on using the changeset viewer.