Ignore:
Timestamp:
Apr 23, 2024, 2:28:45 PM (17 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
566cc33, bab42de
Parents:
58e2ce34 (diff), 4a3eb1c (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/HoistStruct.cpp

    r58e2ce34 r5bc81e9  
    149149template<typename InstType>
    150150InstType 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;
    167167}
    168168
Note: See TracChangeset for help on using the changeset viewer.