Goose  Diff

Differences From Artifact [46c0a6fb82]:

  • File bs/builtins/types/func/invoke.cpp — part of check-in [51c6751b6d] at 2020-05-21 17:26:11 on branch trunk — Created a new term type to represent holes in IR expressions. The old system of representing holes using a vector of two values led to ambiguousness when creating some rule patterns: a tuple whose both type vector and payload vector were holes would be indistinguishable from a tuple containing two elements. (user: achavasse size: 4479)

To Artifact [297bd1834e]:

  • File bs/builtins/types/func/invoke.cpp — part of check-in [bb17e9f3dd] at 2020-05-25 22:08:44 on branch trunk —
    • Added a "LowerConstantForRuntime" extension point, similar to LowerTypeForRunTime.
    • Added a way to represent Record constants.
    • Implemented LowerConstantForRunTime for tuples, which lowers them into a constant record.
    • Implemented codegen for constant records.
    • Implemented codegen for storing an aggregate constant.
    • Implemented a way (not exposed in the syntax for now) to create vararg function types, to be able to call vararg external functions such as printf.
    • Enabled the tuple runtime/compilation combined test which is now working.
    • Various bug fixes.
    (user: achavasse size: 4493)

111
112
113
114
115
116
117
118
119
120
121
122
123
    void SetupFunctionInvocationRule( Env& e )
    {
        e.invocationRuleSet()->addRule(
            ValueToIRExpr( ValuePattern( ANYTERM( _ ),

                ValueToIRExpr( Value( TypeType(), VEC( TSID( func ),
                ANYTERM( _ ), ANYTERM( _ ), ANYTERM( _ ), ANYTERM( _ ),
                ANYTERM( _ ) ) ) ),

                ANYTERM( _ ) ) ),
            GetFuncInvocationRule() );
    }
}







|





111
112
113
114
115
116
117
118
119
120
121
122
123
    void SetupFunctionInvocationRule( Env& e )
    {
        e.invocationRuleSet()->addRule(
            ValueToIRExpr( ValuePattern( ANYTERM( _ ),

                ValueToIRExpr( Value( TypeType(), VEC( TSID( func ),
                ANYTERM( _ ), ANYTERM( _ ), ANYTERM( _ ), ANYTERM( _ ),
                ANYTERM( _ ), ANYTERM( _ ) ) ) ),

                ANYTERM( _ ) ) ),
            GetFuncInvocationRule() );
    }
}