Goose  Diff

Differences From Artifact [5be7fc73ad]:

  • File bs/builtins/types/localvar/localvar.cpp — part of check-in [0d5427d49b] at 2022-05-23 08:44:00 on branch cir-stack-language —
    • CIR instructions are now stored in lists
    • Execute: handle the stack
    • Converted some instructions to use the stack
    (user: zlodo size: 9538)

To Artifact [26eb2a20a9]:

  • File bs/builtins/types/localvar/localvar.cpp — part of check-in [b4d5bdf6ec] at 2022-06-18 18:51:47 on branch cir-stack-language —
    • Added a location id to all CIR instructions (needed with the stack based approach to locate intermediate results)
    • Fixed a bunch of verifier errors
    • Re-enabled most verifier tests, other than some requiring to re-implement a few more bits
    (user: zlodo size: 9552) [more...]

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
        if( !typeVal.isType() )
            typeVal = ToType( c, typeVal );

        if( !ParseTypePredicates( c, typeVal ) )
            return PoisonValue();

        LocalVar lv( name, ValueToEIR( typeVal ), index );
        bb->append( AllocVar( typeVal, index ) );

        Value initResult;

        {
            DiagnosticsContext dc( 0, "When invoking Initialize." );

            if( initializer )







|







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
        if( !typeVal.isType() )
            typeVal = ToType( c, typeVal );

        if( !ParseTypePredicates( c, typeVal ) )
            return PoisonValue();

        LocalVar lv( name, ValueToEIR( typeVal ), index );
        bb->append( AllocVar( typeVal, index, locId ) );

        Value initResult;

        {
            DiagnosticsContext dc( 0, "When invoking Initialize." );

            if( initializer )
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194

        // Retrieve the texpr's location and set it on the inferred type. This way if an
        // error occurs later with it, for instance when calling LowerTypeForRuntime on it during codegen,
        // it will have a meaningful location for the error message to attach itself on.
        auto typeLoc = EIRToValue( typeTExpr )->locationId();
        LocalVar lv( name, type, index );

        bb->append( AllocVar( EIRToValue( lv.type() )->setLocationId( typeLoc ), index ) );

        DiagnosticsContext dc( 0, "When invoking Initialize." );

        auto initResult = InvokeOverloadSet( c,
            c.env()->extInitialize(),
            MakeTuple( ToValue( lv ).setLocationId( locId ), initVal ) );








|







180
181
182
183
184
185
186
187
188
189
190
191
192
193
194

        // Retrieve the texpr's location and set it on the inferred type. This way if an
        // error occurs later with it, for instance when calling LowerTypeForRuntime on it during codegen,
        // it will have a meaningful location for the error message to attach itself on.
        auto typeLoc = EIRToValue( typeTExpr )->locationId();
        LocalVar lv( name, type, index );

        bb->append( AllocVar( EIRToValue( lv.type() )->setLocationId( typeLoc ), index, locId ) );

        DiagnosticsContext dc( 0, "When invoking Initialize." );

        auto initResult = InvokeOverloadSet( c,
            c.env()->extInitialize(),
            MakeTuple( ToValue( lv ).setLocationId( locId ), initVal ) );