Changeset bd06384 for src/SymTab/Autogen.cc
- Timestamp:
- Mar 22, 2018, 4:49:53 PM (6 years ago)
- Branches:
- new-env, with_gc
- Children:
- dbc2c2c
- Parents:
- 7e4b44db
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
r7e4b44db rbd06384 588 588 // must visit children (enum constants) to add them to the indexer 589 589 if ( enumDecl->has_body() ) { 590 EnumInstType enumInst( Type::Qualifiers(), enumDecl->get_name() );591 enumInst .set_baseEnum( enumDecl );592 EnumFuncGenerator gen( &enumInst, data, functionNesting, indexer );590 auto enumInst = new EnumInstType{ Type::Qualifiers(), enumDecl->get_name() }; 591 enumInst->set_baseEnum( enumDecl ); 592 EnumFuncGenerator gen( enumInst, data, functionNesting, indexer ); 593 593 generateFunctions( gen, declsToAddAfter ); 594 594 } … … 598 598 visit_children = false; 599 599 if ( structDecl->has_body() ) { 600 StructInstType structInst( Type::Qualifiers(), structDecl->name );601 structInst .set_baseStruct( structDecl );600 auto structInst = new StructInstType{ Type::Qualifiers(), structDecl->name }; 601 structInst->set_baseStruct( structDecl ); 602 602 for ( TypeDecl * typeDecl : structDecl->parameters ) { 603 structInst .parameters.push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->name, typeDecl ) ) );604 } 605 StructFuncGenerator gen( structDecl, &structInst, data, functionNesting, indexer );603 structInst->parameters.push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->name, typeDecl ) ) ); 604 } 605 StructFuncGenerator gen( structDecl, structInst, data, functionNesting, indexer ); 606 606 generateFunctions( gen, declsToAddAfter ); 607 607 } // if … … 611 611 visit_children = false; 612 612 if ( unionDecl->has_body() ) { 613 UnionInstType unionInst( Type::Qualifiers(), unionDecl->get_name() );614 unionInst .set_baseUnion( unionDecl );613 auto unionInst = new UnionInstType{ Type::Qualifiers(), unionDecl->get_name() }; 614 unionInst->set_baseUnion( unionDecl ); 615 615 for ( TypeDecl * typeDecl : unionDecl->get_parameters() ) { 616 unionInst .get_parameters().push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), typeDecl ) ) );617 } 618 UnionFuncGenerator gen( unionDecl, &unionInst, data, functionNesting, indexer );616 unionInst->get_parameters().push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), typeDecl ) ) ); 617 } 618 UnionFuncGenerator gen( unionDecl, unionInst, data, functionNesting, indexer ); 619 619 generateFunctions( gen, declsToAddAfter ); 620 620 } // if … … 625 625 if ( ! typeDecl->base ) return; 626 626 627 TypeInstType refType( Type::Qualifiers(), typeDecl->name, typeDecl );628 TypeFuncGenerator gen( typeDecl, &refType, data, functionNesting, indexer );627 auto refType = new TypeInstType{ Type::Qualifiers(), typeDecl->name, typeDecl }; 628 TypeFuncGenerator gen( typeDecl, refType, data, functionNesting, indexer ); 629 629 generateFunctions( gen, declsToAddAfter ); 630 630
Note: See TracChangeset
for help on using the changeset viewer.