Changeset d104b02
- Timestamp:
- Aug 22, 2017, 5:38:49 PM (7 years ago)
- 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:
- 5ccb10d
- Parents:
- 9f10c4b8
- git-author:
- Rob Schluntz <rschlunt@…> (08/22/17 17:38:35)
- git-committer:
- Rob Schluntz <rschlunt@…> (08/22/17 17:38:49)
- Location:
- src/CodeGen
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r9f10c4b8 rd104b02 547 547 if ( castExpr->get_result()->isVoid() ) { 548 548 output << "(void)" ; 549 } else if ( ! castExpr->get_result()->get_lvalue() ) { 550 // at least one result type of cast, but not an lvalue 549 } else { 550 // at least one result type of cast. 551 // Note: previously, lvalue casts were skipped. Since it's now impossible for the user to write 552 // an lvalue cast, this has been taken out. 551 553 output << "("; 552 554 output << genType( castExpr->get_result(), "", pretty, genC ); 553 555 output << ")"; 554 } else {555 // otherwise, the cast is to an lvalue type, so the cast should be dropped, since the result of a cast is556 // never an lvalue in C557 556 } // if 558 557 castExpr->get_arg()->accept( *this ); … … 679 678 } 680 679 680 void CodeGenerator::visit( TupleAssignExpr * tupleExpr ) { 681 assertf( ! genC, "TupleAssignExpr should not reach code generation." ); 682 tupleExpr->stmtExpr->accept( *this ); 683 } 684 681 685 void CodeGenerator::visit( UntypedTupleExpr * tupleExpr ) { 682 686 assertf( ! genC, "UntypedTupleExpr should not reach code generation." ); … … 726 730 output << "(" << genType( compLitExpr->get_result(), "", pretty, genC ) << ")"; 727 731 compLitExpr->get_initializer()->accept( *this ); 732 } 733 734 void CodeGenerator::visit( UniqueExpr * unqExpr ) { 735 assertf( ! genC, "Unique expressions should not reach code generation." ); 736 output << "unq<" << unqExpr->get_id() << ">{ "; 737 unqExpr->get_expr()->accept( *this ); 738 output << " }"; 728 739 } 729 740 -
src/CodeGen/CodeGenerator.h
r9f10c4b8 rd104b02 77 77 virtual void visit( CommaExpr *commaExpr ); 78 78 virtual void visit( CompoundLiteralExpr *compLitExpr ); 79 virtual void visit( UniqueExpr * ); 80 virtual void visit( TupleAssignExpr * tupleExpr ); 79 81 virtual void visit( UntypedTupleExpr *tupleExpr ); 80 82 virtual void visit( TupleExpr *tupleExpr ); -
src/CodeGen/GenType.cc
r9f10c4b8 rd104b02 287 287 typeString = "_Atomic " + typeString; 288 288 } // if 289 if ( type->get_lvalue() && ! genC ) { 290 // when not generating C code, print lvalue for debugging. 291 typeString = "lvalue " + typeString; 292 } 289 293 } 290 294 } // namespace CodeGen
Note: See TracChangeset
for help on using the changeset viewer.