Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r413ad05 rc1c1112  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Aug 28 22:12:44 2016
    13 // Update Count     : 278
     12// Last Modified On : Thu Aug 25 20:42:25 2016
     13// Update Count     : 232
    1414//
    1515
     
    5050        newnode->isInline = isInline;
    5151        newnode->isNoreturn = isNoreturn;
    52         newnode->bitfieldWidth = maybeClone( bitfieldWidth );
     52        newnode->bitfieldWidth = bitfieldWidth;
    5353        newnode->hasEllipsis = hasEllipsis;
    54         newnode->initializer = maybeClone( initializer );
     54        newnode->initializer = initializer;
    5555        newnode->set_next( maybeClone( get_next() ) );
    5656        newnode->linkage = linkage;
     
    375375}
    376376
    377 void DeclarationNode::checkQualifiers( const TypeData *src, const TypeData *dst ) {
     377void DeclarationNode::checkQualifiers( TypeData *src, TypeData *dst ) {
    378378        TypeData::Qualifiers qsrc = src->qualifiers, qdst = dst->qualifiers;
    379379
     
    801801DeclarationNode *DeclarationNode::extractAggregate() const {
    802802        if ( type ) {
    803                 TypeData *ret = typeextractAggregate( type );
     803                TypeData *ret = type->extractAggregate();
    804804                if ( ret ) {
    805805                        DeclarationNode *newnode = new DeclarationNode;
     
    823823                                        *out++ = decl;
    824824                                } // if
    825                                 delete extr;
    826825                        } // if
    827826                        Declaration *decl = cur->build();
     
    896895        if ( ! error.empty() ) throw SemanticError( error, this );
    897896        if ( type ) {
    898                 return buildDecl( type, name, storageClass, maybeBuild< Expression >( bitfieldWidth ), isInline, isNoreturn, linkage, maybeBuild< Initializer >(initializer) )->set_extension( extension );
     897                return type->buildDecl( name, storageClass, maybeBuild< Expression >( bitfieldWidth ), isInline, isNoreturn, linkage, maybeBuild< Initializer >(initializer) )->set_extension( extension );
    899898        } // if
    900899        if ( ! isInline && ! isNoreturn ) {
     
    909908        switch ( type->kind ) {
    910909          case TypeData::Enum:
    911                 return new EnumInstType( buildQualifiers( type ), type->enumeration->name );
     910                return new EnumInstType( type->buildQualifiers(), type->enumeration->name );
    912911          case TypeData::Aggregate: {
    913912                  ReferenceToType *ret;
    914913                  switch ( type->aggregate->kind ) {
    915914                        case DeclarationNode::Struct:
    916                           ret = new StructInstType( buildQualifiers( type ), type->aggregate->name );
     915                          ret = new StructInstType( type->buildQualifiers(), type->aggregate->name );
    917916                          break;
    918917                        case DeclarationNode::Union:
    919                           ret = new UnionInstType( buildQualifiers( type ), type->aggregate->name );
     918                          ret = new UnionInstType( type->buildQualifiers(), type->aggregate->name );
    920919                          break;
    921920                        case DeclarationNode::Trait:
    922                           ret = new TraitInstType( buildQualifiers( type ), type->aggregate->name );
     921                          ret = new TraitInstType( type->buildQualifiers(), type->aggregate->name );
    923922                          break;
    924923                        default:
     
    929928          }
    930929          case TypeData::Symbolic: {
    931                   TypeInstType *ret = new TypeInstType( buildQualifiers( type ), type->symbolic->name, false );
     930                  TypeInstType *ret = new TypeInstType( type->buildQualifiers(), type->symbolic->name, false );
    932931                  buildList( type->symbolic->actuals, ret->get_parameters() );
    933932                  return ret;
    934933          }
    935934          default:
    936                 return typebuild( type );
     935                return type->build();
    937936        } // switch
    938937}
Note: See TracChangeset for help on using the changeset viewer.