Changeset 937e51d for src/CodeGen/CodeGenerator.h
- Timestamp:
- Jun 26, 2015, 4:00:26 PM (10 years ago)
- 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. - File:
-
- 1 moved
-
src/CodeGen/CodeGenerator.h (moved) (moved from src/CodeGen/CodeGenerator2.h ) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.h
reb50842 r937e51d 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // CodeGenerator 2.h --7 // CodeGenerator.h -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon May 18 23:35:37201513 // Update Count : 2 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Thu Jun 11 13:24:23 2015 13 // Update Count : 23 14 14 // 15 15 … … 17 17 #define CODEGENV_H 18 18 19 #include <strstream>20 19 #include <list> 21 20 … … 25 24 26 25 namespace CodeGen { 27 class CodeGenerator 2: public Visitor {26 class CodeGenerator : public Visitor { 28 27 public: 29 28 static int tabsize; 30 29 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 ); 36 33 37 34 //*** Declaration … … 82 79 virtual void visit( DeclStmt * ); 83 80 84 std::string get_string( void );85 void add_string_left( std::string s ) { before << s; }86 void shift_left();87 81 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 }; 88 88 private: 89 90 Indenter indent; 89 91 int cur_indent; 90 92 bool insideFunction; 91 std::ostream &before; 92 std::string after; 93 std::ostream &output; 93 94 94 95 static std::string printLabels ( std::list < Label > & ); … … 100 101 101 102 template< class Iterator > 102 void CodeGenerator 2::genCommaList( Iterator begin, Iterator end ) {103 void CodeGenerator::genCommaList( Iterator begin, Iterator end ) { 103 104 if ( begin == end ) return; 104 105 … … 106 107 (*begin++)->accept( *this ); 107 108 if ( begin == end ) return; 108 before<< ", ";109 output << ", "; 109 110 } // for 110 111 }
Note:
See TracChangeset
for help on using the changeset viewer.