Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    rc1c1112 r413ad05  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 25 20:42:25 2016
    13 // Update Count     : 232
     12// Last Modified On : Sun Aug 28 22:12:44 2016
     13// Update Count     : 278
    1414//
    1515
     
    5050        newnode->isInline = isInline;
    5151        newnode->isNoreturn = isNoreturn;
    52         newnode->bitfieldWidth = bitfieldWidth;
     52        newnode->bitfieldWidth = maybeClone( bitfieldWidth );
    5353        newnode->hasEllipsis = hasEllipsis;
    54         newnode->initializer = initializer;
     54        newnode->initializer = maybeClone( initializer );
    5555        newnode->set_next( maybeClone( get_next() ) );
    5656        newnode->linkage = linkage;
     
    375375}
    376376
    377 void DeclarationNode::checkQualifiers( TypeData *src, TypeData *dst ) {
     377void DeclarationNode::checkQualifiers( const TypeData *src, const TypeData *dst ) {
    378378        TypeData::Qualifiers qsrc = src->qualifiers, qdst = dst->qualifiers;
    379379
     
    801801DeclarationNode *DeclarationNode::extractAggregate() const {
    802802        if ( type ) {
    803                 TypeData *ret = type->extractAggregate();
     803                TypeData *ret = typeextractAggregate( type );
    804804                if ( ret ) {
    805805                        DeclarationNode *newnode = new DeclarationNode;
     
    823823                                        *out++ = decl;
    824824                                } // if
     825                                delete extr;
    825826                        } // if
    826827                        Declaration *decl = cur->build();
     
    895896        if ( ! error.empty() ) throw SemanticError( error, this );
    896897        if ( type ) {
    897                 return type->buildDecl( name, storageClass, maybeBuild< Expression >( bitfieldWidth ), isInline, isNoreturn, linkage, maybeBuild< Initializer >(initializer) )->set_extension( extension );
     898                return buildDecl( type, name, storageClass, maybeBuild< Expression >( bitfieldWidth ), isInline, isNoreturn, linkage, maybeBuild< Initializer >(initializer) )->set_extension( extension );
    898899        } // if
    899900        if ( ! isInline && ! isNoreturn ) {
     
    908909        switch ( type->kind ) {
    909910          case TypeData::Enum:
    910                 return new EnumInstType( type->buildQualifiers(), type->enumeration->name );
     911                return new EnumInstType( buildQualifiers( type ), type->enumeration->name );
    911912          case TypeData::Aggregate: {
    912913                  ReferenceToType *ret;
    913914                  switch ( type->aggregate->kind ) {
    914915                        case DeclarationNode::Struct:
    915                           ret = new StructInstType( type->buildQualifiers(), type->aggregate->name );
     916                          ret = new StructInstType( buildQualifiers( type ), type->aggregate->name );
    916917                          break;
    917918                        case DeclarationNode::Union:
    918                           ret = new UnionInstType( type->buildQualifiers(), type->aggregate->name );
     919                          ret = new UnionInstType( buildQualifiers( type ), type->aggregate->name );
    919920                          break;
    920921                        case DeclarationNode::Trait:
    921                           ret = new TraitInstType( type->buildQualifiers(), type->aggregate->name );
     922                          ret = new TraitInstType( buildQualifiers( type ), type->aggregate->name );
    922923                          break;
    923924                        default:
     
    928929          }
    929930          case TypeData::Symbolic: {
    930                   TypeInstType *ret = new TypeInstType( type->buildQualifiers(), type->symbolic->name, false );
     931                  TypeInstType *ret = new TypeInstType( buildQualifiers( type ), type->symbolic->name, false );
    931932                  buildList( type->symbolic->actuals, ret->get_parameters() );
    932933                  return ret;
    933934          }
    934935          default:
    935                 return type->build();
     936                return typebuild( type );
    936937        } // switch
    937938}
Note: See TracChangeset for help on using the changeset viewer.