Changeset 321a2481 for src/CodeGen/CodeGenerator.cc
- Timestamp:
- Jun 6, 2016, 1:11:34 PM (6 years ago)
- Branches:
- aaron-thesis, arm-eh, 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, resolv-new, with_gc
- Children:
- 64071c2
- Parents:
- b8387fc
- git-author:
- Rob Schluntz <rschlunt@…> (06/06/16 13:08:28)
- git-committer:
- Rob Schluntz <rschlunt@…> (06/06/16 13:11:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
rb8387fc r321a2481 638 638 639 639 void CodeGenerator::visit( ExprStmt *exprStmt ) { 640 // I don't see why this check is necessary.641 // If this starts to cause problems then put it back in,642 // with an explanation643 640 assert( exprStmt ); 644 645 // if ( exprStmt != 0 ) { 646 exprStmt->get_expr()->accept( *this ); 647 output << ";" ; 648 // } // if 641 // cast the top-level expression to void to reduce gcc warnings. 642 Expression * expr = new CastExpr( exprStmt->get_expr() ); 643 expr->accept( *this ); 644 output << ";"; 649 645 } 650 646 … … 755 751 756 752 void CodeGenerator::visit( WhileStmt *whileStmt ) { 757 if ( whileStmt->get_isDoWhile() ) 753 if ( whileStmt->get_isDoWhile() ) { 758 754 output << "do" ; 759 else {755 } else { 760 756 output << "while (" ; 761 757 whileStmt->get_condition()->accept( *this ); … … 781 777 output << "for (;"; 782 778 783 if ( forStmt->get_condition() != 0 ) 779 if ( forStmt->get_condition() != 0 ) { 784 780 forStmt->get_condition()->accept( *this ); 781 } 785 782 output << ";"; 786 783 787 if ( forStmt->get_increment() != 0 ) 788 forStmt->get_increment()->accept( *this ); 784 if ( forStmt->get_increment() != 0 ) { 785 // cast the top-level expression to void to reduce gcc warnings. 786 Expression * expr = new CastExpr( forStmt->get_increment() ); 787 expr->accept( *this ); 788 } 789 789 output << ") "; 790 790
Note: See TracChangeset
for help on using the changeset viewer.