Changes in src/Validate/HoistStruct.cpp [8b4faf6:fc1a3e2]
- File:
-
- 1 edited
-
src/Validate/HoistStruct.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Validate/HoistStruct.cpp
r8b4faf6 rfc1a3e2 149 149 template<typename InstType> 150 150 InstType const * HoistStructCore::preCollectionInstType( InstType const * type ) { 151 if ( !type->base->parent ) return type;152 if ( type->base->params.empty() ) return type;153 154 InstType * mut = ast::mutate( type );155 ast::AggregateDecl const * parent =156 commonParent( this->parent, mut->base->parent );157 assert( parent );158 159 std::vector<ast::ptr<ast::Expr>> args;160 for ( const ast::ptr<ast::TypeDecl> & param : parent->params ) {161 args.emplace_back( new ast::TypeExpr( param->location,162 new ast::TypeInstType( param )163 ) );164 }165 spliceBegin( mut->params, args );166 return mut;151 if ( !type->base->parent ) return type; 152 if ( type->base->params.empty() ) return type; 153 154 InstType * mut = ast::mutate( type ); 155 ast::AggregateDecl const * parent = 156 commonParent( this->parent, mut->base->parent ); 157 assert( parent ); 158 159 std::vector<ast::ptr<ast::Expr>> args; 160 for ( const ast::ptr<ast::TypeDecl> & param : parent->params ) { 161 args.emplace_back( new ast::TypeExpr( param->location, 162 new ast::TypeInstType( param ) 163 ) ); 164 } 165 spliceBegin( mut->params, args ); 166 return mut; 167 167 } 168 168
Note:
See TracChangeset
for help on using the changeset viewer.