Changeset 8a6cf7e for src/CodeGen
- Timestamp:
- Jul 26, 2017, 4:26:08 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:
- 2afec66
- Parents:
- d335627
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
rd335627 r8a6cf7e 661 661 extension( commaExpr ); 662 662 output << "("; 663 if ( genC ) { 664 // arg1 of a CommaExpr is never used, so it can be safely cast to void to reduce gcc warnings. 665 commaExpr->set_arg1( new CastExpr( commaExpr->get_arg1() ) ); 666 } 663 667 commaExpr->get_arg1()->accept( *this ); 664 668 output << " , "; … … 724 728 for ( Statement * stmt : stmts ) { 725 729 output << lineDirective( stmt ) << indent; 726 730 output << printLabels( stmt->get_labels() ); 727 731 if ( i+1 == numStmts ) { 728 732 // last statement in a statement expression needs to be handled specially - … … 769 773 void CodeGenerator::visit( ExprStmt * exprStmt ) { 770 774 assert( exprStmt ); 771 Expression * expr = exprStmt->get_expr();772 775 if ( genC ) { 773 776 // cast the top-level expression to void to reduce gcc warnings. 774 expr = new CastExpr( expr);775 } 776 expr ->accept( *this );777 exprStmt->set_expr( new CastExpr( exprStmt->get_expr() ) ); 778 } 779 exprStmt->get_expr()->accept( *this ); 777 780 output << ";"; 778 781 }
Note: See TracChangeset
for help on using the changeset viewer.