Changeset 982832e for src/CodeGen/CodeGenerator.cc
- Timestamp:
- Sep 13, 2017, 2:44:01 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:
- ba54f7d, c935c3a
- Parents:
- e3e16bc (diff), 7dc09294 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
re3e16bc r982832e 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.