Ignore:
Timestamp:
Nov 14, 2023, 12:19:09 PM (23 months ago)
Author:
caparson <caparson@…>
Branches:
master
Children:
1ccae59, 89a8bab
Parents:
df8ba61a (diff), 5625427 (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGeneratorNew.cpp

    rdf8ba61a r8d182b1  
    2424namespace CodeGen {
    2525
    26 int CodeGenerator_new::tabsize = 4;
     26int CodeGenerator::tabsize = 4;
    2727
    2828// The kinds of statements that should be followed by whitespace.
     
    3535}
    3636
    37 void CodeGenerator_new::extension( ast::Expr const * expr ) {
     37void CodeGenerator::extension( ast::Expr const * expr ) {
    3838        if ( expr->extension ) output << "__extension__ ";
    3939}
    4040
    41 void CodeGenerator_new::extension( ast::Decl const * decl ) {
     41void CodeGenerator::extension( ast::Decl const * decl ) {
    4242        if ( decl->extension ) output << "__extension__ ";
    4343}
    4444
    45 void CodeGenerator_new::asmName( ast::DeclWithType const * decl ) {
     45void CodeGenerator::asmName( ast::DeclWithType const * decl ) {
    4646        if ( auto asmName = decl->asmName.as<ast::ConstantExpr>() ) {
    4747                output << " asm ( " << asmName->rep << " )";
     
    4949}
    5050
    51 CodeGenerator_new::LabelPrinter & CodeGenerator_new::LabelPrinter::operator()(
     51CodeGenerator::LabelPrinter & CodeGenerator::LabelPrinter::operator()(
    5252                std::vector<ast::Label> const & l ) {
    5353        labels = &l;
     
    5555}
    5656
    57 std::ostream & CodeGenerator_new::LabelPrinter::operator()( std::ostream & output ) const {
     57std::ostream & CodeGenerator::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_new::updateLocation( CodeLocation const & to ) {
     68void CodeGenerator::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_new::updateLocation( ast::ParseNode const * to ) {
     88void CodeGenerator::updateLocation( ast::ParseNode const * to ) {
    8989        updateLocation( to->location );
    9090}
    9191
    92 std::ostream & CodeGenerator_new::LineEnder::operator()( std::ostream & os ) const {
     92std::ostream & CodeGenerator::LineEnder::operator()( std::ostream & os ) const {
    9393        os << "\n" << std::flush;
    9494        cg.currentLocation.first_line++;
     
    9696}
    9797
    98 CodeGenerator_new::CodeGenerator_new( std::ostream & os, const Options & options ) :
    99                 indent( 0, CodeGenerator_new::tabsize ), output( os ),
     98CodeGenerator::CodeGenerator( std::ostream & os, const Options & options ) :
     99                indent( 0, CodeGenerator::tabsize ), output( os ),
    100100                options( options ), printLabels( *this ), endl( *this )
    101101{}
    102102
    103 std::string CodeGenerator_new::mangleName( ast::DeclWithType const * decl ) {
     103std::string CodeGenerator::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_new::genAttributes(
     114void CodeGenerator::genAttributes(
    115115                const std::vector<ast::ptr<ast::Attribute>> & attributes ) {
    116116        if ( attributes.empty() ) return;
     
    129129}
    130130
    131 void CodeGenerator_new::previsit( ast::Node const * ) {
     131void CodeGenerator::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_new::previsit( ast::ParseNode const * node ) {
     137void CodeGenerator::previsit( ast::ParseNode const * node ) {
    138138        previsit( (ast::Node const *)node );
    139139        updateLocation( node );
    140140}
    141141
    142 void CodeGenerator_new::postvisit( ast::Node const * node ) {
     142void CodeGenerator::postvisit( ast::Node const * node ) {
    143143        std::stringstream ss;
    144144        ast::print( ss, node );
     
    146146}
    147147
    148 void CodeGenerator_new::previsit( ast::Expr const * expr ) {
     148void CodeGenerator::previsit( ast::Expr const * expr ) {
    149149        previsit( (ast::ParseNode const *)expr );
    150150        GuardAction( [this, expr](){
     
    155155}
    156156
    157 void CodeGenerator_new::postvisit( ast::FunctionDecl const * decl ) {
     157void CodeGenerator::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_new> subCG( acc, subOptions );
     170        ast::Pass<CodeGenerator> subCG( acc, subOptions );
    171171        // Add the forall clause.
    172172        // TODO: These probably should be removed by now and the assert used.
     
    213213}
    214214
    215 //void CodeGenerator_new::postvisit( ast::ObjectDecl const * decl_ ) {
    216 ast::ObjectDecl const * CodeGenerator_new::postvisit(
     215ast::ObjectDecl const * CodeGenerator::postvisit(
    217216                ast::ObjectDecl const * decl ) {
    218217        // Deleted decls should never be used, so don't print them in C.
     
    262261}
    263262
    264 void CodeGenerator_new::handleStorageClass( ast::DeclWithType const * decl ) {
     263void CodeGenerator::handleStorageClass( ast::DeclWithType const * decl ) {
    265264        if ( decl->storage.any() ) {
    266265                ast::print( output, decl->storage );
     
    268267}
    269268
    270 void CodeGenerator_new::handleAggregate(
     269void CodeGenerator::handleAggregate(
    271270                ast::AggregateDecl const * decl, std::string const & kind ) {
    272271        if ( !decl->params.empty() && !options.genC ) {
     
    296295}
    297296
    298 void CodeGenerator_new::postvisit( ast::StructDecl const * decl ) {
     297void CodeGenerator::postvisit( ast::StructDecl const * decl ) {
    299298        extension( decl );
    300299        handleAggregate( decl, "struct " );
    301300}
    302301
    303 void CodeGenerator_new::postvisit( ast::UnionDecl const * decl ) {
     302void CodeGenerator::postvisit( ast::UnionDecl const * decl ) {
    304303        extension( decl );
    305304        handleAggregate( decl, "union " );
     
    332331}
    333332
    334 void CodeGenerator_new::postvisit( ast::EnumDecl const * decl ) {
     333void CodeGenerator::postvisit( ast::EnumDecl const * decl ) {
    335334        extension( decl );
    336335        auto members = decl->members;
     
    370369}
    371370
    372 void CodeGenerator_new::postvisit( ast::TraitDecl const * decl ) {
     371void CodeGenerator::postvisit( ast::TraitDecl const * decl ) {
    373372        assertf( !options.genC, "TraitDecls should not reach code generation." );
    374373        extension( decl );
     
    376375}
    377376
    378 void CodeGenerator_new::postvisit( ast::TypedefDecl const * decl ) {
     377void CodeGenerator::postvisit( ast::TypedefDecl const * decl ) {
    379378        assertf( !options.genC, "Typedefs should not reach code generation." );
    380379        output << "typedef " << genType( decl->base, decl->name, options ) << endl;
    381380}
    382381
    383 void CodeGenerator_new::postvisit( ast::TypeDecl const * decl ) {
     382void CodeGenerator::postvisit( ast::TypeDecl const * decl ) {
    384383        assertf( !options.genC, "TypeDecls should not reach code generation." );
    385384        output << decl->genTypeString() << " " << decl->name;
     
    397396}
    398397
    399 void CodeGenerator_new::postvisit( ast::StaticAssertDecl const * decl ) {
     398void CodeGenerator::postvisit( ast::StaticAssertDecl const * decl ) {
    400399        output << "_Static_assert(";
    401400        decl->cond->accept( *visitor );
     
    405404}
    406405
    407 void CodeGenerator_new::postvisit( ast::Designation const * designation ) {
     406void CodeGenerator::postvisit( ast::Designation const * designation ) {
    408407        auto designators = designation->designators;
    409408        if ( 0 == designators.size() ) return;
     
    423422}
    424423
    425 void CodeGenerator_new::postvisit( ast::SingleInit const * init ) {
     424void CodeGenerator::postvisit( ast::SingleInit const * init ) {
    426425        init->value->accept( *visitor );
    427426}
    428427
    429 void CodeGenerator_new::postvisit( ast::ListInit const * init ) {
     428void CodeGenerator::postvisit( ast::ListInit const * init ) {
    430429        auto initBegin = init->initializers.begin();
    431430        auto initEnd = init->initializers.end();
     
    446445}
    447446
    448 void CodeGenerator_new::postvisit( ast::ConstructorInit const * init ) {
     447void CodeGenerator::postvisit( ast::ConstructorInit const * init ) {
    449448        assertf( !options.genC, "ConstructorInit nodes should not reach code generation." );
    450449        // This isn't actual code, but labels the constructor/destructor pairs.
     
    456455}
    457456
    458 void CodeGenerator_new::postvisit( ast::ApplicationExpr const * expr ) {
     457void CodeGenerator::postvisit( ast::ApplicationExpr const * expr ) {
    459458        extension( expr );
    460459        if ( auto var = expr->func.as<ast::VariableExpr>() ) {
     
    550549}
    551550
    552 void CodeGenerator_new::postvisit( ast::UntypedExpr const * expr ) {
     551void CodeGenerator::postvisit( ast::UntypedExpr const * expr ) {
    553552        extension( expr );
    554553        if ( auto name = expr->func.as<ast::NameExpr>() ) {
     
    638637}
    639638
    640 void CodeGenerator_new::postvisit( ast::RangeExpr const * expr ) {
     639void CodeGenerator::postvisit( ast::RangeExpr const * expr ) {
    641640        expr->low->accept( *visitor );
    642641        output << " ... ";
     
    644643}
    645644
    646 void CodeGenerator_new::postvisit( ast::NameExpr const * expr ) {
     645void CodeGenerator::postvisit( ast::NameExpr const * expr ) {
    647646        extension( expr );
    648647        if ( const OperatorInfo * opInfo = operatorLookup( expr->name ) ) {
     
    657656}
    658657
    659 void CodeGenerator_new::postvisit( ast::DimensionExpr const * expr ) {
     658void CodeGenerator::postvisit( ast::DimensionExpr const * expr ) {
    660659        extension( expr );
    661660        output << "/*non-type*/" << expr->name;
    662661}
    663662
    664 void CodeGenerator_new::postvisit( ast::AddressExpr const * expr ) {
     663void CodeGenerator::postvisit( ast::AddressExpr const * expr ) {
    665664        extension( expr );
    666665        output << "(&";
     
    669668}
    670669
    671 void CodeGenerator_new::postvisit( ast::LabelAddressExpr const * expr ) {
     670void CodeGenerator::postvisit( ast::LabelAddressExpr const * expr ) {
    672671        extension( expr );
    673672        output << "(&&" << expr->arg << ")";
    674673}
    675674
    676 void CodeGenerator_new::postvisit( ast::CastExpr const * expr ) {
     675void CodeGenerator::postvisit( ast::CastExpr const * expr ) {
    677676        extension( expr );
    678677        output << "(";
     
    688687}
    689688
    690 void CodeGenerator_new::postvisit( ast::KeywordCastExpr const * expr ) {
     689void CodeGenerator::postvisit( ast::KeywordCastExpr const * expr ) {
    691690        assertf( !options.genC, "KeywordCastExpr should not reach code generation." );
    692691        extension( expr );
     
    696695}
    697696
    698 void CodeGenerator_new::postvisit( ast::VirtualCastExpr const * expr ) {
     697void CodeGenerator::postvisit( ast::VirtualCastExpr const * expr ) {
    699698        assertf( !options.genC, "VirtualCastExpr should not reach code generation." );
    700699        extension( expr );
     
    705704}
    706705
    707 void CodeGenerator_new::postvisit( ast::UntypedMemberExpr const * expr ) {
     706void CodeGenerator::postvisit( ast::UntypedMemberExpr const * expr ) {
    708707        assertf( !options.genC, "UntypedMemberExpr should not reach code generation." );
    709708        extension( expr );
     
    713712}
    714713
    715 void CodeGenerator_new::postvisit( ast::MemberExpr const * expr ) {
     714void CodeGenerator::postvisit( ast::MemberExpr const * expr ) {
    716715        extension( expr );
    717716        expr->aggregate->accept( *visitor );
     
    719718}
    720719
    721 void CodeGenerator_new::postvisit( ast::VariableExpr const * expr ) {
     720void CodeGenerator::postvisit( ast::VariableExpr const * expr ) {
    722721        extension( expr );
    723722        const OperatorInfo * opInfo;
     
    733732}
    734733
    735 void CodeGenerator_new::postvisit( ast::ConstantExpr const * expr ) {
     734void CodeGenerator::postvisit( ast::ConstantExpr const * expr ) {
    736735        extension( expr );
    737736        output << expr->rep;
    738737}
    739738
    740 void CodeGenerator_new::postvisit( ast::SizeofExpr const * expr ) {
     739void CodeGenerator::postvisit( ast::SizeofExpr const * expr ) {
    741740        extension( expr );
    742741        output << "sizeof(";
     
    749748}
    750749
    751 void CodeGenerator_new::postvisit( ast::AlignofExpr const * expr ) {
     750void CodeGenerator::postvisit( ast::AlignofExpr const * expr ) {
    752751        // Using the GCC extension to avoid changing the std to C11.
    753752        extension( expr );
     
    761760}
    762761
    763 void CodeGenerator_new::postvisit( ast::UntypedOffsetofExpr const * expr ) {
     762void CodeGenerator::postvisit( ast::UntypedOffsetofExpr const * expr ) {
    764763        assertf( !options.genC, "UntypedOffsetofExpr should not reach code generation." );
    765764        output << "offsetof(";
     
    769768}
    770769
    771 void CodeGenerator_new::postvisit( ast::OffsetofExpr const * expr ) {
     770void CodeGenerator::postvisit( ast::OffsetofExpr const * expr ) {
    772771        // Use GCC builtin
    773772        output << "__builtin_offsetof(";
     
    777776}
    778777
    779 void CodeGenerator_new::postvisit( ast::OffsetPackExpr const * expr ) {
     778void CodeGenerator::postvisit( ast::OffsetPackExpr const * expr ) {
    780779        assertf( !options.genC, "OffsetPackExpr should not reach code generation." );
    781780        output << "__CFA_offsetpack(" << genType( expr->type, "", options ) << ")";
    782781}
    783782
    784 void CodeGenerator_new::postvisit( ast::LogicalExpr const * expr ) {
     783void CodeGenerator::postvisit( ast::LogicalExpr const * expr ) {
    785784        extension( expr );
    786785        output << "(";
     
    791790}
    792791
    793 void CodeGenerator_new::postvisit( ast::ConditionalExpr const * expr ) {
     792void CodeGenerator::postvisit( ast::ConditionalExpr const * expr ) {
    794793        extension( expr );
    795794        output << "(";
     
    802801}
    803802
    804 void CodeGenerator_new::postvisit( ast::CommaExpr const * expr ) {
     803void CodeGenerator::postvisit( ast::CommaExpr const * expr ) {
    805804        extension( expr );
    806805        output << "(";
     
    818817}
    819818
    820 void CodeGenerator_new::postvisit( ast::TupleAssignExpr const * expr ) {
     819void CodeGenerator::postvisit( ast::TupleAssignExpr const * expr ) {
    821820        assertf( !options.genC, "TupleAssignExpr should not reach code generation." );
    822821        expr->stmtExpr->accept( *visitor );
    823822}
    824823
    825 void CodeGenerator_new::postvisit( ast::UntypedTupleExpr const * expr ) {
     824void CodeGenerator::postvisit( ast::UntypedTupleExpr const * expr ) {
    826825        assertf( !options.genC, "UntypedTupleExpr should not reach code generation." );
    827826        extension( expr );
     
    831830}
    832831
    833 void CodeGenerator_new::postvisit( ast::TupleExpr const * expr ) {
     832void CodeGenerator::postvisit( ast::TupleExpr const * expr ) {
    834833        assertf( !options.genC, "TupleExpr should not reach code generation." );
    835834        extension( expr );
     
    839838}
    840839
    841 void CodeGenerator_new::postvisit( ast::TupleIndexExpr const * expr ) {
     840void CodeGenerator::postvisit( ast::TupleIndexExpr const * expr ) {
    842841        assertf( !options.genC, "TupleIndexExpr should not reach code generation." );
    843842        extension( expr );
     
    846845}
    847846
    848 void CodeGenerator_new::postvisit( ast::TypeExpr const * expr ) {
     847void CodeGenerator::postvisit( ast::TypeExpr const * expr ) {
    849848        // TODO: Should there be an assertion there?
    850849        if ( !options.genC ) {
     
    853852}
    854853
    855 void CodeGenerator_new::postvisit( ast::AsmExpr const * expr ) {
     854void CodeGenerator::postvisit( ast::AsmExpr const * expr ) {
    856855        if ( !expr->inout.empty() ) {
    857856                output << "[ " << expr->inout << " ] ";
     
    863862}
    864863
    865 void CodeGenerator_new::postvisit( ast::CompoundLiteralExpr const * expr ) {
     864void CodeGenerator::postvisit( ast::CompoundLiteralExpr const * expr ) {
    866865        //assert( expr->result && dynamic_cast<ast::ListInit const *>( expr->init ) );
    867866        assert( expr->result && expr->init.as<ast::ListInit>() );
     
    870869}
    871870
    872 void CodeGenerator_new::postvisit( ast::UniqueExpr const * expr ) {
     871void CodeGenerator::postvisit( ast::UniqueExpr const * expr ) {
    873872        assertf( !options.genC, "UniqueExpr should not reach code generation." );
    874873        output << "unq<" << expr->id << ">{ ";
     
    877876}
    878877
    879 void CodeGenerator_new::postvisit( ast::StmtExpr const * expr ) {
     878void CodeGenerator::postvisit( ast::StmtExpr const * expr ) {
    880879        auto stmts = expr->stmts->kids;
    881880        output << "({" << endl;
     
    905904}
    906905
    907 void CodeGenerator_new::postvisit( ast::ConstructorExpr const * expr ) {
     906void CodeGenerator::postvisit( ast::ConstructorExpr const * expr ) {
    908907        assertf( !options.genC, "ConstructorExpr should not reach code generation." );
    909908        expr->callExpr->accept( *visitor );
    910909}
    911910
    912 void CodeGenerator_new::postvisit( ast::DeletedExpr const * expr ) {
     911void CodeGenerator::postvisit( ast::DeletedExpr const * expr ) {
    913912        assertf( !options.genC, "DeletedExpr should not reach code generation." );
    914913        expr->expr->accept( *visitor );
    915914}
    916915
    917 void CodeGenerator_new::postvisit( ast::DefaultArgExpr const * expr ) {
     916void CodeGenerator::postvisit( ast::DefaultArgExpr const * expr ) {
    918917        assertf( !options.genC, "DefaultArgExpr should not reach code generation." );
    919918        expr->expr->accept( *visitor );
    920919}
    921920
    922 void CodeGenerator_new::postvisit( ast::GenericExpr const * expr ) {
     921void CodeGenerator::postvisit( ast::GenericExpr const * expr ) {
    923922        assertf( !options.genC, "GenericExpr should not reach code generation." );
    924923        output << "_Generic(";
     
    940939}
    941940
    942 void CodeGenerator_new::postvisit( ast::CompoundStmt const * stmt ) {
     941void CodeGenerator::postvisit( ast::CompoundStmt const * stmt ) {
    943942        output << "{" << endl;
    944943
     
    955954}
    956955
    957 void CodeGenerator_new::postvisit( ast::ExprStmt const * stmt ) {
     956void CodeGenerator::postvisit( ast::ExprStmt const * stmt ) {
    958957        assert( stmt );
    959958        // Cast the top-level expression to void to reduce gcc warnings.
     
    967966}
    968967
    969 void CodeGenerator_new::postvisit( ast::AsmStmt const * stmt ) {
     968void CodeGenerator::postvisit( ast::AsmStmt const * stmt ) {
    970969        output << "asm ";
    971970        if ( stmt->isVolatile ) output << "volatile ";
     
    991990}
    992991
    993 void CodeGenerator_new::postvisit( ast::AsmDecl const * decl ) {
     992void CodeGenerator::postvisit( ast::AsmDecl const * decl ) {
    994993        output << "asm ";
    995994        ast::AsmStmt const * stmt = decl->stmt;
     
    999998}
    1000999
    1001 void CodeGenerator_new::postvisit( ast::DirectiveDecl const * decl ) {
     1000void CodeGenerator::postvisit( ast::DirectiveDecl const * decl ) {
    10021001        // endl prevents spaces before the directive.
    10031002        output << endl << decl->stmt->directive;
    10041003}
    10051004
    1006 void CodeGenerator_new::postvisit( ast::DirectiveStmt const * stmt ) {
     1005void CodeGenerator::postvisit( ast::DirectiveStmt const * stmt ) {
    10071006        // endl prevents spaces before the directive.
    10081007        output << endl << stmt->directive;
    10091008}
    10101009
    1011 void CodeGenerator_new::postvisit( ast::IfStmt const * stmt ) {
     1010void CodeGenerator::postvisit( ast::IfStmt const * stmt ) {
    10121011        output << "if ( ";
    10131012        stmt->cond->accept( *visitor );
     
    10221021}
    10231022
    1024 void CodeGenerator_new::postvisit( ast::SwitchStmt const * stmt ) {
     1023void CodeGenerator::postvisit( ast::SwitchStmt const * stmt ) {
    10251024        output << "switch ( ";
    10261025        stmt->cond->accept( *visitor );
     
    10361035}
    10371036
    1038 void CodeGenerator_new::postvisit( ast::CaseClause const * clause ) {
     1037void CodeGenerator::postvisit( ast::CaseClause const * clause ) {
    10391038        updateLocation( clause );
    10401039        output << indent;
     
    10561055}
    10571056
    1058 void CodeGenerator_new::postvisit( ast::BranchStmt const * stmt ) {
     1057void CodeGenerator::postvisit( ast::BranchStmt const * stmt ) {
    10591058        switch ( stmt->kind ) {
    10601059        case ast::BranchStmt::Goto:
     
    10911090}
    10921091
    1093 void CodeGenerator_new::postvisit( ast::ReturnStmt const * stmt ) {
     1092void CodeGenerator::postvisit( ast::ReturnStmt const * stmt ) {
    10941093        output << "return ";
    10951094        if ( stmt->expr ) stmt->expr->accept( *visitor );
     
    10971096}
    10981097
    1099 void CodeGenerator_new::postvisit( ast::ThrowStmt const * stmt ) {
     1098void CodeGenerator::postvisit( ast::ThrowStmt const * stmt ) {
    11001099        assertf( !options.genC, "ThrowStmt should not reach code generation." );
    11011100
     
    11121111}
    11131112
    1114 void CodeGenerator_new::postvisit( ast::CatchClause const * stmt ) {
     1113void CodeGenerator::postvisit( ast::CatchClause const * stmt ) {
    11151114        assertf( !options.genC, "CatchClause should not reach code generation." );
    11161115
     
    11261125}
    11271126
    1128 void CodeGenerator_new::postvisit( ast::WaitForStmt const * stmt ) {
     1127void CodeGenerator::postvisit( ast::WaitForStmt const * stmt ) {
    11291128        assertf( !options.genC, "WaitforStmt should not reach code generation." );
    11301129
     
    11721171}
    11731172
    1174 void CodeGenerator_new::postvisit( ast::WithStmt const * stmt ) {
     1173void CodeGenerator::postvisit( ast::WithStmt const * stmt ) {
    11751174        assertf( !options.genC, "WithStmt should not reach code generation." );
    11761175
     
    11811180}
    11821181
    1183 void CodeGenerator_new::postvisit( ast::WhileDoStmt const * stmt ) {
     1182void CodeGenerator::postvisit( ast::WhileDoStmt const * stmt ) {
    11841183        if ( stmt->isDoWhile ) {
    11851184                output << "do";
     
    11911190        output << " ";
    11921191
    1193         output << CodeGenerator_new::printLabels( stmt->body->labels );
     1192        output << CodeGenerator::printLabels( stmt->body->labels );
    11941193        stmt->body->accept( *visitor );
    11951194
     
    12031202}
    12041203
    1205 void CodeGenerator_new::postvisit( ast::ForStmt const * stmt ) {
     1204void CodeGenerator::postvisit( ast::ForStmt const * stmt ) {
    12061205        // Initializer is always hoised so don't generate it.
    12071206        // TODO: Do an assertion check?
     
    12261225}
    12271226
    1228 void CodeGenerator_new::postvisit( ast::NullStmt const * ) {
     1227void CodeGenerator::postvisit( ast::NullStmt const * ) {
    12291228        output << "/* null statement */ ;";
    12301229}
    12311230
    1232 void CodeGenerator_new::postvisit( ast::DeclStmt const * stmt ) {
     1231void CodeGenerator::postvisit( ast::DeclStmt const * stmt ) {
    12331232        stmt->decl->accept( *visitor );
    12341233
     
    12361235}
    12371236
    1238 void CodeGenerator_new::postvisit( ast::ImplicitCtorDtorStmt const * stmt ) {
     1237void CodeGenerator::postvisit( ast::ImplicitCtorDtorStmt const * stmt ) {
    12391238        assertf( !options.genC, "ImplicitCtorCtorStmt should not reach code generation." );
    12401239        stmt->callStmt->accept( *visitor );
    12411240}
    12421241
    1243 void CodeGenerator_new::postvisit( ast::MutexStmt const * stmt ) {
     1242void CodeGenerator::postvisit( ast::MutexStmt const * stmt ) {
    12441243        assertf( !options.genC, "MutexStmt should not reach code generation." );
    12451244        // TODO: But this isn't what a mutex statement looks like.
Note: See TracChangeset for help on using the changeset viewer.