Changeset da9d79b
- Timestamp:
- Apr 19, 2018, 5:20:00 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, with_gc
- Children:
- b03eed6
- Parents:
- 9a705dc8
- Location:
- src/CodeGen
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r9a705dc8 rda9d79b 596 596 output << ")"; 597 597 } // if 598 castExpr->get_arg()->accept( *visitor ); 598 castExpr->arg->accept( *visitor ); 599 output << ")"; 600 } 601 602 void CodeGenerator::postvisit( KeywordCastExpr * castExpr ) { 603 assertf( ! genC, "KeywordCast should not reach code generation." ); 604 extension( castExpr ); 605 output << "((" << castExpr->targetString() << " &)"; 606 castExpr->arg->accept( *visitor ); 599 607 output << ")"; 600 608 } -
src/CodeGen/CodeGenerator.h
r9a705dc8 rda9d79b 69 69 void postvisit( LabelAddressExpr *addressExpr ); 70 70 void postvisit( CastExpr *castExpr ); 71 void postvisit( KeywordCastExpr * castExpr ); 71 72 void postvisit( VirtualCastExpr *castExpr ); 72 73 void postvisit( UntypedMemberExpr *memberExpr ); -
src/CodeGen/GenType.cc
r9a705dc8 rda9d79b 48 48 void postvisit( ZeroType * zeroType ); 49 49 void postvisit( OneType * oneType ); 50 void postvisit( TraitInstType * inst ); 51 void postvisit( TypeofType * typeof ); 50 52 51 53 private: … … 289 291 } 290 292 293 void GenType::postvisit( TraitInstType * inst ) { 294 assertf( ! genC, "Trait types should not reach code generation." ); 295 typeString = inst->name + " " + typeString; 296 handleQualifiers( inst ); 297 } 298 299 void GenType::postvisit( TypeofType * typeof ) { 300 std::ostringstream os; 301 PassVisitor<CodeGenerator> cg( os, pretty, genC, lineMarks ); 302 os << "typeof("; 303 typeof->expr->accept( cg ); 304 os << ") " << typeString; 305 typeString = os.str(); 306 handleQualifiers( typeof ); 307 } 308 291 309 void GenType::handleQualifiers( Type * type ) { 292 310 if ( type->get_const() ) {
Note: See TracChangeset
for help on using the changeset viewer.