Changeset c4497e3 for src


Ignore:
Timestamp:
Jun 26, 2023, 10:11:03 PM (2 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
b9c06b98
Parents:
65ef0cd (diff), 917e1fd (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

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.cpp

    r65ef0cd rc4497e3  
    115115        static_assert( sizeof(kindNames) / sizeof(kindNames[0]) == TypeDecl::NUMBER_OF_KINDS, "typeString: kindNames is out of sync." );
    116116        assertf( kind < TypeDecl::NUMBER_OF_KINDS, "TypeDecl kind is out of bounds." );
    117         return sized ? kindNames[ kind ] : &kindNames[ kind ][ sizeof("sized") ]; // sizeof includes '\0'
     117        // sizeof("sized") includes '\0' and gives the offset to remove "sized ".
     118        return sized ? kindNames[ kind ] : &kindNames[ kind ][ sizeof("sized") ];
    118119}
    119120
  • src/Validate/LinkReferenceToTypes.cpp

    r65ef0cd rc4497e3  
    264264
    265265ast::TraitDecl const * LinkTypesCore::postvisit( ast::TraitDecl const * decl ) {
    266         auto mut = ast::mutate( decl );
    267         if ( mut->name == "sized" ) {
    268                 // "sized" is a special trait - flick the sized status on for the type variable.
    269                 assertf( mut->params.size() == 1, "Built-in trait 'sized' has incorrect number of parameters: %zd", decl->params.size() );
    270                 ast::TypeDecl * td = mut->params.front().get_and_mutate();
    271                 td->sized = true;
    272         }
    273 
    274266        // There is some overlap with code from decayForallPointers,
    275267        // perhaps reorganization or shared helper functions are called for.
    276268        // Move assertions from type parameters into the body of the trait.
     269        auto mut = ast::mutate( decl );
    277270        for ( ast::ptr<ast::TypeDecl> const & td : decl->params ) {
    278271                auto expanded = expandAssertions( td->assertions );
Note: See TracChangeset for help on using the changeset viewer.