Changeset d7312ac for src/CodeGen
- Timestamp:
- May 5, 2018, 9:33:28 AM (6 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, with_gc
- Children:
- 7867eb9
- Parents:
- 43c461d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r43c461d rd7312ac 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Sep 3 20:42:52 201713 // Update Count : 49 012 // Last Modified On : Sat May 5 09:08:32 2018 13 // Update Count : 494 14 14 // 15 15 #include "CodeGenerator.h" … … 370 370 371 371 void CodeGenerator::postvisit( Constant * constant ) { 372 output << constant->get_value() 372 output << constant->get_value(); 373 373 } 374 374 … … 587 587 output << "("; 588 588 if ( castExpr->get_result()->isVoid() ) { 589 output << "(void)" 589 output << "(void)"; 590 590 } else { 591 591 // at least one result type of cast. … … 878 878 } // for 879 879 } // if 880 output << " );" 880 output << " );"; 881 881 } 882 882 … … 886 886 output << "( "; 887 887 if ( asmStmt->get_instruction() ) asmStmt->get_instruction()->accept( *visitor ); 888 output << " )" 888 output << " )"; 889 889 } 890 890 891 891 void CodeGenerator::postvisit( DirectiveStmt * dirStmt ) { 892 output << dirStmt->directive;892 output << endl << dirStmt->directive; // endl prevents spaces before directive 893 893 } 894 894 … … 907 907 908 908 void CodeGenerator::postvisit( SwitchStmt * switchStmt ) { 909 output << "switch ( " 909 output << "switch ( "; 910 910 switchStmt->get_condition()->accept( *visitor ); 911 911 output << " ) "; … … 933 933 ++indent; 934 934 for ( std::list<Statement *>::iterator i = sts.begin(); i != sts.end(); i++) { 935 output << indent << printLabels( (*i)->get_labels() ) 935 output << indent << printLabels( (*i)->get_labels() ) ; 936 936 (*i)->accept( *visitor ); 937 937 output << endl; … … 1070 1070 void CodeGenerator::postvisit( WhileStmt * whileStmt ) { 1071 1071 if ( whileStmt->get_isDoWhile() ) { 1072 output << "do" 1073 } else { 1074 output << "while (" 1072 output << "do"; 1073 } else { 1074 output << "while ("; 1075 1075 whileStmt->get_condition()->accept( *visitor ); 1076 1076 output << ")"; … … 1084 1084 1085 1085 if ( whileStmt->get_isDoWhile() ) { 1086 output << " while (" 1086 output << " while ("; 1087 1087 whileStmt->get_condition()->accept( *visitor ); 1088 1088 output << ");";
Note: See TracChangeset
for help on using the changeset viewer.