Changes in src/CodeGen/CodeGenerator.cc [6180274:6cebfef]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r6180274 r6cebfef 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 2 20:30:30 202213 // Update Count : 5 4112 // Last Modified On : Fri Mar 12 19:00:42 2021 13 // Update Count : 536 14 14 // 15 15 #include "CodeGenerator.h" … … 42 42 bool wantSpacing( Statement * stmt) { 43 43 return dynamic_cast< IfStmt * >( stmt ) || dynamic_cast< CompoundStmt * >( stmt ) || 44 dynamic_cast< While DoStmt * >( stmt ) || dynamic_cast< ForStmt * >( stmt ) || dynamic_cast< SwitchStmt *>( stmt );44 dynamic_cast< WhileStmt * >( stmt ) || dynamic_cast< ForStmt * >( stmt ) || dynamic_cast< SwitchStmt *>( stmt ); 45 45 } 46 46 … … 955 955 output << " ) "; 956 956 957 ifStmt->get_then ()->accept( *visitor );958 959 if ( ifStmt->get_else () != 0) {957 ifStmt->get_thenPart()->accept( *visitor ); 958 959 if ( ifStmt->get_elsePart() != 0) { 960 960 output << " else "; 961 ifStmt->get_else ()->accept( *visitor );961 ifStmt->get_elsePart()->accept( *visitor ); 962 962 } // if 963 963 } … … 1020 1020 output << "fallthru"; 1021 1021 break; 1022 default: ; // prevent warning1023 1022 } // switch 1024 1023 // print branch target for labelled break/continue/fallthru in debug mode … … 1126 1125 } 1127 1126 1128 void CodeGenerator::postvisit( While DoStmt * whileDoStmt ) {1129 if ( while DoStmt->get_isDoWhile() ) {1127 void CodeGenerator::postvisit( WhileStmt * whileStmt ) { 1128 if ( whileStmt->get_isDoWhile() ) { 1130 1129 output << "do"; 1131 1130 } else { 1132 1131 output << "while ("; 1133 while DoStmt->get_condition()->accept( *visitor );1132 whileStmt->get_condition()->accept( *visitor ); 1134 1133 output << ")"; 1135 1134 } // if 1136 1135 output << " "; 1137 1136 1138 output << CodeGenerator::printLabels( while DoStmt->get_body()->get_labels() );1139 while DoStmt->get_body()->accept( *visitor );1137 output << CodeGenerator::printLabels( whileStmt->get_body()->get_labels() ); 1138 whileStmt->get_body()->accept( *visitor ); 1140 1139 1141 1140 output << indent; 1142 1141 1143 if ( while DoStmt->get_isDoWhile() ) {1142 if ( whileStmt->get_isDoWhile() ) { 1144 1143 output << " while ("; 1145 while DoStmt->get_condition()->accept( *visitor );1144 whileStmt->get_condition()->accept( *visitor ); 1146 1145 output << ");"; 1147 1146 } // if
Note:
See TracChangeset
for help on using the changeset viewer.