Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/MakeLibCfa.cc

    re4d829b r845cedc  
    7575                  case CodeGen::OT_POSTFIXASSIGN:
    7676                  case CodeGen::OT_INFIXASSIGN:
    77                   case CodeGen::OT_CTOR:
    78                   case CodeGen::OT_DTOR:
    7977                                funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( std::list< Label >(), newExpr ) );
    8078                                break;
     79                  case CodeGen::OT_CTOR:
     80                        // ctors don't return a value
     81                        if ( funcDecl->get_functionType()->get_parameters().size() == 1 ) {
     82                                // intrinsic default constructors should do nothing
     83                                // delete newExpr;
     84                                break;
     85                        } else {
     86                                assert( funcDecl->get_functionType()->get_parameters().size() == 2 );
     87                                // anything else is a single parameter constructor that is effectively a C-style assignment
     88                                // delete newExpr->get_function();
     89                                assert(newExpr->get_args().size()==2);
     90                                newExpr->set_function( new NameExpr( "?=?" ) );
     91                                funcDecl->get_statements()->get_kids().push_back( new ExprStmt( std::list< Label >(), newExpr ) );
     92                        }
     93                        break;
     94                  case CodeGen::OT_DTOR:
     95                        // intrinsic destructors should do nothing
     96                        // delete newExpr;
     97                        break;
    8198                  case CodeGen::OT_CONSTANT:
    8299                  case CodeGen::OT_LABELADDRESS:
     
    92109                assert( ! objDecl->get_init() );
    93110                std::list< Expression* > noDesignators;
    94                 objDecl->set_init( new SingleInit( new NameExpr( objDecl->get_name() ), false ) ); // cannot be constructed
     111                objDecl->set_init( new SingleInit( new NameExpr( objDecl->get_name() ), noDesignators, false ) ); // cannot be constructed
    95112                newDecls.push_back( objDecl );
    96113        }
Note: See TracChangeset for help on using the changeset viewer.