Changeset d63eeb0 for src/CodeGen
- Timestamp:
- Feb 9, 2016, 3:25:05 PM (9 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, with_gc
- Children:
- 7528ba1
- Parents:
- 771b3c3 (diff), bd85400 (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. - Location:
- src/CodeGen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r771b3c3 rd63eeb0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Jan 20 12:59:17201613 // Update Count : 25 412 // Last Modified On : Tue Feb 09 13:24:40 2016 13 // Update Count : 255 14 14 // 15 15 … … 26 26 #include "SynTree/Statement.h" 27 27 28 #include " utility.h"29 #include " UnimplementedError.h"28 #include "Common/utility.h" 29 #include "Common/UnimplementedError.h" 30 30 31 31 #include "CodeGenerator.h" … … 458 458 } 459 459 460 void CodeGenerator::visit( AlignofExpr * sizeofExpr ) {460 void CodeGenerator::visit( AlignofExpr *alignofExpr ) { 461 461 // use GCC extension to avoid bumping std to C11 462 462 output << "__alignof__("; 463 if ( sizeofExpr->get_isType() ) { 464 output << genType( sizeofExpr->get_type(), "" ); 465 } else { 466 sizeofExpr->get_expr()->accept( *this ); 467 } // if 463 if ( alignofExpr->get_isType() ) { 464 output << genType( alignofExpr->get_type(), "" ); 465 } else { 466 alignofExpr->get_expr()->accept( *this ); 467 } // if 468 output << ")"; 469 } 470 471 void CodeGenerator::visit( UntypedOffsetofExpr *offsetofExpr ) { 472 assert( false ); 473 } 474 475 void CodeGenerator::visit( OffsetofExpr *offsetofExpr ) { 476 // use GCC builtin 477 output << "__builtin_offsetof("; 478 output << genType( offsetofExpr->get_type(), "" ); 479 output << ", " << mangleName( offsetofExpr->get_member() ); 468 480 output << ")"; 469 481 } -
src/CodeGen/CodeGenerator.h
r771b3c3 rd63eeb0 61 61 virtual void visit( SizeofExpr *sizeofExpr ); 62 62 virtual void visit( AlignofExpr *alignofExpr ); 63 virtual void visit( UntypedOffsetofExpr *offsetofExpr ); 64 virtual void visit( OffsetofExpr *offsetofExpr ); 63 65 virtual void visit( LogicalExpr *logicalExpr ); 64 66 virtual void visit( ConditionalExpr *conditionalExpr );
Note: See TracChangeset
for help on using the changeset viewer.