Goose  Diff

Differences From Artifact [61c91b37ca]:

  • File bs/builtins/types/localvar/localvar.cpp — part of check-in [3d8b581261] at 2019-08-15 22:37:33 on branch trunk —
    • Fixed some bugs related to dropping values.
    • Implemented local variable declarations with default initialization.
    • codegen: Fixed allocas not properly grouped up at the start of the first basic block of functions.
    (user: achavasse size: 3098)

To Artifact [56906993bf]:

  • File bs/builtins/types/localvar/localvar.cpp — part of check-in [27fc719d74] at 2019-08-16 14:48:20 on branch trunk — Added a new type of template expression: TVec, along with a helper function to make it possible for parametric types to be constructed either normally or as a template expression when passed template parameters. Only used by LocalVar for now, parametric runtime types require some refactoring. (user: achavasse size: 3097)

83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    Term Bridge< LocalVar >::Type( const Term& type )
    {
        return ValueToIRExpr( ToValue< LocalVarType >( type ) );
    }

    Value Bridge< LocalVar >::ToValue( const LocalVar& lv )
    {
        return Value( Type( lv.type() ), TVEC( TERM( lv.cfgId() ), TERM( lv.index() ) ) );
    }

    optional< LocalVar > Bridge< LocalVar >::FromValue( const Value& v )
    {
        auto t = FromValue< LocalVarType >( *ValueFromIRExpr( v.type() ) );
        if( !t )
            return nullopt;







|







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    Term Bridge< LocalVar >::Type( const Term& type )
    {
        return ValueToIRExpr( ToValue< LocalVarType >( type ) );
    }

    Value Bridge< LocalVar >::ToValue( const LocalVar& lv )
    {
        return Value( Type( lv.type() ), VEC( TERM( lv.cfgId() ), TERM( lv.index() ) ) );
    }

    optional< LocalVar > Bridge< LocalVar >::FromValue( const Value& v )
    {
        auto t = FromValue< LocalVarType >( *ValueFromIRExpr( v.type() ) );
        if( !t )
            return nullopt;