Changeset 7756647 for src/Parser/TypeData.cc
- Timestamp:
- Oct 13, 2016, 2:45:17 PM (8 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TypeData.cc
rac9ca96 r7756647 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 12 21:11:22201613 // Update Count : 37712 // Last Modified On : Sat Sep 24 11:14:26 2016 13 // Update Count : 415 14 14 // 15 15 … … 24 24 #include "SynTree/Statement.h" 25 25 #include "SynTree/Initializer.h" 26 27 TypeData::TypeData( Kind k ) : kind( k ), base( 0 ), forall( 0 ) { 26 using namespace std; 27 28 TypeData::TypeData( Kind k ) : kind( k ), base( nullptr ), forall( nullptr ) { 28 29 switch ( kind ) { 29 30 case Unknown: … … 37 38 case Array: 38 39 // array = new Array_t; 39 array.dimension = 0;40 array.dimension = nullptr; 40 41 array.isVarLen = false; 41 42 array.isStatic = false; … … 43 44 case Function: 44 45 // 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; 49 50 function.hasBody = false; 50 51 function.newStyle = false; … … 52 53 case Aggregate: 53 54 // 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; 57 59 break; 58 60 case AggregateInst: 59 61 // aggInst = new AggInst_t; 60 aggInst.aggregate = 0;61 aggInst.params = 0;62 aggInst.aggregate = nullptr; 63 aggInst.params = nullptr; 62 64 break; 63 65 case Enum: 64 66 // enumeration = new Enumeration_t; 65 enumeration.constants = 0; 67 enumeration.name = nullptr; 68 enumeration.constants = nullptr; 66 69 break; 67 70 case Symbolic: 68 71 case SymbolicInst: 69 72 // 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; 78 77 break; 79 78 case Tuple: … … 84 83 // typeexpr = new Typeof_t; 85 84 typeexpr = nullptr; 86 break;87 case Attr:88 // attr = new Attr_t;89 // attr.expr = nullptr;90 // attr.type = nullptr;91 85 break; 92 86 case Builtin: … … 121 115 break; 122 116 case Aggregate: 117 delete aggregate.name; 123 118 delete aggregate.params; 124 119 delete aggregate.actuals; … … 132 127 break; 133 128 case Enum: 129 delete enumeration.name; 134 130 delete enumeration.constants; 135 131 // delete enumeration; … … 137 133 case Symbolic: 138 134 case SymbolicInst: 135 delete symbolic.name; 139 136 delete symbolic.params; 140 137 delete symbolic.actuals; … … 142 139 // delete symbolic; 143 140 break; 144 case Variable:145 // delete variable.assertions;146 // delete variable;147 break;148 141 case Tuple: 149 142 // delete tuple->members; … … 153 146 // delete typeexpr->expr; 154 147 delete typeexpr; 155 break;156 case Attr:157 // delete attr.expr;158 // delete attr.type;159 // delete attr;160 148 break; 161 149 case Builtin: … … 197 185 break; 198 186 case Aggregate: 187 newtype->aggregate.name = aggregate.name ? new string( *aggregate.name ) : nullptr; 199 188 newtype->aggregate.params = maybeClone( aggregate.params ); 200 189 newtype->aggregate.actuals = maybeClone( aggregate.actuals ); 201 190 newtype->aggregate.fields = maybeClone( aggregate.fields ); 202 newtype->aggregate.name = aggregate.name;203 191 newtype->aggregate.kind = aggregate.kind; 204 192 newtype->aggregate.body = aggregate.body; … … 209 197 break; 210 198 case Enum: 211 newtype->enumeration.name = enumeration.name ;199 newtype->enumeration.name = enumeration.name ? new string( *enumeration.name ) : nullptr; 212 200 newtype->enumeration.constants = maybeClone( enumeration.constants ); 213 201 break; 214 202 case Symbolic: 215 203 case SymbolicInst: 204 newtype->symbolic.name = symbolic.name ? new string( *symbolic.name ) : nullptr; 216 205 newtype->symbolic.params = maybeClone( symbolic.params ); 217 206 newtype->symbolic.actuals = maybeClone( symbolic.actuals ); 218 207 newtype->symbolic.assertions = maybeClone( symbolic.assertions ); 219 208 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;227 209 break; 228 210 case Tuple: … … 231 213 case Typeof: 232 214 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 );238 215 break; 239 216 case Builtin: … … 245 222 } // TypeData::clone 246 223 247 void TypeData::print( std::ostream &os, int indent ) const { 248 using std::endl; 249 using std::string; 250 224 void TypeData::print( ostream &os, int indent ) const { 251 225 for ( int i = 0; i < DeclarationNode::NoQualifier; i += 1 ) { 252 226 if ( qualifiers[i] ) os << DeclarationNode::qualifierName[ i ] << ' '; … … 326 300 break; 327 301 case Aggregate: 328 os << DeclarationNode::aggregateName[ aggregate.kind ] << ' ' << aggregate.name << endl;302 os << DeclarationNode::aggregateName[ aggregate.kind ] << ' ' << *aggregate.name << endl; 329 303 if ( aggregate.params ) { 330 304 os << string( indent + 2, ' ' ) << "with type parameters " << endl; … … 363 337 break; 364 338 case SymbolicInst: 365 os << "instance of type " << symbolic.name;339 os << "instance of type " << *symbolic.name; 366 340 if ( symbolic.actuals ) { 367 341 os << " with parameters" << endl; … … 389 363 } // if 390 364 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 // } // if398 break;399 365 case Tuple: 400 366 os << "tuple "; … … 409 375 typeexpr->print( os, indent + 2 ); 410 376 } // 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 // } // if417 // if ( attr.type ) {418 // attr.type->print( os, indent + 2 );419 // } // if420 377 break; 421 378 case Builtin: … … 437 394 // add dtor: void ^?{}(T *) 438 395 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 ) ); 441 398 442 399 // add copy ctor: void ?{}(T *, T) 443 400 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 ) ); 447 404 448 405 // add default ctor: void ?{}(T *) 449 406 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 ) ); 452 409 453 410 // add assignment operator: T * ?=?(T *, T) 454 411 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 ) ); 459 416 } // if 460 417 } // for … … 488 445 case TypeData::Builtin: 489 446 return new VarArgsType( buildQualifiers( td ) ); 490 case TypeData::Attr:491 assert( false );492 return buildAttr( td );493 447 case TypeData::Symbolic: 494 448 case TypeData::Enum: 495 449 case TypeData::Aggregate: 496 case TypeData::Variable:497 450 assert( false ); 498 451 } // switch 499 return 0;452 return nullptr; 500 453 } // typebuild 501 454 502 455 TypeData * typeextractAggregate( const TypeData * td, bool toplevel ) { 503 TypeData * ret = 0;456 TypeData * ret = nullptr; 504 457 505 458 switch ( td->kind ) { … … 551 504 case DeclarationNode::Bool: 552 505 if ( td->signedness != DeclarationNode::NoSignedness ) { 553 throw SemanticError( st d::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 ); 554 507 } // if 555 508 if ( td->length != DeclarationNode::NoLength ) { 556 throw SemanticError( st d::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 ); 557 510 } // if 558 511 … … 567 520 568 521 if ( td->length != DeclarationNode::NoLength ) { 569 throw SemanticError( st d::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 ); 570 523 } // if 571 524 … … 597 550 FloatingPoint: ; 598 551 if ( td->signedness != DeclarationNode::NoSignedness ) { 599 throw SemanticError( st d::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 ); 600 553 } // if 601 554 if ( td->length == DeclarationNode::Short || td->length == DeclarationNode::LongLong ) { 602 throw SemanticError( st d::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 ); 603 556 } // if 604 557 if ( td->basictype == DeclarationNode::Float && td->length == DeclarationNode::Long ) { … … 657 610 switch ( td->aggregate.kind ) { 658 611 case DeclarationNode::Struct: 659 at = new StructDecl( td->aggregate.name );612 at = new StructDecl( *td->aggregate.name ); 660 613 buildForall( td->aggregate.params, at->get_parameters() ); 661 614 break; 662 615 case DeclarationNode::Union: 663 at = new UnionDecl( td->aggregate.name );616 at = new UnionDecl( *td->aggregate.name ); 664 617 buildForall( td->aggregate.params, at->get_parameters() ); 665 618 break; 666 619 case DeclarationNode::Trait: 667 at = new TraitDecl( td->aggregate.name );620 at = new TraitDecl( *td->aggregate.name ); 668 621 buildList( td->aggregate.params, at->get_parameters() ); 669 622 break; … … 683 636 ReferenceToType * ret; 684 637 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 ); 686 639 } else { 687 640 assert( td->aggInst.aggregate->kind == TypeData::Aggregate ); 688 641 switch ( td->aggInst.aggregate->aggregate.kind ) { 689 642 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 ); 691 645 break; 692 646 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 ); 694 648 break; 695 649 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 ); 697 651 break; 698 652 default: … … 705 659 } // buildAggInst 706 660 707 NamedTypeDecl * buildSymbolic( const TypeData * td, const st d::string & name, DeclarationNode::StorageClass sc ) {661 NamedTypeDecl * buildSymbolic( const TypeData * td, const string & name, DeclarationNode::StorageClass sc ) { 708 662 assert( td->kind == TypeData::Symbolic ); 709 663 NamedTypeDecl * ret; … … 719 673 } // buildSymbolic 720 674 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 } // buildSymbolic731 732 675 EnumDecl * buildEnum( const TypeData * td ) { 733 676 assert( td->kind == TypeData::Enum ); 734 EnumDecl * ret = new EnumDecl( td->enumeration.name );677 EnumDecl * ret = new EnumDecl( *td->enumeration.name ); 735 678 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(); 737 680 for ( const DeclarationNode * cur = td->enumeration. constants; cur != nullptr; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ), ++members ) { 738 681 if ( cur->has_enumeratorValue() ) { 739 682 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 * >() ) ); 741 684 } // if 742 685 } // for … … 746 689 TypeInstType * buildSymbolicInst( const TypeData * td ) { 747 690 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 ); 749 692 buildList( td->symbolic.actuals, ret->get_parameters() ); 750 693 buildForall( td->forall, ret->get_forall() ); … … 767 710 } // buildTypeof 768 711 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 ) { 712 Declaration * buildDecl( const TypeData * td, const string &name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, Initializer * init ) { 785 713 if ( td->kind == TypeData::Function ) { 786 714 FunctionDecl * decl; … … 792 720 decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), body, isInline, isNoreturn ); 793 721 } 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 ); 796 724 } // if 797 725 } 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 ); 803 731 } // if 804 732 } // for … … 811 739 } else if ( td->kind == TypeData::Symbolic ) { 812 740 return buildSymbolic( td, name, sc ); 813 } else if ( td->kind == TypeData::Variable ) {814 assert( false );815 return buildVariable( td );816 741 } 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 ); 818 743 } // if 819 return 0;744 return nullptr; 820 745 } // buildDecl 821 746 … … 833 758 break; 834 759 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 ) ) ); 836 761 } // switch 837 762 } 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 ) ); 839 764 } // if 840 765 return ft;
Note: See TracChangeset
for help on using the changeset viewer.