Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGeneratorNew.cpp

    r0bd3faf r6e7ed0aa  
    2424namespace CodeGen {
    2525
    26 int CodeGenerator::tabsize = 4;
     26int CodeGenerator_new::tabsize = 4;
    2727
    2828// The kinds of statements that should be followed by whitespace.
     
    3535}
    3636
    37 void CodeGenerator::extension( ast::Expr const * expr ) {
     37void CodeGenerator_new::extension( ast::Expr const * expr ) {
    3838        if ( expr->extension ) output << "__extension__ ";
    3939}
    4040
    41 void CodeGenerator::extension( ast::Decl const * decl ) {
     41void CodeGenerator_new::extension( ast::Decl const * decl ) {
    4242        if ( decl->extension ) output << "__extension__ ";
    4343}
    4444
    45 void CodeGenerator::asmName( ast::DeclWithType const * decl ) {
     45void CodeGenerator_new::asmName( ast::DeclWithType const * decl ) {
    4646        if ( auto asmName = decl->asmName.as<ast::ConstantExpr>() ) {
    4747                output << " asm ( " << asmName->rep << " )";
     
    4949}
    5050
    51 CodeGenerator::LabelPrinter & CodeGenerator::LabelPrinter::operator()(
     51CodeGenerator_new::LabelPrinter & CodeGenerator_new::LabelPrinter::operator()(
    5252                std::vector<ast::Label> const & l ) {
    5353        labels = &l;
     
    5555}
    5656
    57 std::ostream & CodeGenerator::LabelPrinter::operator()( std::ostream & output ) const {
     57std::ostream & CodeGenerator_new::LabelPrinter::operator()( std::ostream & output ) const {
    5858        const std::vector<ast::Label> & labels = *this->labels;
    5959        for ( const ast::Label & label : labels ) {
     
    6666// Using updateLocation at the beginning of a node and endl within a node
    6767// should become the method of formating.
    68 void CodeGenerator::updateLocation( CodeLocation const & to ) {
     68void CodeGenerator_new::updateLocation( CodeLocation const & to ) {
    6969        // Skip if linemarks shouldn't appear or if location is unset.
    7070        if ( !options.lineMarks || to.isUnset() ) return;
     
    8686}
    8787
    88 void CodeGenerator::updateLocation( ast::ParseNode const * to ) {
     88void CodeGenerator_new::updateLocation( ast::ParseNode const * to ) {
    8989        updateLocation( to->location );
    9090}
    9191
    92 std::ostream & CodeGenerator::LineEnder::operator()( std::ostream & os ) const {
     92std::ostream & CodeGenerator_new::LineEnder::operator()( std::ostream & os ) const {
    9393        os << "\n" << std::flush;
    9494        cg.currentLocation.first_line++;
     
    9696}
    9797
    98 CodeGenerator::CodeGenerator( std::ostream & os, const Options & options ) :
    99                 indent( 0, CodeGenerator::tabsize ), output( os ),
     98CodeGenerator_new::CodeGenerator_new( std::ostream & os, const Options & options ) :
     99                indent( 0, CodeGenerator_new::tabsize ), output( os ),
    100100                options( options ), printLabels( *this ), endl( *this )
    101101{}
    102102
    103 std::string CodeGenerator::mangleName( ast::DeclWithType const * decl ) {
     103std::string CodeGenerator_new::mangleName( ast::DeclWithType const * decl ) {
    104104        // GCC builtins should always be printed unmangled.
    105105        if ( options.pretty || decl->linkage.is_gcc_builtin ) {
     
    112112}
    113113
    114 void CodeGenerator::genAttributes(
     114void CodeGenerator_new::genAttributes(
    115115                const std::vector<ast::ptr<ast::Attribute>> & attributes ) {
    116116        if ( attributes.empty() ) return;
     
    129129}
    130130
    131 void CodeGenerator::previsit( ast::Node const * ) {
     131void CodeGenerator_new::previsit( ast::Node const * ) {
    132132        // All traversal is manual.
    133133        // TODO: Which means the ast::Pass is just providing a default no visit?
     
    135135}
    136136
    137 void CodeGenerator::previsit( ast::ParseNode const * node ) {
     137void CodeGenerator_new::previsit( ast::ParseNode const * node ) {
    138138        previsit( (ast::Node const *)node );
    139139        updateLocation( node );
    140140}
    141141
    142 void CodeGenerator::postvisit( ast::Node const * node ) {
     142void CodeGenerator_new::postvisit( ast::Node const * node ) {
    143143        std::stringstream ss;
    144144        ast::print( ss, node );
     
    146146}
    147147
    148 void CodeGenerator::previsit( ast::Expr const * expr ) {
     148void CodeGenerator_new::previsit( ast::Expr const * expr ) {
    149149        previsit( (ast::ParseNode const *)expr );
    150150        GuardAction( [this, expr](){
     
    155155}
    156156
    157 void CodeGenerator::postvisit( ast::FunctionDecl const * decl ) {
     157void CodeGenerator_new::postvisit( ast::FunctionDecl const * decl ) {
    158158        // Deleted decls should never be used, so don't print them in C.
    159159        if ( decl->isDeleted && options.genC ) return;
     
    168168
    169169        std::ostringstream acc;
    170         ast::Pass<CodeGenerator> subCG( acc, subOptions );
     170        ast::Pass<CodeGenerator_new> subCG( acc, subOptions );
    171171        // Add the forall clause.
    172172        // TODO: These probably should be removed by now and the assert used.
     
    213213}
    214214
    215 ast::ObjectDecl const * CodeGenerator::postvisit(
     215//void CodeGenerator_new::postvisit( ast::ObjectDecl const * decl_ ) {
     216ast::ObjectDecl const * CodeGenerator_new::postvisit(
    216217                ast::ObjectDecl const * decl ) {
    217218        // Deleted decls should never be used, so don't print them in C.
     
    261262}
    262263
    263 void CodeGenerator::handleStorageClass( ast::DeclWithType const * decl ) {
     264void CodeGenerator_new::handleStorageClass( ast::DeclWithType const * decl ) {
    264265        if ( decl->storage.any() ) {
    265266                ast::print( output, decl->storage );
     
    267268}
    268269
    269 void CodeGenerator::handleAggregate(
     270void CodeGenerator_new::handleAggregate(
    270271                ast::AggregateDecl const * decl, std::string const & kind ) {
    271272        if ( !decl->params.empty() && !options.genC ) {
     
    295296}
    296297
    297 void CodeGenerator::postvisit( ast::StructDecl const * decl ) {
     298void CodeGenerator_new::postvisit( ast::StructDecl const * decl ) {
    298299        extension( decl );
    299300        handleAggregate( decl, "struct " );
    300301}
    301302
    302 void CodeGenerator::postvisit( ast::UnionDecl const * decl ) {
     303void CodeGenerator_new::postvisit( ast::UnionDecl const * decl ) {
    303304        extension( decl );
    304305        handleAggregate( decl, "union " );
     
    331332}
    332333
    333 void CodeGenerator::postvisit( ast::EnumDecl const * decl ) {
     334void CodeGenerator_new::postvisit( ast::EnumDecl const * decl ) {
    334335        extension( decl );
    335336        auto members = decl->members;
     
    369370}
    370371
    371 void CodeGenerator::postvisit( ast::TraitDecl const * decl ) {
     372void CodeGenerator_new::postvisit( ast::TraitDecl const * decl ) {
    372373        assertf( !options.genC, "TraitDecls should not reach code generation." );
    373374        extension( decl );
     
    375376}
    376377
    377 void CodeGenerator::postvisit( ast::TypedefDecl const * decl ) {
     378void CodeGenerator_new::postvisit( ast::TypedefDecl const * decl ) {
    378379        assertf( !options.genC, "Typedefs should not reach code generation." );
    379380        output << "typedef " << genType( decl->base, decl->name, options ) << endl;
    380381}
    381382
    382 void CodeGenerator::postvisit( ast::TypeDecl const * decl ) {
     383void CodeGenerator_new::postvisit( ast::TypeDecl const * decl ) {
    383384        assertf( !options.genC, "TypeDecls should not reach code generation." );
    384385        output << decl->genTypeString() << " " << decl->name;
     
    396397}
    397398
    398 void CodeGenerator::postvisit( ast::StaticAssertDecl const * decl ) {
     399void CodeGenerator_new::postvisit( ast::StaticAssertDecl const * decl ) {
    399400        output << "_Static_assert(";
    400401        decl->cond->accept( *visitor );
     
    404405}
    405406
    406 void CodeGenerator::postvisit( ast::Designation const * designation ) {
     407void CodeGenerator_new::postvisit( ast::Designation const * designation ) {
    407408        auto designators = designation->designators;
    408409        if ( 0 == designators.size() ) return;
     
    422423}
    423424
    424 void CodeGenerator::postvisit( ast::SingleInit const * init ) {
     425void CodeGenerator_new::postvisit( ast::SingleInit const * init ) {
    425426        init->value->accept( *visitor );
    426427}
    427428
    428 void CodeGenerator::postvisit( ast::ListInit const * init ) {
     429void CodeGenerator_new::postvisit( ast::ListInit const * init ) {
    429430        auto initBegin = init->initializers.begin();
    430431        auto initEnd = init->initializers.end();
     
    445446}
    446447
    447 void CodeGenerator::postvisit( ast::ConstructorInit const * init ) {
     448void CodeGenerator_new::postvisit( ast::ConstructorInit const * init ) {
    448449        assertf( !options.genC, "ConstructorInit nodes should not reach code generation." );
    449450        // This isn't actual code, but labels the constructor/destructor pairs.
     
    455456}
    456457
    457 void CodeGenerator::postvisit( ast::ApplicationExpr const * expr ) {
     458void CodeGenerator_new::postvisit( ast::ApplicationExpr const * expr ) {
    458459        extension( expr );
    459460        if ( auto var = expr->func.as<ast::VariableExpr>() ) {
     
    549550}
    550551
    551 void CodeGenerator::postvisit( ast::UntypedExpr const * expr ) {
     552void CodeGenerator_new::postvisit( ast::UntypedExpr const * expr ) {
    552553        extension( expr );
    553554        if ( auto name = expr->func.as<ast::NameExpr>() ) {
     
    637638}
    638639
    639 void CodeGenerator::postvisit( ast::RangeExpr const * expr ) {
     640void CodeGenerator_new::postvisit( ast::RangeExpr const * expr ) {
    640641        expr->low->accept( *visitor );
    641642        output << " ... ";
     
    643644}
    644645
    645 void CodeGenerator::postvisit( ast::NameExpr const * expr ) {
     646void CodeGenerator_new::postvisit( ast::NameExpr const * expr ) {
    646647        extension( expr );
    647648        if ( const OperatorInfo * opInfo = operatorLookup( expr->name ) ) {
     
    656657}
    657658
    658 void CodeGenerator::postvisit( ast::DimensionExpr const * expr ) {
     659void CodeGenerator_new::postvisit( ast::DimensionExpr const * expr ) {
    659660        extension( expr );
    660661        output << "/*non-type*/" << expr->name;
    661662}
    662663
    663 void CodeGenerator::postvisit( ast::AddressExpr const * expr ) {
     664void CodeGenerator_new::postvisit( ast::AddressExpr const * expr ) {
    664665        extension( expr );
    665666        output << "(&";
     
    668669}
    669670
    670 void CodeGenerator::postvisit( ast::LabelAddressExpr const * expr ) {
     671void CodeGenerator_new::postvisit( ast::LabelAddressExpr const * expr ) {
    671672        extension( expr );
    672673        output << "(&&" << expr->arg << ")";
    673674}
    674675
    675 void CodeGenerator::postvisit( ast::CastExpr const * expr ) {
     676void CodeGenerator_new::postvisit( ast::CastExpr const * expr ) {
    676677        extension( expr );
    677678        output << "(";
     
    687688}
    688689
    689 void CodeGenerator::postvisit( ast::KeywordCastExpr const * expr ) {
     690void CodeGenerator_new::postvisit( ast::KeywordCastExpr const * expr ) {
    690691        assertf( !options.genC, "KeywordCastExpr should not reach code generation." );
    691692        extension( expr );
     
    695696}
    696697
    697 void CodeGenerator::postvisit( ast::VirtualCastExpr const * expr ) {
     698void CodeGenerator_new::postvisit( ast::VirtualCastExpr const * expr ) {
    698699        assertf( !options.genC, "VirtualCastExpr should not reach code generation." );
    699700        extension( expr );
     
    704705}
    705706
    706 void CodeGenerator::postvisit( ast::UntypedMemberExpr const * expr ) {
     707void CodeGenerator_new::postvisit( ast::UntypedMemberExpr const * expr ) {
    707708        assertf( !options.genC, "UntypedMemberExpr should not reach code generation." );
    708709        extension( expr );
     
    712713}
    713714
    714 void CodeGenerator::postvisit( ast::MemberExpr const * expr ) {
     715void CodeGenerator_new::postvisit( ast::MemberExpr const * expr ) {
    715716        extension( expr );
    716717        expr->aggregate->accept( *visitor );
     
    718719}
    719720
    720 void CodeGenerator::postvisit( ast::VariableExpr const * expr ) {
     721void CodeGenerator_new::postvisit( ast::VariableExpr const * expr ) {
    721722        extension( expr );
    722723        const OperatorInfo * opInfo;
     
    732733}
    733734
    734 void CodeGenerator::postvisit( ast::ConstantExpr const * expr ) {
     735void CodeGenerator_new::postvisit( ast::ConstantExpr const * expr ) {
    735736        extension( expr );
    736737        output << expr->rep;
    737738}
    738739
    739 void CodeGenerator::postvisit( ast::SizeofExpr const * expr ) {
     740void CodeGenerator_new::postvisit( ast::SizeofExpr const * expr ) {
    740741        extension( expr );
    741742        output << "sizeof(";
     
    748749}
    749750
    750 void CodeGenerator::postvisit( ast::AlignofExpr const * expr ) {
     751void CodeGenerator_new::postvisit( ast::AlignofExpr const * expr ) {
    751752        // Using the GCC extension to avoid changing the std to C11.
    752753        extension( expr );
     
    760761}
    761762
    762 void CodeGenerator::postvisit( ast::UntypedOffsetofExpr const * expr ) {
     763void CodeGenerator_new::postvisit( ast::UntypedOffsetofExpr const * expr ) {
    763764        assertf( !options.genC, "UntypedOffsetofExpr should not reach code generation." );
    764765        output << "offsetof(";
     
    768769}
    769770
    770 void CodeGenerator::postvisit( ast::OffsetofExpr const * expr ) {
     771void CodeGenerator_new::postvisit( ast::OffsetofExpr const * expr ) {
    771772        // Use GCC builtin
    772773        output << "__builtin_offsetof(";
     
    776777}
    777778
    778 void CodeGenerator::postvisit( ast::OffsetPackExpr const * expr ) {
     779void CodeGenerator_new::postvisit( ast::OffsetPackExpr const * expr ) {
    779780        assertf( !options.genC, "OffsetPackExpr should not reach code generation." );
    780781        output << "__CFA_offsetpack(" << genType( expr->type, "", options ) << ")";
    781782}
    782783
    783 void CodeGenerator::postvisit( ast::LogicalExpr const * expr ) {
     784void CodeGenerator_new::postvisit( ast::LogicalExpr const * expr ) {
    784785        extension( expr );
    785786        output << "(";
     
    790791}
    791792
    792 void CodeGenerator::postvisit( ast::ConditionalExpr const * expr ) {
     793void CodeGenerator_new::postvisit( ast::ConditionalExpr const * expr ) {
    793794        extension( expr );
    794795        output << "(";
     
    801802}
    802803
    803 void CodeGenerator::postvisit( ast::CommaExpr const * expr ) {
     804void CodeGenerator_new::postvisit( ast::CommaExpr const * expr ) {
    804805        extension( expr );
    805806        output << "(";
     
    817818}
    818819
    819 void CodeGenerator::postvisit( ast::TupleAssignExpr const * expr ) {
     820void CodeGenerator_new::postvisit( ast::TupleAssignExpr const * expr ) {
    820821        assertf( !options.genC, "TupleAssignExpr should not reach code generation." );
    821822        expr->stmtExpr->accept( *visitor );
    822823}
    823824
    824 void CodeGenerator::postvisit( ast::UntypedTupleExpr const * expr ) {
     825void CodeGenerator_new::postvisit( ast::UntypedTupleExpr const * expr ) {
    825826        assertf( !options.genC, "UntypedTupleExpr should not reach code generation." );
    826827        extension( expr );
     
    830831}
    831832
    832 void CodeGenerator::postvisit( ast::TupleExpr const * expr ) {
     833void CodeGenerator_new::postvisit( ast::TupleExpr const * expr ) {
    833834        assertf( !options.genC, "TupleExpr should not reach code generation." );
    834835        extension( expr );
     
    838839}
    839840
    840 void CodeGenerator::postvisit( ast::TupleIndexExpr const * expr ) {
     841void CodeGenerator_new::postvisit( ast::TupleIndexExpr const * expr ) {
    841842        assertf( !options.genC, "TupleIndexExpr should not reach code generation." );
    842843        extension( expr );
     
    845846}
    846847
    847 void CodeGenerator::postvisit( ast::TypeExpr const * expr ) {
     848void CodeGenerator_new::postvisit( ast::TypeExpr const * expr ) {
    848849        // TODO: Should there be an assertion there?
    849850        if ( !options.genC ) {
     
    852853}
    853854
    854 void CodeGenerator::postvisit( ast::AsmExpr const * expr ) {
     855void CodeGenerator_new::postvisit( ast::AsmExpr const * expr ) {
    855856        if ( !expr->inout.empty() ) {
    856857                output << "[ " << expr->inout << " ] ";
     
    862863}
    863864
    864 void CodeGenerator::postvisit( ast::CompoundLiteralExpr const * expr ) {
     865void CodeGenerator_new::postvisit( ast::CompoundLiteralExpr const * expr ) {
    865866        //assert( expr->result && dynamic_cast<ast::ListInit const *>( expr->init ) );
    866867        assert( expr->result && expr->init.as<ast::ListInit>() );
     
    869870}
    870871
    871 void CodeGenerator::postvisit( ast::UniqueExpr const * expr ) {
     872void CodeGenerator_new::postvisit( ast::UniqueExpr const * expr ) {
    872873        assertf( !options.genC, "UniqueExpr should not reach code generation." );
    873874        output << "unq<" << expr->id << ">{ ";
     
    876877}
    877878
    878 void CodeGenerator::postvisit( ast::StmtExpr const * expr ) {
     879void CodeGenerator_new::postvisit( ast::StmtExpr const * expr ) {
    879880        auto stmts = expr->stmts->kids;
    880881        output << "({" << endl;
     
    904905}
    905906
    906 void CodeGenerator::postvisit( ast::ConstructorExpr const * expr ) {
     907void CodeGenerator_new::postvisit( ast::ConstructorExpr const * expr ) {
    907908        assertf( !options.genC, "ConstructorExpr should not reach code generation." );
    908909        expr->callExpr->accept( *visitor );
    909910}
    910911
    911 void CodeGenerator::postvisit( ast::DeletedExpr const * expr ) {
     912void CodeGenerator_new::postvisit( ast::DeletedExpr const * expr ) {
    912913        assertf( !options.genC, "DeletedExpr should not reach code generation." );
    913914        expr->expr->accept( *visitor );
    914915}
    915916
    916 void CodeGenerator::postvisit( ast::DefaultArgExpr const * expr ) {
     917void CodeGenerator_new::postvisit( ast::DefaultArgExpr const * expr ) {
    917918        assertf( !options.genC, "DefaultArgExpr should not reach code generation." );
    918919        expr->expr->accept( *visitor );
    919920}
    920921
    921 void CodeGenerator::postvisit( ast::GenericExpr const * expr ) {
     922void CodeGenerator_new::postvisit( ast::GenericExpr const * expr ) {
    922923        assertf( !options.genC, "GenericExpr should not reach code generation." );
    923924        output << "_Generic(";
     
    939940}
    940941
    941 void CodeGenerator::postvisit( ast::CompoundStmt const * stmt ) {
     942void CodeGenerator_new::postvisit( ast::CompoundStmt const * stmt ) {
    942943        output << "{" << endl;
    943944
     
    954955}
    955956
    956 void CodeGenerator::postvisit( ast::ExprStmt const * stmt ) {
     957void CodeGenerator_new::postvisit( ast::ExprStmt const * stmt ) {
    957958        assert( stmt );
    958959        // Cast the top-level expression to void to reduce gcc warnings.
     
    966967}
    967968
    968 void CodeGenerator::postvisit( ast::AsmStmt const * stmt ) {
     969void CodeGenerator_new::postvisit( ast::AsmStmt const * stmt ) {
    969970        output << "asm ";
    970971        if ( stmt->isVolatile ) output << "volatile ";
     
    990991}
    991992
    992 void CodeGenerator::postvisit( ast::AsmDecl const * decl ) {
     993void CodeGenerator_new::postvisit( ast::AsmDecl const * decl ) {
    993994        output << "asm ";
    994995        ast::AsmStmt const * stmt = decl->stmt;
     
    998999}
    9991000
    1000 void CodeGenerator::postvisit( ast::DirectiveDecl const * decl ) {
     1001void CodeGenerator_new::postvisit( ast::DirectiveDecl const * decl ) {
    10011002        // endl prevents spaces before the directive.
    10021003        output << endl << decl->stmt->directive;
    10031004}
    10041005
    1005 void CodeGenerator::postvisit( ast::DirectiveStmt const * stmt ) {
     1006void CodeGenerator_new::postvisit( ast::DirectiveStmt const * stmt ) {
    10061007        // endl prevents spaces before the directive.
    10071008        output << endl << stmt->directive;
    10081009}
    10091010
    1010 void CodeGenerator::postvisit( ast::IfStmt const * stmt ) {
     1011void CodeGenerator_new::postvisit( ast::IfStmt const * stmt ) {
    10111012        output << "if ( ";
    10121013        stmt->cond->accept( *visitor );
     
    10211022}
    10221023
    1023 void CodeGenerator::postvisit( ast::SwitchStmt const * stmt ) {
     1024void CodeGenerator_new::postvisit( ast::SwitchStmt const * stmt ) {
    10241025        output << "switch ( ";
    10251026        stmt->cond->accept( *visitor );
     
    10351036}
    10361037
    1037 void CodeGenerator::postvisit( ast::CaseClause const * clause ) {
     1038void CodeGenerator_new::postvisit( ast::CaseClause const * clause ) {
    10381039        updateLocation( clause );
    10391040        output << indent;
     
    10551056}
    10561057
    1057 void CodeGenerator::postvisit( ast::BranchStmt const * stmt ) {
     1058void CodeGenerator_new::postvisit( ast::BranchStmt const * stmt ) {
    10581059        switch ( stmt->kind ) {
    10591060        case ast::BranchStmt::Goto:
     
    10901091}
    10911092
    1092 void CodeGenerator::postvisit( ast::ReturnStmt const * stmt ) {
     1093void CodeGenerator_new::postvisit( ast::ReturnStmt const * stmt ) {
    10931094        output << "return ";
    10941095        if ( stmt->expr ) stmt->expr->accept( *visitor );
     
    10961097}
    10971098
    1098 void CodeGenerator::postvisit( ast::ThrowStmt const * stmt ) {
     1099void CodeGenerator_new::postvisit( ast::ThrowStmt const * stmt ) {
    10991100        assertf( !options.genC, "ThrowStmt should not reach code generation." );
    11001101
     
    11111112}
    11121113
    1113 void CodeGenerator::postvisit( ast::CatchClause const * stmt ) {
     1114void CodeGenerator_new::postvisit( ast::CatchClause const * stmt ) {
    11141115        assertf( !options.genC, "CatchClause should not reach code generation." );
    11151116
     
    11251126}
    11261127
    1127 void CodeGenerator::postvisit( ast::WaitForStmt const * stmt ) {
     1128void CodeGenerator_new::postvisit( ast::WaitForStmt const * stmt ) {
    11281129        assertf( !options.genC, "WaitforStmt should not reach code generation." );
    11291130
     
    11711172}
    11721173
    1173 void CodeGenerator::postvisit( ast::WithStmt const * stmt ) {
     1174void CodeGenerator_new::postvisit( ast::WithStmt const * stmt ) {
    11741175        assertf( !options.genC, "WithStmt should not reach code generation." );
    11751176
     
    11801181}
    11811182
    1182 void CodeGenerator::postvisit( ast::WhileDoStmt const * stmt ) {
     1183void CodeGenerator_new::postvisit( ast::WhileDoStmt const * stmt ) {
    11831184        if ( stmt->isDoWhile ) {
    11841185                output << "do";
     
    11901191        output << " ";
    11911192
    1192         output << CodeGenerator::printLabels( stmt->body->labels );
     1193        output << CodeGenerator_new::printLabels( stmt->body->labels );
    11931194        stmt->body->accept( *visitor );
    11941195
     
    12021203}
    12031204
    1204 void CodeGenerator::postvisit( ast::ForStmt const * stmt ) {
     1205void CodeGenerator_new::postvisit( ast::ForStmt const * stmt ) {
    12051206        // Initializer is always hoised so don't generate it.
    12061207        // TODO: Do an assertion check?
     
    12251226}
    12261227
    1227 void CodeGenerator::postvisit( ast::NullStmt const * ) {
     1228void CodeGenerator_new::postvisit( ast::NullStmt const * ) {
    12281229        output << "/* null statement */ ;";
    12291230}
    12301231
    1231 void CodeGenerator::postvisit( ast::DeclStmt const * stmt ) {
     1232void CodeGenerator_new::postvisit( ast::DeclStmt const * stmt ) {
    12321233        stmt->decl->accept( *visitor );
    12331234
     
    12351236}
    12361237
    1237 void CodeGenerator::postvisit( ast::ImplicitCtorDtorStmt const * stmt ) {
     1238void CodeGenerator_new::postvisit( ast::ImplicitCtorDtorStmt const * stmt ) {
    12381239        assertf( !options.genC, "ImplicitCtorCtorStmt should not reach code generation." );
    12391240        stmt->callStmt->accept( *visitor );
    12401241}
    12411242
    1242 void CodeGenerator::postvisit( ast::MutexStmt const * stmt ) {
     1243void CodeGenerator_new::postvisit( ast::MutexStmt const * stmt ) {
    12431244        assertf( !options.genC, "MutexStmt should not reach code generation." );
    12441245        // TODO: But this isn't what a mutex statement looks like.
Note: See TracChangeset for help on using the changeset viewer.