Ignore:
Timestamp:
Jun 2, 2015, 11:51:22 AM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
2b6c1e0
Parents:
6db50d5
Message:

rename CodeGenerator2 -> CodeGenerator?, CodeGenerator? refactoring and output reformatting, fix bug where while loop body label does not print

File:
1 moved

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.h

    r6db50d5 r6c4ff37  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // CodeGenerator2.h --
     7// CodeGenerator.h --
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 23:35:37 2015
    13 // Update Count     : 2
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Tue Jun 02 11:45:20 2015
     13// Update Count     : 9
    1414//
    1515
     
    2525
    2626namespace CodeGen {
    27         class CodeGenerator2 : public Visitor {
     27        class CodeGenerator : public Visitor {
    2828          public:
    2929                static int tabsize;
    3030
    31                 CodeGenerator2( std::ostream &os );
    32                 CodeGenerator2( std::ostream &os, std::string, int indent = 0, bool infun = false );
    33                 CodeGenerator2( std::ostream &os, char *, int indent = 0, bool infun = false );
     31                CodeGenerator( std::ostream &os );
     32                CodeGenerator( std::ostream &os, std::string, int indent = 0, bool infun = false );
     33                CodeGenerator( std::ostream &os, char *, int indent = 0, bool infun = false );
    3434
    35                 CodeGenerator2( CodeGenerator2 & );
     35                CodeGenerator( CodeGenerator & );
    3636
    3737                //*** Declaration
     
    8282                virtual void visit( DeclStmt * );
    8383
    84                 std::string get_string( void );
    85                 void add_string_left( std::string s ) { before << s; }
    86                 void shift_left();
    8784                template< class Iterator > void genCommaList( Iterator begin, Iterator end );
    8885          private:
    8986                int cur_indent;
    9087                bool insideFunction;
    91                 std::ostream &before;
    92                 std::string after;
     88                std::ostream &output;
    9389
    9490                static std::string printLabels ( std::list < Label > & );
     
    10096       
    10197        template< class Iterator >
    102         void CodeGenerator2::genCommaList( Iterator begin, Iterator end ) {
     98        void CodeGenerator::genCommaList( Iterator begin, Iterator end ) {
    10399                if ( begin == end ) return;
    104100
     
    106102                        (*begin++)->accept( *this );
    107103                        if ( begin == end ) return;
    108                         before << ", ";
     104                        output << ", ";
    109105                } // for
    110106        }
Note: See TracChangeset for help on using the changeset viewer.