Changeset 7ff30d07 for src/CodeGen
- Timestamp:
- Jun 14, 2016, 1:23:18 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, 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:
- 545ef59, c738ca4, ee51534
- Parents:
- 6cbc25a (diff), c8c03683 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/CodeGen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r6cbc25a r7ff30d07 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Fri May 06 16:01:00 201613 // Update Count : 25 511 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 9 13:21:00 2016 13 // Update Count : 256 14 14 // 15 15 … … 251 251 //*** Expressions 252 252 void CodeGenerator::visit( ApplicationExpr *applicationExpr ) { 253 extension( applicationExpr ); 253 254 if ( VariableExpr *varExpr = dynamic_cast< VariableExpr* >( applicationExpr->get_function() ) ) { 254 255 OperatorInfo opInfo; … … 366 367 367 368 void CodeGenerator::visit( UntypedExpr *untypedExpr ) { 369 extension( untypedExpr ); 368 370 if ( NameExpr *nameExpr = dynamic_cast< NameExpr* >( untypedExpr->get_function() ) ) { 369 371 OperatorInfo opInfo; … … 450 452 451 453 void CodeGenerator::visit( NameExpr *nameExpr ) { 454 extension( nameExpr ); 452 455 OperatorInfo opInfo; 453 456 if ( operatorLookup( nameExpr->get_name(), opInfo ) ) { … … 460 463 461 464 void CodeGenerator::visit( AddressExpr *addressExpr ) { 465 extension( addressExpr ); 462 466 output << "(&"; 463 467 // this hack makes sure that we don't convert "constant_zero" to "0" if we're taking its address … … 471 475 472 476 void CodeGenerator::visit( CastExpr *castExpr ) { 477 extension( castExpr ); 473 478 output << "("; 474 479 if ( castExpr->get_results().empty() ) { … … 493 498 494 499 void CodeGenerator::visit( MemberExpr *memberExpr ) { 500 extension( memberExpr ); 495 501 memberExpr->get_aggregate()->accept( *this ); 496 502 output << "." << mangleName( memberExpr->get_member() ); … … 498 504 499 505 void CodeGenerator::visit( VariableExpr *variableExpr ) { 506 extension( variableExpr ); 500 507 OperatorInfo opInfo; 501 508 if ( variableExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( variableExpr->get_var()->get_name(), opInfo ) && opInfo.type == OT_CONSTANT ) { … … 508 515 void CodeGenerator::visit( ConstantExpr *constantExpr ) { 509 516 assert( constantExpr->get_constant() ); 517 extension( constantExpr ); 510 518 constantExpr->get_constant()->accept( *this ); 511 519 } 512 520 513 521 void CodeGenerator::visit( SizeofExpr *sizeofExpr ) { 522 extension( sizeofExpr ); 514 523 output << "sizeof("; 515 524 if ( sizeofExpr->get_isType() ) { … … 522 531 523 532 void CodeGenerator::visit( AlignofExpr *alignofExpr ) { 533 extension( alignofExpr ); 524 534 // use GCC extension to avoid bumping std to C11 525 535 output << "__alignof__("; … … 537 547 538 548 void CodeGenerator::visit( OffsetofExpr *offsetofExpr ) { 549 extension( offsetofExpr ); 539 550 // use GCC builtin 540 551 output << "__builtin_offsetof("; … … 549 560 550 561 void CodeGenerator::visit( LogicalExpr *logicalExpr ) { 562 extension( logicalExpr ); 551 563 output << "("; 552 564 logicalExpr->get_arg1()->accept( *this ); … … 561 573 562 574 void CodeGenerator::visit( ConditionalExpr *conditionalExpr ) { 575 extension( conditionalExpr ); 563 576 output << "("; 564 577 conditionalExpr->get_arg1()->accept( *this ); … … 571 584 572 585 void CodeGenerator::visit( CommaExpr *commaExpr ) { 586 extension( commaExpr ); 573 587 output << "("; 574 588 commaExpr->get_arg1()->accept( *this ); … … 583 597 584 598 void CodeGenerator::visit( AsmExpr *asmExpr ) { 599 extension( asmExpr ); 585 600 if ( asmExpr->get_inout() ) { 586 601 output << "[ "; -
src/CodeGen/CodeGenerator.h
r6cbc25a r7ff30d07 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 17:32:24201613 // Update Count : 2 812 // Last Modified On : Thu Jun 9 13:15:58 2016 13 // Update Count : 29 14 14 // 15 15 … … 96 96 std::ostream& operator()(std::ostream & os); 97 97 }; 98 99 void extension( Expression *expr ) { 100 if ( expr->get_extension() ) { 101 output << "__extension__ "; 102 } // if 103 } // extension 98 104 private: 99 105
Note:
See TracChangeset
for help on using the changeset viewer.