Changeset d22e90f for src/CodeGen/CodeGenerator.h
- Timestamp:
- Sep 20, 2017, 11:47:26 AM (6 years ago)
- Branches:
- aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 47b5b63
- Parents:
- a9a4771
- git-author:
- Rob Schluntz <rschlunt@…> (09/20/17 11:46:26)
- git-committer:
- Rob Schluntz <rschlunt@…> (09/20/17 11:47:26)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.h
ra9a4771 rd22e90f 31 31 32 32 CodeGenerator( std::ostream &os, bool pretty = false, bool genC = false, bool lineMarks = false ); 33 CodeGenerator( std::ostream &os, std::string, int indent = 0, bool infun = false );34 CodeGenerator( std::ostream &os, char *, int indent = 0, bool infun = false );35 33 36 34 //*** Turn off visit_children for all nodes … … 125 123 126 124 void updateLocation( BaseSyntaxNode const * to ); 125 struct LineEnder { 126 CodeGenerator & cg; 127 LineEnder( CodeGenerator & cg ) : cg( cg ) {} 128 std::ostream & operator()(std::ostream &) const; 129 }; 127 130 private: 128 131 Indenter indent; 129 bool insideFunction; 130 std::ostream &output; 132 std::ostream & output; 131 133 LabelPrinter printLabels; 132 134 bool pretty = false; // pretty print 133 135 bool genC = false; // true if output has to be C code 134 136 bool lineMarks = false; 137 public: 138 LineEnder endl; 139 private: 135 140 136 141 CodeLocation currentLocation; 137 142 void updateLocation( CodeLocation const & to ); 138 void nextLine();139 143 140 144 void handleStorageClass( DeclarationWithType *decl ); … … 163 167 /// returns C-compatible name of declaration 164 168 std::string genName( DeclarationWithType * decl ); 169 170 inline std::ostream & operator<<( std::ostream & os, const CodeGenerator::LineEnder & endl ) { 171 return endl( os ); 172 } 165 173 } // namespace CodeGen 166 174
Note: See TracChangeset
for help on using the changeset viewer.