Changeset 25a054f for src/CodeGen
- Timestamp:
- Jan 19, 2016, 4:46:04 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- e551c69
- Parents:
- 1194734
- Location:
- src/CodeGen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r1194734 r25a054f 443 443 } 444 444 445 void CodeGenerator::visit( AlignofExpr * sizeofExpr ) {445 void CodeGenerator::visit( AlignofExpr *alignofExpr ) { 446 446 // use GCC extension to avoid bumping std to C11 447 447 output << "__alignof__("; 448 if ( sizeofExpr->get_isType() ) { 449 output << genType( sizeofExpr->get_type(), "" ); 450 } else { 451 sizeofExpr->get_expr()->accept( *this ); 452 } // if 448 if ( alignofExpr->get_isType() ) { 449 output << genType( alignofExpr->get_type(), "" ); 450 } else { 451 alignofExpr->get_expr()->accept( *this ); 452 } // if 453 output << ")"; 454 } 455 456 void CodeGenerator::visit( OffsetofExpr *offsetofExpr ) { 457 // use GCC builtin 458 output << "__builtin_offsetof("; 459 output << genType( offsetofExpr->get_type(), "" ); 460 output << ", "; 461 offsetofExpr->get_member()->accept( *this ); 453 462 output << ")"; 454 463 } -
src/CodeGen/CodeGenerator.h
r1194734 r25a054f 61 61 virtual void visit( SizeofExpr *sizeofExpr ); 62 62 virtual void visit( AlignofExpr *alignofExpr ); 63 virtual void visit( OffsetofExpr *offsetofExpr ); 63 64 virtual void visit( LogicalExpr *logicalExpr ); 64 65 virtual void visit( ConditionalExpr *conditionalExpr );
Note: See TracChangeset
for help on using the changeset viewer.