Changeset 3778cb2
- Timestamp:
- Jul 30, 2016, 3:28:40 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 057b34f
- Parents:
- ac911f4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
rac911f4 r3778cb2 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 30 1 1:27:07201613 // Update Count : 34 012 // Last Modified On : Sat Jul 30 14:59:34 2016 13 // Update Count : 341 14 14 // 15 15 … … 155 155 objectDecl->get_init()->accept( *this ); 156 156 } // if 157 157 158 if ( objectDecl->get_bitfieldWidth() ) { 158 159 output << ":"; … … 172 173 173 174 cur_indent += CodeGenerator::tabsize; 174 for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end(); i++) {175 for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end(); i++ ) { 175 176 output << indent; 176 177 (*i)->accept( *this ); 177 178 output << ";" << endl; 178 } 179 } // for 179 180 180 181 cur_indent -= CodeGenerator::tabsize; … … 257 258 (*iter)->accept( *this ); 258 259 output << "]"; 259 } 260 } 260 } // if 261 } // for 261 262 output << " = "; 262 263 } … … 317 318 // do nothing 318 319 ; 319 } 320 } // switch 320 321 321 322 switch ( opInfo.type ) { … … 385 386 // there are no intrinsic definitions of 0/1 or label addresses as functions 386 387 assert( false ); 387 } 388 } // switch 388 389 } else { 389 390 varExpr->accept( *this ); … … 437 438 // no constructors with 0 or more than 2 parameters 438 439 assert( false ); 439 } 440 } // if 440 441 break; 441 442 … … 470 471 // there are no intrinsic definitions of 0 or 1 as functions 471 472 assert( false ); 472 } 473 } // switch 473 474 } else { 474 if ( nameExpr->get_name() != "Range" ) { 475 // builtin routines 475 if ( nameExpr->get_name() != "Range" ) { // builtin routines 476 476 nameExpr->accept( *this ); 477 477 output << "("; 478 478 genCommaList( untypedExpr->get_args().begin(), untypedExpr->get_args().end() ); 479 479 output << ")"; 480 } else { 481 // case V1 ... V2 or case V1~V2 480 } else { // case V1 ... V2 or case V1~V2 482 481 assert( untypedExpr->get_args().size() == 2 ); 483 482 (*untypedExpr->get_args().begin())->accept( *this ); … … 530 529 // otherwise, the cast is to an lvalue type, so the cast should be dropped, since the result of a cast is 531 530 // never an lvalue in C 532 } 531 } // if 533 532 castExpr->get_arg()->accept( *this ); 534 533 output << ")"; … … 663 662 if ( wantSpacing( *i ) ) { 664 663 output << endl; 665 } 664 } // if 666 665 } 667 666 cur_indent -= CodeGenerator::tabsize; … … 746 745 (*i)->accept( *this ); 747 746 output << endl; 748 } 747 } // for 749 748 cur_indent -= CodeGenerator::tabsize; 750 749 } … … 768 767 output << "continue"; 769 768 break; 770 } 769 } // switch 771 770 output << ";"; 772 771 } … … 807 806 if ( forStmt->get_condition() != 0 ) { 808 807 forStmt->get_condition()->accept( *this ); 809 } 808 } // if 810 809 output << ";"; 811 810 … … 814 813 Expression * expr = new CastExpr( forStmt->get_increment() ); 815 814 expr->accept( *this ); 816 } 815 } // if 817 816 output << ") "; 818 817
Note: See TracChangeset
for help on using the changeset viewer.