Changeset f975c65


Ignore:
Timestamp:
May 11, 2017, 2:02:22 PM (8 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:
9923861
Parents:
ad1770be
Message:

intermediate codegen for tuple indexing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    rad1770be rf975c65  
    709709        void CodeGenerator::visit( UntypedTupleExpr * tupleExpr ) {
    710710                assertf( ! genC, "UntypedTupleExpr should not reach code generation." );
     711                extension( tupleExpr );
    711712                output << "[";
    712713                genCommaList( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end() );
     
    716717        void CodeGenerator::visit( TupleExpr * tupleExpr ) {
    717718                assertf( ! genC, "TupleExpr should not reach code generation." );
     719                extension( tupleExpr );
    718720                output << "[";
    719721                genCommaList( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end() );
    720722                output << "]";
     723        }
     724
     725        void CodeGenerator::visit( TupleIndexExpr * tupleExpr ) {
     726                assertf( ! genC, "TupleIndexExpr should not reach code generation." );
     727                extension( tupleExpr );
     728                tupleExpr->get_tuple()->accept( *this );
     729                output << "." << tupleExpr->get_index();
    721730        }
    722731
Note: See TracChangeset for help on using the changeset viewer.