Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    rca1a547 r3a5131ed  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 23 15:45:02 2017
    13 // Update Count     : 759
     12// Last Modified On : Thu Feb 16 13:06:50 2017
     13// Update Count     : 753
    1414//
    1515
     
    174174        } // if
    175175
     176        if ( body ) {
     177                newnode->type->function.hasBody = true;
     178        } // if
     179
    176180        if ( ret ) {
    177181                newnode->type->base = ret->type;
     
    255259} // DeclarationNode::newAggregate
    256260
    257 DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants, bool body ) {
     261DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants ) {
    258262        DeclarationNode * newnode = new DeclarationNode;
    259263        newnode->type = new TypeData( TypeData::Enum );
     
    264268        } // if
    265269        newnode->type->enumeration.constants = constants;
    266         newnode->type->enumeration.body = body;
    267270        return newnode;
    268271} // DeclarationNode::newEnum
     
    695698        assert( ! type->function.body );
    696699        type->function.body = body;
     700        type->function.hasBody = true;
    697701        return this;
    698702}
     
    10361040        switch ( type->kind ) {
    10371041          case TypeData::Enum: {
    1038                   if ( type->enumeration.body ) {
    1039                           EnumDecl * typedecl = buildEnum( type, attributes );
    1040                           return new EnumInstType( buildQualifiers( type ), typedecl );
    1041                   } else {
    1042                           return new EnumInstType( buildQualifiers( type ), *type->enumeration.name );
    1043                   }
     1042                  EnumDecl * typedecl = buildEnum( type, attributes );
     1043                  return new EnumInstType( buildQualifiers( type ), typedecl );
    10441044          }
    10451045          case TypeData::Aggregate: {
     1046                  AggregateDecl * typedecl = buildAggregate( type, attributes );
    10461047                  ReferenceToType * ret;
    1047                   if ( type->aggregate.body ) {
    1048                           AggregateDecl * typedecl = buildAggregate( type, attributes );
    1049                           switch ( type->aggregate.kind ) {
    1050                                 case DeclarationNode::Struct:
    1051                                   ret = new StructInstType( buildQualifiers( type ), (StructDecl *)typedecl );
    1052                                   break;
    1053                                 case DeclarationNode::Union:
    1054                                   ret = new UnionInstType( buildQualifiers( type ), (UnionDecl *)typedecl );
    1055                                   break;
    1056                                 case DeclarationNode::Trait:
    1057                                   assert( false );
    1058                                   //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
    1059                                   break;
    1060                                 default:
    1061                                   assert( false );
    1062                           } // switch
    1063                   } else {
    1064                           switch ( type->aggregate.kind ) {
    1065                                 case DeclarationNode::Struct:
    1066                                   ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name );
    1067                                   break;
    1068                                 case DeclarationNode::Union:
    1069                                   ret = new UnionInstType( buildQualifiers( type ), *type->aggregate.name );
    1070                                   break;
    1071                                 case DeclarationNode::Trait:
    1072                                   assert( false );
    1073                                   //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
    1074                                   break;
    1075                                 default:
    1076                                   assert( false );
    1077                           } // switch
    1078                   } // if
     1048                  switch ( type->aggregate.kind ) {
     1049                        case DeclarationNode::Struct:
     1050                          ret = new StructInstType( buildQualifiers( type ), (StructDecl *)typedecl );
     1051                          break;
     1052                        case DeclarationNode::Union:
     1053                          ret = new UnionInstType( buildQualifiers( type ), (UnionDecl *)typedecl );
     1054                          break;
     1055                        case DeclarationNode::Trait:
     1056                          assert( false );
     1057                          //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
     1058                          break;
     1059                        default:
     1060                          assert( false );
     1061                  } // switch
    10791062                  buildList( type->aggregate.actuals, ret->get_parameters() );
    10801063                  return ret;
Note: See TracChangeset for help on using the changeset viewer.