Ignore:
Timestamp:
Jun 26, 2023, 10:51:47 AM (2 years ago)
Author:
caparson <caparson@…>
Branches:
master
Children:
917e1fd
Parents:
adc73a5 (diff), 1fbf481 (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/LinkReferenceToTypes.cpp

    radc73a5 r48ec19a  
    8484                // Just linking in the node.
    8585                auto mut = ast::mutate( type );
    86                 mut->base = const_cast<ast::EnumDecl *>( decl );
     86                mut->base = decl;
    8787                type = mut;
    8888        }
     
    101101                // Just linking in the node.
    102102                auto mut = ast::mutate( type );
    103                 mut->base = const_cast<ast::StructDecl *>( decl );
     103                mut->base = decl;
    104104                type = mut;
    105105        }
     
    118118                // Just linking in the node.
    119119                auto mut = ast::mutate( type );
    120                 mut->base = const_cast<ast::UnionDecl *>( decl );
     120                mut->base = decl;
    121121                type = mut;
    122122        }
     
    141141
    142142        // Just linking in the node.
    143         mut->base = const_cast<ast::TraitDecl *>( decl );
     143        mut->base = decl;
    144144
    145145        // Need to carry over the 'sized' status of each decl in the instance.
     
    203203        }
    204204
    205         // The following section
    206 
    207205        ForwardEnumsType::iterator fwds = forwardEnums.find( decl->name );
    208206        if ( fwds != forwardEnums.end() ) {
     
    266264
    267265ast::TraitDecl const * LinkTypesCore::postvisit( ast::TraitDecl const * decl ) {
    268         auto mut = ast::mutate( decl );
    269         if ( mut->name == "sized" ) {
    270                 // "sized" is a special trait - flick the sized status on for the type variable.
    271                 assertf( mut->params.size() == 1, "Built-in trait 'sized' has incorrect number of parameters: %zd", decl->params.size() );
    272                 ast::TypeDecl * td = mut->params.front().get_and_mutate();
    273                 td->sized = true;
    274         }
    275 
    276266        // There is some overlap with code from decayForallPointers,
    277267        // perhaps reorganization or shared helper functions are called for.
    278268        // Move assertions from type parameters into the body of the trait.
     269        auto mut = ast::mutate( decl );
    279270        for ( ast::ptr<ast::TypeDecl> const & td : decl->params ) {
    280271                auto expanded = expandAssertions( td->assertions );
Note: See TracChangeset for help on using the changeset viewer.