Changeset d807ca28 for src/CodeGen
- Timestamp:
- May 25, 2018, 5:01:37 PM (6 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:
- 3ed994e
- Parents:
- 2c88368
- git-author:
- Rob Schluntz <rschlunt@…> (05/25/18 16:59:30)
- git-committer:
- Rob Schluntz <rschlunt@…> (05/25/18 17:01:37)
- Location:
- src/CodeGen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r2c88368 rd807ca28 826 826 expr->expr->accept( *visitor ); 827 827 } 828 829 void CodeGenerator::postvisit( GenericExpr * expr ) { 830 assertf( ! genC, "C11 _Generic expressions should not reach code generation." ); 831 output << "_Generic("; 832 expr->control->accept( *visitor ); 833 output << ", "; 834 unsigned int numAssocs = expr->associations.size(); 835 unsigned int i = 0; 836 for ( GenericExpr::Association & assoc : expr->associations ) { 837 if (assoc.isDefault) { 838 output << "default: "; 839 } else { 840 output << genType( assoc.type, "", pretty, genC ) << ": "; 841 } 842 assoc.expr->accept( *visitor ); 843 if ( i+1 != numAssocs ) { 844 output << ", "; 845 } 846 i++; 847 } 848 output << ")"; 849 } 850 828 851 829 852 // *** Statements -
src/CodeGen/CodeGenerator.h
r2c88368 rd807ca28 94 94 void postvisit( ConstructorExpr * ); 95 95 void postvisit( DeletedExpr * ); 96 void postvisit( GenericExpr * ); 96 97 97 98 //*** Statements
Note: See TracChangeset
for help on using the changeset viewer.