Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r1840193 rf32c7f4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Sep 17 15:25:58 2015
    13 // Update Count     : 233
     12// Last Modified On : Wed Aug 12 14:33:52 2015
     13// Update Count     : 222
    1414//
    1515
     
    190190                if ( designators.size() == 0 ) return;
    191191                for ( DesignatorList::iterator iter = designators.begin(); iter != designators.end(); ++iter ) {
    192                         if ( dynamic_cast< NameExpr * >( *iter ) ) {
     192                        if ( NameExpr * nm = dynamic_cast< NameExpr * >( *iter ) ) {
    193193                                // if expression is a name, then initializing aggregate member
    194194                                output << ".";
     
    258258             
    259259                                  case OT_CALL:
    260                                   case OT_CTOR:
    261                                   case OT_DTOR:
    262                                         // there are no intrinsic definitions of the function call operator or constructors or destructors
     260                                        // there are no intrinsic definitions of the function call operator
    263261                                        assert( false );
    264262                                        break;
     
    324322             
    325323                                  case OT_CALL:
    326                                         case OT_CTOR:
    327                                         case OT_DTOR:
    328324                                        assert( false );
    329325                                        break;
     
    396392
    397393        void CodeGenerator::visit( CastExpr *castExpr ) {
    398                 // if the cast is to an lvalue type, then the cast
    399                 // should be dropped, since the result of a cast is
    400                 // never an lvalue in C
    401                 if ( castExpr->get_results().front()->get_isLvalue() ) {
    402                         castExpr->get_arg()->accept( *this );
    403                 } else {
    404                         output << "((";
    405                         if ( castExpr->get_results().empty() ) {
    406                                 output << "void" ;
    407                         } else {
    408                                 output << genType( castExpr->get_results().front(), "" );
    409                         } // if
    410                         output << ")";
    411                         castExpr->get_arg()->accept( *this );
    412                         output << ")";                 
    413                 }
     394                output << "((";
     395                if ( castExpr->get_results().empty() ) {
     396                        output << "void" ;
     397                } else {
     398                        output << genType( castExpr->get_results().front(), "" );
     399                } // if
     400                output << ")";
     401                castExpr->get_arg()->accept( *this );
     402                output << ")";
    414403        }
    415404 
Note: See TracChangeset for help on using the changeset viewer.