Changeset a0c7dc36 for src/CodeGen
- Timestamp:
- Sep 12, 2017, 5:14:32 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:
- 70d826cd
- Parents:
- 96f9ef5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r96f9ef5 ra0c7dc36 258 258 259 259 void CodeGenerator::visit( TraitDecl * traitDecl ) { 260 assertf( ! genC, "TraitDecl nodes should not reach code generation." );260 assertf( ! genC, "TraitDecls should not reach code generation." ); 261 261 extension( traitDecl ); 262 262 handleAggregate( traitDecl, "trait " ); … … 271 271 272 272 void CodeGenerator::visit( TypeDecl * typeDecl ) { 273 if ( genC ) { 274 // really, we should mutate this into something that isn't a TypeDecl but that requires large-scale changes, 275 // still to be done 276 extension( typeDecl ); 277 output << "extern unsigned long " << typeDecl->get_name(); 278 if ( typeDecl->get_base() ) { 279 output << " = sizeof( " << genType( typeDecl->get_base(), "", pretty, genC ) << " )"; 280 } // if 281 } else { 282 output << typeDecl->genTypeString() << " " << typeDecl->get_name(); 283 if ( typeDecl->get_kind() != TypeDecl::Any && typeDecl->get_sized() ) { 284 output << " | sized(" << typeDecl->get_name() << ")"; 285 } 286 if ( ! typeDecl->get_assertions().empty() ) { 287 output << " | { "; 288 genCommaList( typeDecl->get_assertions().begin(), typeDecl->get_assertions().end() ); 289 output << " }"; 290 } 273 assertf( ! genC, "TypeDecls should not reach code generation." ); 274 output << typeDecl->genTypeString() << " " << typeDecl->get_name(); 275 if ( typeDecl->get_kind() != TypeDecl::Any && typeDecl->get_sized() ) { 276 output << " | sized(" << typeDecl->get_name() << ")"; 277 } 278 if ( ! typeDecl->get_assertions().empty() ) { 279 output << " | { "; 280 genCommaList( typeDecl->get_assertions().begin(), typeDecl->get_assertions().end() ); 281 output << " }"; 291 282 } 292 283 }
Note: See TracChangeset
for help on using the changeset viewer.