Ignore:
Timestamp:
Jun 26, 2015, 4:00:26 PM (10 years ago)
Author:
Aaron Moss <a3moss@…>
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:
0df292b, e0ff3e6
Parents:
eb50842 (diff), 1869adf (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 pointer to pointer to qualified fix into master

File:
1 moved

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.h

    reb50842 r937e51d  
    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 : Thu Jun 11 13:24:23 2015
     13// Update Count     : 23
    1414//
    1515
     
    1717#define CODEGENV_H
    1818
    19 #include <strstream>
    2019#include <list>
    2120
     
    2524
    2625namespace CodeGen {
    27         class CodeGenerator2 : public Visitor {
     26        class CodeGenerator : public Visitor {
    2827          public:
    2928                static int tabsize;
    3029
    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 );
    34 
    35                 CodeGenerator2( CodeGenerator2 & );
     30                CodeGenerator( std::ostream &os );
     31                CodeGenerator( std::ostream &os, std::string, int indent = 0, bool infun = false );
     32                CodeGenerator( std::ostream &os, char *, int indent = 0, bool infun = false );
    3633
    3734                //*** Declaration
     
    8279                virtual void visit( DeclStmt * );
    8380
    84                 std::string get_string( void );
    85                 void add_string_left( std::string s ) { before << s; }
    86                 void shift_left();
    8781                template< class Iterator > void genCommaList( Iterator begin, Iterator end );
     82
     83                struct Indenter {
     84                        Indenter(CodeGenerator &cg) : cg(cg) {}
     85                        CodeGenerator & cg;
     86                        std::ostream& operator()(std::ostream & os);
     87                };
    8888          private:
     89
     90                Indenter indent;
    8991                int cur_indent;
    9092                bool insideFunction;
    91                 std::ostream &before;
    92                 std::string after;
     93                std::ostream &output;
    9394
    9495                static std::string printLabels ( std::list < Label > & );
     
    100101       
    101102        template< class Iterator >
    102         void CodeGenerator2::genCommaList( Iterator begin, Iterator end ) {
     103        void CodeGenerator::genCommaList( Iterator begin, Iterator end ) {
    103104                if ( begin == end ) return;
    104105
     
    106107                        (*begin++)->accept( *this );
    107108                        if ( begin == end ) return;
    108                         before << ", ";
     109                        output << ", ";
    109110                } // for
    110111        }
Note: See TracChangeset for help on using the changeset viewer.