Changes in src/CodeGen/CodeGenerator.cc [3b0bc16:6cebfef]
- File:
-
- 1 edited
-
src/CodeGen/CodeGenerator.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r3b0bc16 r6cebfef 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 1 16:29:25 202213 // Update Count : 5 4012 // 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 } … … 1125 1125 } 1126 1126 1127 void CodeGenerator::postvisit( While DoStmt * whileDoStmt ) {1128 if ( while DoStmt->get_isDoWhile() ) {1127 void CodeGenerator::postvisit( WhileStmt * whileStmt ) { 1128 if ( whileStmt->get_isDoWhile() ) { 1129 1129 output << "do"; 1130 1130 } else { 1131 1131 output << "while ("; 1132 while DoStmt->get_condition()->accept( *visitor );1132 whileStmt->get_condition()->accept( *visitor ); 1133 1133 output << ")"; 1134 1134 } // if 1135 1135 output << " "; 1136 1136 1137 output << CodeGenerator::printLabels( while DoStmt->get_body()->get_labels() );1138 while DoStmt->get_body()->accept( *visitor );1137 output << CodeGenerator::printLabels( whileStmt->get_body()->get_labels() ); 1138 whileStmt->get_body()->accept( *visitor ); 1139 1139 1140 1140 output << indent; 1141 1141 1142 if ( while DoStmt->get_isDoWhile() ) {1142 if ( whileStmt->get_isDoWhile() ) { 1143 1143 output << " while ("; 1144 while DoStmt->get_condition()->accept( *visitor );1144 whileStmt->get_condition()->accept( *visitor ); 1145 1145 output << ");"; 1146 1146 } // if
Note:
See TracChangeset
for help on using the changeset viewer.