Ignore:
Timestamp:
Oct 13, 2016, 2:45:17 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
848ce71
Parents:
ac9ca96 (diff), d58a39a0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into tuples

Conflicts:

src/Parser/TypeData.cc
src/Parser/parser.cc
src/Parser/parser.yy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypeData.cc

    rac9ca96 r7756647  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 12 21:11:22 2016
    13 // Update Count     : 377
     12// Last Modified On : Sat Sep 24 11:14:26 2016
     13// Update Count     : 415
    1414//
    1515
     
    2424#include "SynTree/Statement.h"
    2525#include "SynTree/Initializer.h"
    26 
    27 TypeData::TypeData( Kind k ) : kind( k ), base( 0 ), forall( 0 ) {
     26using namespace std;
     27
     28TypeData::TypeData( Kind k ) : kind( k ), base( nullptr ), forall( nullptr ) {
    2829        switch ( kind ) {
    2930          case Unknown:
     
    3738          case Array:
    3839                // array = new Array_t;
    39                 array.dimension = 0;
     40                array.dimension = nullptr;
    4041                array.isVarLen = false;
    4142                array.isStatic = false;
     
    4344          case Function:
    4445                // function = new Function_t;
    45                 function.params = 0;
    46                 function.idList = 0;
    47                 function.oldDeclList = 0;
    48                 function.body = 0;
     46                function.params = nullptr;
     47                function.idList = nullptr;
     48                function.oldDeclList = nullptr;
     49                function.body = nullptr;
    4950                function.hasBody = false;
    5051                function.newStyle = false;
     
    5253          case Aggregate:
    5354                // aggregate = new Aggregate_t;
    54                 aggregate.params = 0;
    55                 aggregate.actuals = 0;
    56                 aggregate.fields = 0;
     55                aggregate.name = nullptr;
     56                aggregate.params = nullptr;
     57                aggregate.actuals = nullptr;
     58                aggregate.fields = nullptr;
    5759                break;
    5860          case AggregateInst:
    5961                // aggInst = new AggInst_t;
    60                 aggInst.aggregate = 0;
    61                 aggInst.params = 0;
     62                aggInst.aggregate = nullptr;
     63                aggInst.params = nullptr;
    6264                break;
    6365          case Enum:
    6466                // enumeration = new Enumeration_t;
    65                 enumeration.constants = 0;
     67                enumeration.name = nullptr;
     68                enumeration.constants = nullptr;
    6669                break;
    6770          case Symbolic:
    6871          case SymbolicInst:
    6972                // symbolic = new Symbolic_t;
    70                 symbolic.params = 0;
    71                 symbolic.actuals = 0;
    72                 symbolic.assertions = 0;
    73                 break;
    74           case Variable:
    75                 // variable = new Variable_t;
    76                 // variable.tyClass = DeclarationNode::Type;
    77                 // variable.assertions = 0;
     73                symbolic.name = nullptr;
     74                symbolic.params = nullptr;
     75                symbolic.actuals = nullptr;
     76                symbolic.assertions = nullptr;
    7877                break;
    7978          case Tuple:
     
    8483                // typeexpr = new Typeof_t;
    8584                typeexpr = nullptr;
    86                 break;
    87           case Attr:
    88                 // attr = new Attr_t;
    89                 // attr.expr = nullptr;
    90                 // attr.type = nullptr;
    9185                break;
    9286          case Builtin:
     
    121115                break;
    122116          case Aggregate:
     117                delete aggregate.name;
    123118                delete aggregate.params;
    124119                delete aggregate.actuals;
     
    132127                break;
    133128          case Enum:
     129                delete enumeration.name;
    134130                delete enumeration.constants;
    135131                // delete enumeration;
     
    137133          case Symbolic:
    138134          case SymbolicInst:
     135                delete symbolic.name;
    139136                delete symbolic.params;
    140137                delete symbolic.actuals;
     
    142139                // delete symbolic;
    143140                break;
    144           case Variable:
    145                 // delete variable.assertions;
    146                 // delete variable;
    147                 break;
    148141          case Tuple:
    149142                // delete tuple->members;
     
    153146                // delete typeexpr->expr;
    154147                delete typeexpr;
    155                 break;
    156           case Attr:
    157                 // delete attr.expr;
    158                 // delete attr.type;
    159                 // delete attr;
    160148                break;
    161149          case Builtin:
     
    197185                break;
    198186          case Aggregate:
     187                newtype->aggregate.name = aggregate.name ? new string( *aggregate.name ) : nullptr;
    199188                newtype->aggregate.params = maybeClone( aggregate.params );
    200189                newtype->aggregate.actuals = maybeClone( aggregate.actuals );
    201190                newtype->aggregate.fields = maybeClone( aggregate.fields );
    202                 newtype->aggregate.name = aggregate.name;
    203191                newtype->aggregate.kind = aggregate.kind;
    204192                newtype->aggregate.body = aggregate.body;
     
    209197                break;
    210198          case Enum:
    211                 newtype->enumeration.name = enumeration.name;
     199                newtype->enumeration.name = enumeration.name ? new string( *enumeration.name ) : nullptr;
    212200                newtype->enumeration.constants = maybeClone( enumeration.constants );
    213201                break;
    214202          case Symbolic:
    215203          case SymbolicInst:
     204                newtype->symbolic.name = symbolic.name ? new string( *symbolic.name ) : nullptr;
    216205                newtype->symbolic.params = maybeClone( symbolic.params );
    217206                newtype->symbolic.actuals = maybeClone( symbolic.actuals );
    218207                newtype->symbolic.assertions = maybeClone( symbolic.assertions );
    219208                newtype->symbolic.isTypedef = symbolic.isTypedef;
    220                 newtype->symbolic.name = symbolic.name;
    221                 break;
    222           case Variable:
    223                 assert( false );
    224                 // newtype->variable.assertions = maybeClone( variable.assertions );
    225                 // newtype->variable.name = variable.name;
    226                 // newtype->variable.tyClass = variable.tyClass;
    227209                break;
    228210          case Tuple:
     
    231213          case Typeof:
    232214                newtype->typeexpr = maybeClone( typeexpr );
    233                 break;
    234           case Attr:
    235                 assert( false );
    236                 // newtype->attr.expr = maybeClone( attr.expr );
    237                 // newtype->attr.type = maybeClone( attr.type );
    238215                break;
    239216          case Builtin:
     
    245222} // TypeData::clone
    246223
    247 void TypeData::print( std::ostream &os, int indent ) const {
    248         using std::endl;
    249         using std::string;
    250 
     224void TypeData::print( ostream &os, int indent ) const {
    251225        for ( int i = 0; i < DeclarationNode::NoQualifier; i += 1 ) {
    252226                if ( qualifiers[i] ) os << DeclarationNode::qualifierName[ i ] << ' ';
     
    326300                break;
    327301          case Aggregate:
    328                 os << DeclarationNode::aggregateName[ aggregate.kind ] << ' ' << aggregate.name << endl;
     302                os << DeclarationNode::aggregateName[ aggregate.kind ] << ' ' << *aggregate.name << endl;
    329303                if ( aggregate.params ) {
    330304                        os << string( indent + 2, ' ' ) << "with type parameters " << endl;
     
    363337                break;
    364338          case SymbolicInst:
    365                 os << "instance of type " << symbolic.name;
     339                os << "instance of type " << *symbolic.name;
    366340                if ( symbolic.actuals ) {
    367341                        os << " with parameters" << endl;
     
    389363                } // if
    390364                break;
    391           case Variable:
    392                 // os << DeclarationNode::typeClassName[ variable.tyClass ] << " variable ";
    393                 // if ( variable.assertions ) {
    394                 //      os << endl << string( indent + 2, ' ' ) << "with assertions" << endl;
    395                 //      variable.assertions->printList( os, indent + 4 );
    396                 //      os << string( indent + 2, ' ' );
    397                 // } // if
    398                 break;
    399365          case Tuple:
    400366                os << "tuple ";
     
    409375                        typeexpr->print( os, indent + 2 );
    410376                } // if
    411                 break;
    412           case Attr:
    413                 // os << "attribute type decl " << attr.name << " applied to ";
    414                 // if ( attr.expr ) {
    415                 //      attr.expr->print( os, indent + 2 );
    416                 // } // if
    417                 // if ( attr.type ) {
    418                 //      attr.type->print( os, indent + 2 );
    419                 // } // if
    420377                break;
    421378          case Builtin:
     
    437394                        // add dtor:  void ^?{}(T *)
    438395                        FunctionType * dtorType = new FunctionType( Type::Qualifiers(), false );
    439                         dtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), td ) ), 0 ) );
    440                         td->get_assertions().push_front( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, dtorType, 0, false, false ) );
     396                        dtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) );
     397                        td->get_assertions().push_front( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, dtorType, nullptr, false, false ) );
    441398
    442399                        // add copy ctor:  void ?{}(T *, T)
    443400                        FunctionType * copyCtorType = new FunctionType( Type::Qualifiers(), false );
    444                         copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), td ) ), 0 ) );
    445                         copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new TypeInstType( Type::Qualifiers(), td->get_name(), td ), 0 ) );
    446                         td->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, copyCtorType, 0, false, false ) );
     401                        copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) );
     402                        copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) );
     403                        td->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, copyCtorType, nullptr, false, false ) );
    447404
    448405                        // add default ctor:  void ?{}(T *)
    449406                        FunctionType * ctorType = new FunctionType( Type::Qualifiers(), false );
    450                         ctorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), td ) ), 0 ) );
    451                         td->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, ctorType, 0, false, false ) );
     407                        ctorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) );
     408                        td->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, ctorType, nullptr, false, false ) );
    452409
    453410                        // add assignment operator:  T * ?=?(T *, T)
    454411                        FunctionType * assignType = new FunctionType( Type::Qualifiers(), false );
    455                         assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), td ) ), 0 ) );
    456                         assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new TypeInstType( Type::Qualifiers(), td->get_name(), td ), 0 ) );
    457                         assignType->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new TypeInstType( Type::Qualifiers(), td->get_name(), td ), 0 ) );
    458                         td->get_assertions().push_front( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, assignType, 0, false, false ) );
     412                        assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) );
     413                        assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) );
     414                        assignType->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) );
     415                        td->get_assertions().push_front( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, assignType, nullptr, false, false ) );
    459416                } // if
    460417        } // for
     
    488445          case TypeData::Builtin:
    489446                return new VarArgsType( buildQualifiers( td ) );
    490           case TypeData::Attr:
    491                 assert( false );
    492                 return buildAttr( td );
    493447          case TypeData::Symbolic:
    494448          case TypeData::Enum:
    495449          case TypeData::Aggregate:
    496           case TypeData::Variable:
    497450                assert( false );
    498451        } // switch
    499         return 0;
     452        return nullptr;
    500453} // typebuild
    501454
    502455TypeData * typeextractAggregate( const TypeData * td, bool toplevel ) {
    503         TypeData * ret = 0;
     456        TypeData * ret = nullptr;
    504457
    505458        switch ( td->kind ) {
     
    551504          case DeclarationNode::Bool:
    552505                if ( td->signedness != DeclarationNode::NoSignedness ) {
    553                         throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::signednessName[ td->signedness ] + " in type: ", td );
     506                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessName[ td->signedness ] + " in type: ", td );
    554507                } // if
    555508                if ( td->length != DeclarationNode::NoLength ) {
    556                         throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );
     509                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );
    557510                } // if
    558511
     
    567520
    568521                if ( td->length != DeclarationNode::NoLength ) {
    569                         throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );
     522                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );
    570523                } // if
    571524
     
    597550          FloatingPoint: ;
    598551                if ( td->signedness != DeclarationNode::NoSignedness ) {
    599                         throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::signednessName[ td->signedness ] + " in type: ", td );
     552                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessName[ td->signedness ] + " in type: ", td );
    600553                } // if
    601554                if ( td->length == DeclarationNode::Short || td->length == DeclarationNode::LongLong ) {
    602                         throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );
     555                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );
    603556                } // if
    604557                if ( td->basictype == DeclarationNode::Float && td->length == DeclarationNode::Long ) {
     
    657610        switch ( td->aggregate.kind ) {
    658611          case DeclarationNode::Struct:
    659                 at = new StructDecl( td->aggregate.name );
     612                at = new StructDecl( *td->aggregate.name );
    660613                buildForall( td->aggregate.params, at->get_parameters() );
    661614                break;
    662615          case DeclarationNode::Union:
    663                 at = new UnionDecl( td->aggregate.name );
     616                at = new UnionDecl( *td->aggregate.name );
    664617                buildForall( td->aggregate.params, at->get_parameters() );
    665618                break;
    666619          case DeclarationNode::Trait:
    667                 at = new TraitDecl( td->aggregate.name );
     620                at = new TraitDecl( *td->aggregate.name );
    668621                buildList( td->aggregate.params, at->get_parameters() );
    669622                break;
     
    683636        ReferenceToType * ret;
    684637        if ( td->aggInst.aggregate->kind == TypeData::Enum ) {
    685                 ret = new EnumInstType( buildQualifiers( td ), td->aggInst.aggregate->enumeration.name );
     638                ret = new EnumInstType( buildQualifiers( td ), *td->aggInst.aggregate->enumeration.name );
    686639        } else {
    687640                assert( td->aggInst.aggregate->kind == TypeData::Aggregate );
    688641                switch ( td->aggInst.aggregate->aggregate.kind ) {
    689642                  case DeclarationNode::Struct:
    690                         ret = new StructInstType( buildQualifiers( td ), td->aggInst.aggregate->aggregate.name );
     643                        assert( td->aggInst.aggregate->aggregate.name );
     644                        ret = new StructInstType( buildQualifiers( td ), *td->aggInst.aggregate->aggregate.name );
    691645                        break;
    692646                  case DeclarationNode::Union:
    693                         ret = new UnionInstType( buildQualifiers( td ), td->aggInst.aggregate->aggregate.name );
     647                        ret = new UnionInstType( buildQualifiers( td ), *td->aggInst.aggregate->aggregate.name );
    694648                        break;
    695649                  case DeclarationNode::Trait:
    696                         ret = new TraitInstType( buildQualifiers( td ), td->aggInst.aggregate->aggregate.name );
     650                        ret = new TraitInstType( buildQualifiers( td ), *td->aggInst.aggregate->aggregate.name );
    697651                        break;
    698652                  default:
     
    705659} // buildAggInst
    706660
    707 NamedTypeDecl * buildSymbolic( const TypeData * td, const std::string & name, DeclarationNode::StorageClass sc ) {
     661NamedTypeDecl * buildSymbolic( const TypeData * td, const string & name, DeclarationNode::StorageClass sc ) {
    708662        assert( td->kind == TypeData::Symbolic );
    709663        NamedTypeDecl * ret;
     
    719673} // buildSymbolic
    720674
    721 TypeDecl * buildVariable( const TypeData * td ) {
    722         assert( false );
    723         return nullptr;
    724         // assert( td->kind == TypeData::Variable );
    725         // static const TypeDecl::Kind kindMap[] = { TypeDecl::Any, TypeDecl::Ftype, TypeDecl::Dtype };
    726 
    727         // TypeDecl * ret = new TypeDecl( td->variable.name, DeclarationNode::NoStorageClass, 0, kindMap[ td->variable.tyClass ] );
    728         // buildList( td->variable.assertions, ret->get_assertions() );
    729         // return ret;
    730 } // buildSymbolic
    731 
    732675EnumDecl * buildEnum( const TypeData * td ) {
    733676        assert( td->kind == TypeData::Enum );
    734         EnumDecl * ret = new EnumDecl( td->enumeration.name );
     677        EnumDecl * ret = new EnumDecl( *td->enumeration.name );
    735678        buildList( td->enumeration.constants, ret->get_members() );
    736         std::list< Declaration * >::iterator members = ret->get_members().begin();
     679        list< Declaration * >::iterator members = ret->get_members().begin();
    737680        for ( const DeclarationNode * cur = td->enumeration. constants; cur != nullptr; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ), ++members ) {
    738681                if ( cur->has_enumeratorValue() ) {
    739682                        ObjectDecl * member = dynamic_cast< ObjectDecl * >(* members);
    740                         member->set_init( new SingleInit( maybeMoveBuild< Expression >( cur->consume_enumeratorValue() ), std::list< Expression * >() ) );
     683                        member->set_init( new SingleInit( maybeMoveBuild< Expression >( cur->consume_enumeratorValue() ), list< Expression * >() ) );
    741684                } // if
    742685        } // for
     
    746689TypeInstType * buildSymbolicInst( const TypeData * td ) {
    747690        assert( td->kind == TypeData::SymbolicInst );
    748         TypeInstType * ret = new TypeInstType( buildQualifiers( td ), td->symbolic.name, false );
     691        TypeInstType * ret = new TypeInstType( buildQualifiers( td ), *td->symbolic.name, false );
    749692        buildList( td->symbolic.actuals, ret->get_parameters() );
    750693        buildForall( td->forall, ret->get_forall() );
     
    767710} // buildTypeof
    768711
    769 AttrType * buildAttr( const TypeData * td ) {
    770         assert( false );
    771         return nullptr;
    772         // assert( td->kind == TypeData::Attr );
    773         // // assert( td->attr );
    774         // AttrType * ret;
    775         // if ( td->attr.expr ) {
    776         //      ret = new AttrType( buildQualifiers( td ), td->attr.name, td->attr.expr->build() );
    777         // } else {
    778         //      assert( td->attr.type );
    779         //      ret = new AttrType( buildQualifiers( td ), td->attr.name, td->attr.type->buildType() );
    780         // } // if
    781         // return ret;
    782 } // buildAttr
    783 
    784 Declaration * buildDecl( const TypeData * td, std::string name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, Initializer * init ) {
     712Declaration * buildDecl( const TypeData * td, const string &name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, Initializer * init ) {
    785713        if ( td->kind == TypeData::Function ) {
    786714                FunctionDecl * decl;
     
    792720                                decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), body, isInline, isNoreturn );
    793721                        } else {
    794                                 // std::list< Label > ls;
    795                                 decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), new CompoundStmt( std::list< Label >() ), isInline, isNoreturn );
     722                                // list< Label > ls;
     723                                decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), new CompoundStmt( list< Label >() ), isInline, isNoreturn );
    796724                        } // if
    797725                } else {
    798                         decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), 0, isInline, isNoreturn );
    799                 } // if
    800                 for ( DeclarationNode * cur = td->function.idList; cur != 0; cur = dynamic_cast< DeclarationNode* >( cur->get_next() ) ) {
    801                         if ( cur->get_name() != "" ) {
    802                                 decl->get_oldIdents().insert( decl->get_oldIdents().end(), cur->get_name() );
     726                        decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), nullptr, isInline, isNoreturn );
     727                } // if
     728                for ( DeclarationNode * cur = td->function.idList; cur != nullptr; cur = dynamic_cast< DeclarationNode* >( cur->get_next() ) ) {
     729                        if ( cur->name ) {
     730                                decl->get_oldIdents().insert( decl->get_oldIdents().end(), *cur->name );
    803731                        } // if
    804732                } // for
     
    811739        } else if ( td->kind == TypeData::Symbolic ) {
    812740                return buildSymbolic( td, name, sc );
    813         } else if ( td->kind == TypeData::Variable ) {
    814                 assert( false );
    815                 return buildVariable( td );
    816741        } else {
    817                 return new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, std::list< Attribute * >(), isInline, isNoreturn );
     742                return new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, list< Attribute * >(), isInline, isNoreturn );
    818743        } // if
    819         return 0;
     744        return nullptr;
    820745} // buildDecl
    821746
     
    833758                        break;
    834759                  default:
    835                         ft->get_returnVals().push_back( dynamic_cast< DeclarationWithType* >( buildDecl( td->base,  "", DeclarationNode::NoStorageClass, 0, false, false, LinkageSpec::Cforall ) ) );
     760                        ft->get_returnVals().push_back( dynamic_cast< DeclarationWithType* >( buildDecl( td->base,  "", DeclarationNode::NoStorageClass, nullptr, false, false, LinkageSpec::Cforall ) ) );
    836761                } // switch
    837762        } else {
    838                 ft->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), 0 ) );
     763                ft->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) );
    839764        } // if
    840765        return ft;
Note: See TracChangeset for help on using the changeset viewer.