Changeset e48aca8
- Timestamp:
- Mar 14, 2025, 10:42:12 AM (6 months ago)
- Branches:
- master
- Children:
- a21aaff
- Parents:
- 6f9f338
- Location:
- src/CodeGen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cpp
r6f9f338 re48aca8 790 790 } 791 791 792 void CodeGenerator::postvisit( ast::CountofExpr const * expr ) { 793 assertf( !options.genC, "CountofExpr should not reach code generation." ); 794 extension( expr ); 795 output << "countof("; 796 if ( auto type = expr->type.as<ast::TypeofType>() ) { 797 type->expr->accept( *visitor ); 798 } else { 799 output << genType( expr->type, "", options ); 800 } 801 output << ")"; 802 } 803 792 804 void CodeGenerator::postvisit( ast::UntypedOffsetofExpr const * expr ) { 793 805 assertf( !options.genC, "UntypedOffsetofExpr should not reach code generation." ); -
src/CodeGen/CodeGenerator.hpp
r6f9f338 re48aca8 42 42 void previsit( ast::Expr const * ); 43 43 44 void postvisit( ast::StructDecl const * );45 44 void postvisit( ast::FunctionDecl const * ); 46 45 // Yes, there is one visit that does modify the ast. 47 46 ast::ObjectDecl const * postvisit( ast::ObjectDecl const * ); 47 void postvisit( ast::StructDecl const * ); 48 48 void postvisit( ast::UnionDecl const * ); 49 49 void postvisit( ast::EnumDecl const * ); … … 73 73 void postvisit( ast::SizeofExpr const * ); 74 74 void postvisit( ast::AlignofExpr const * ); 75 void postvisit( ast::CountofExpr const * ); 75 76 void postvisit( ast::UntypedOffsetofExpr const * ); 76 77 void postvisit( ast::OffsetofExpr const * );
Note:
See TracChangeset
for help on using the changeset viewer.