Changeset 579263a for src/CodeGen
- Timestamp:
- Jun 26, 2017, 4:48:35 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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:
- bb1cd95
- Parents:
- e4d829b (diff), 2a7b3ca (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. - Location:
- src/CodeGen
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
re4d829b r579263a 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed May 10 14:45:00 201713 // Update Count : 48 412 // Last Modified On : Thu Jun 8 16:00:00 2017 13 // Update Count : 485 14 14 // 15 15 … … 112 112 113 113 CodeGenerator::CodeGenerator( std::ostream & os, bool pretty, bool genC, bool lineMarks ) : indent( *this), cur_indent( 0 ), insideFunction( false ), output( os ), printLabels( *this ), pretty( pretty ), genC( genC ), lineMarks( lineMarks ) {} 114 115 CodeGenerator::CodeGenerator( std::ostream & os, std::string init, int indentation, bool infunp )116 : indent( *this), cur_indent( indentation ), insideFunction( infunp ), output( os ), printLabels( *this ) {117 //output << std::string( init );118 }119 120 CodeGenerator::CodeGenerator( std::ostream & os, char * init, int indentation, bool infunp )121 : indent( *this ), cur_indent( indentation ), insideFunction( infunp ), output( os ), printLabels( *this ) {122 //output << std::string( init );123 }124 114 125 115 string CodeGenerator::mangleName( DeclarationWithType * decl ) { … … 932 922 } 933 923 924 void CodeGenerator::visit( ThrowStmt * throwStmt ) { 925 assertf( ! genC, "Throw statements should not reach code generation." ); 926 927 output << ((throwStmt->get_kind() == ThrowStmt::Terminate) ? 928 "throw" : "throwResume"); 929 if (throwStmt->get_expr()) { 930 output << " "; 931 throwStmt->get_expr()->accept( *this ); 932 } 933 if (throwStmt->get_target()) { 934 output << " _At "; 935 throwStmt->get_target()->accept( *this ); 936 } 937 output << ";"; 938 } 939 934 940 void CodeGenerator::visit( WhileStmt * whileStmt ) { 935 941 if ( whileStmt->get_isDoWhile() ) { -
src/CodeGen/CodeGenerator.h
re4d829b r579263a 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed May 10 10:57:00 201713 // Update Count : 5 112 // Last Modified On : Thu Jun 8 15:48:00 2017 13 // Update Count : 52 14 14 // 15 15 … … 92 92 virtual void visit( BranchStmt * ); 93 93 virtual void visit( ReturnStmt * ); 94 virtual void visit( ThrowStmt * ); 94 95 virtual void visit( WhileStmt * ); 95 96 virtual void visit( ForStmt * ); -
src/CodeGen/FixNames.cc
re4d829b r579263a 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 16 07:50:30201713 // Update Count : 1 612 // Last Modified On : Wed Jun 21 14:22:59 2017 13 // Update Count : 19 14 14 // 15 15 … … 114 114 throw SemanticError("Main expected to have 0, 2 or 3 arguments\n", functionDecl); 115 115 } 116 functionDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new ConstantExpr( Constant ( new BasicType( Type::Qualifiers(), BasicType::SignedInt ), "0") ) ) );116 functionDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new ConstantExpr( Constant::from_int( 0 ) ) ) ); 117 117 CodeGen::FixMain::registerMain( functionDecl ); 118 118 }
Note: See TracChangeset
for help on using the changeset viewer.