Changeset 3b0bc16 for src/CodeGen
- Timestamp:
- Feb 1, 2022, 8:22:12 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- fde0a58
- Parents:
- 729c991
- Location:
- src/CodeGen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r729c991 r3b0bc16 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 12 19:00:42 202113 // Update Count : 5 3612 // Last Modified On : Tue Feb 1 16:29:25 2022 13 // Update Count : 540 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 Stmt * >( stmt ) || dynamic_cast< ForStmt * >( stmt ) || dynamic_cast< SwitchStmt *>( stmt );44 dynamic_cast< WhileDoStmt * >( stmt ) || dynamic_cast< ForStmt * >( stmt ) || dynamic_cast< SwitchStmt *>( stmt ); 45 45 } 46 46 … … 955 955 output << " ) "; 956 956 957 ifStmt->get_then Part()->accept( *visitor );958 959 if ( ifStmt->get_else Part() != 0) {957 ifStmt->get_then()->accept( *visitor ); 958 959 if ( ifStmt->get_else() != 0) { 960 960 output << " else "; 961 ifStmt->get_else Part()->accept( *visitor );961 ifStmt->get_else()->accept( *visitor ); 962 962 } // if 963 963 } … … 1125 1125 } 1126 1126 1127 void CodeGenerator::postvisit( While Stmt * whileStmt ) {1128 if ( while Stmt->get_isDoWhile() ) {1127 void CodeGenerator::postvisit( WhileDoStmt * whileDoStmt ) { 1128 if ( whileDoStmt->get_isDoWhile() ) { 1129 1129 output << "do"; 1130 1130 } else { 1131 1131 output << "while ("; 1132 while Stmt->get_condition()->accept( *visitor );1132 whileDoStmt->get_condition()->accept( *visitor ); 1133 1133 output << ")"; 1134 1134 } // if 1135 1135 output << " "; 1136 1136 1137 output << CodeGenerator::printLabels( while Stmt->get_body()->get_labels() );1138 while Stmt->get_body()->accept( *visitor );1137 output << CodeGenerator::printLabels( whileDoStmt->get_body()->get_labels() ); 1138 whileDoStmt->get_body()->accept( *visitor ); 1139 1139 1140 1140 output << indent; 1141 1141 1142 if ( while Stmt->get_isDoWhile() ) {1142 if ( whileDoStmt->get_isDoWhile() ) { 1143 1143 output << " while ("; 1144 while Stmt->get_condition()->accept( *visitor );1144 whileDoStmt->get_condition()->accept( *visitor ); 1145 1145 output << ");"; 1146 1146 } // if -
src/CodeGen/CodeGenerator.h
r729c991 r3b0bc16 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 12 18:35:38 202113 // Update Count : 6 312 // Last Modified On : Tue Feb 1 09:23:21 2022 13 // Update Count : 64 14 14 // 15 15 … … 116 116 void postvisit( WaitForStmt * ); 117 117 void postvisit( WithStmt * ); 118 void postvisit( While Stmt * );118 void postvisit( WhileDoStmt * ); 119 119 void postvisit( ForStmt * ); 120 120 void postvisit( NullStmt * );
Note:
See TracChangeset
for help on using the changeset viewer.