Changeset 4e8949f


Ignore:
Timestamp:
Sep 19, 2017, 1:18:57 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, resolv-new, with_gc
Children:
d48e529
Parents:
80ac42d
Message:

Handle ConstructorExpr? in CodeGenerator?

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r80ac42d r4e8949f  
    474474                                        } else {
    475475                                                // no constructors with 0 or more than 2 parameters
    476                                                 assert( false );
     476                                                assertf( ! genC, "UntypedExpr constructor/destructor with 0 or more than 2 parameters." );
     477                                                output << "(";
     478                                                (*arg++)->accept( *visitor );
     479                                                output << opInfo.symbol << "{ ";
     480                                                genCommaList( arg, untypedExpr->get_args().end() );
     481                                                output << "}) /* " << opInfo.inputName << " */";
    477482                                        } // if
    478483                                        break;
     
    785790                --indent;
    786791                output << indent << "})";
     792        }
     793
     794        void CodeGenerator::postvisit( ConstructorExpr * expr ) {
     795                assertf( ! genC, "Unique expressions should not reach code generation." );
     796                expr->callExpr->accept( *visitor );
    787797        }
    788798
  • src/CodeGen/CodeGenerator.h

    r80ac42d r4e8949f  
    8989                void postvisit( AsmExpr * );
    9090                void postvisit( StmtExpr * );
     91                void postvisit( ConstructorExpr * );
    9192
    9293                //*** Statements
  • src/CodeTools/TrackLoc.cc

    r80ac42d r4e8949f  
    6464                                }
    6565                                else {
    66                                         std::cerr << "Top level node has no CodeLocation " << name << std::endl;
    67                                         exit(EXIT_FAILURE);
     66                                        assertf( false, "Top level node has no CodeLocation %s", name.c_str() );
    6867                                }
    6968                        }
  • src/SymTab/Autogen.cc

    r80ac42d r4e8949f  
    223223                        FunctionType * ftype = data.genType( refType );
    224224
    225                         if(concurrent_type && CodeGen::isDestructor( data.fname )) {
     225                        if ( concurrent_type && CodeGen::isDestructor( data.fname ) ) {
    226226                                ftype->parameters.front()->get_type()->set_mutex( true );
    227227                        }
Note: See TracChangeset for help on using the changeset viewer.