Changeset 3c4003b9
- Timestamp:
- Nov 24, 2023, 10:14:27 AM (13 months ago)
- Branches:
- master
- Children:
- f48dfcd
- Parents:
- 53dac82
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGeneratorNew.cpp
r53dac82 r3c4003b9 171 171 // Add the forall clause. 172 172 // TODO: These probably should be removed by now and the assert used. 173 if ( !decl->type_params.empty() && !options.genC) {174 //assertf( !options.genC, "FunctionDecl::forall should not reach code generation." );173 if ( !decl->type_params.empty() ) { 174 assertf( !options.genC, "FunctionDecl forall should not reach code generation." ); 175 175 acc << "forall("; 176 176 subCG.core.genCommaList( decl->type_params ); -
src/GenPoly/BoxNew.cpp
r53dac82 r3c4003b9 16 16 #include "Box.h" 17 17 18 #include "AST/Chain.hpp" // for chain_mutate 18 19 #include "AST/Decl.hpp" // for Decl, FunctionDecl, ... 19 20 #include "AST/Expr.hpp" // for AlignofExpr, ConstantExpr, ... … … 1435 1436 ast::FunctionType * type = new ast::FunctionType( 1436 1437 mutDecl->type->isVarArgs, mutDecl->type->qualifiers ); 1437 for ( auto type_param : mutDecl->type_params ) {1438 type->forall.emplace_back( new ast::TypeInstType( type_param ) );1439 }1440 1438 for ( auto param : mutDecl->params ) { 1441 1439 type->params.emplace_back( param->get_type() ); … … 2190 2188 ast::ObjectDecl const * previsit( ast::ObjectDecl const * decl ); 2191 2189 ast::FunctionDecl const * previsit( ast::FunctionDecl const * decl ); 2190 ast::FunctionDecl const * postvisit( ast::FunctionDecl const * decl ); 2192 2191 ast::TypedefDecl const * previsit( ast::TypedefDecl const * decl ); 2193 2192 ast::StructDecl const * previsit( ast::StructDecl const * decl ); … … 2210 2209 } 2211 2210 2211 ast::FunctionDecl const * Eraser::postvisit( ast::FunctionDecl const * decl ) { 2212 if ( decl->type_params.empty() ) return decl; 2213 auto mutDecl = mutate( decl ); 2214 mutDecl->type_params.clear(); 2215 ast::chain_mutate( mutDecl->type )->forall.clear(); 2216 return mutDecl; 2217 } 2218 2212 2219 ast::TypedefDecl const * Eraser::previsit( ast::TypedefDecl const * decl ) { 2213 2220 guardTypeVarMap( decl->base );
Note: See TracChangeset
for help on using the changeset viewer.