Goose  Diff

Differences From Artifact [9b6b561c2d]:

  • File bs/builtins/builders/cb_interface.cpp — part of check-in [8546f1ef75] at 2022-11-17 22:43:21 on branch trunk — g0api:
    • visiblity scopes
    • combined visibility/lifetime scopes
    (user: zlodo size: 5652)

To Artifact [60afae554b]:

  • File bs/builtins/builders/cb_interface.cpp — part of check-in [72cb3ae97a] at 2023-04-03 22:37:25 on branch trunk — Moved the code that emits type predicate checks for values returned by intrinsics into an extension point (user: zlodo size: 6275)

118
119
120
121
122
123
124









125
126

        RegisterBuiltinFunc< Intrinsic< bool ( TypeWrapper< ptr< CodeBuilder > >, uint32_t ) > >( e, e.extDestroyAllLiveValuesFromContinueScope(),
            []( auto&& c, const Value& cbv, const Value& index )
            {
                auto cb = *FromValue< TypeWrapper< ptr< CodeBuilder > > >( cbv );
                return ToValue( cb->destroyAllLiveValuesFromContinueScope( c, *FromValue< uint32_t >( index ) ) );
            } );









    }
}







>
>
>
>
>
>
>
>
>


118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135

        RegisterBuiltinFunc< Intrinsic< bool ( TypeWrapper< ptr< CodeBuilder > >, uint32_t ) > >( e, e.extDestroyAllLiveValuesFromContinueScope(),
            []( auto&& c, const Value& cbv, const Value& index )
            {
                auto cb = *FromValue< TypeWrapper< ptr< CodeBuilder > > >( cbv );
                return ToValue( cb->destroyAllLiveValuesFromContinueScope( c, *FromValue< uint32_t >( index ) ) );
            } );

        // TODO add some tests for this, cba right now, at least there's this comment to keep a trace I guess
        RegisterBuiltinFunc< Intrinsic< Value ( TypeWrapper< ptr< CodeBuilder > >, Value, TypeWrapper< ptr< Propositions > > ) > >( e, e.extEmitTypePredicatesCheck(),
            []( auto&& c, const Value& cbv, const Value& val, const Value& p )
            {
                auto cb = *FromValue< TypeWrapper< ptr< CodeBuilder > > >( cbv );
                auto props = *FromValue< TypeWrapper< ptr< Propositions > > >( p );
                return cb->emitTypePredicatesCheck( c, val, props );
            } );
    }
}