Goose  Diff

Differences From Artifact [46393ef0f5]:

  • File bs/builtins/types/localvar/localvar.cpp — part of check-in [b3aeaae2df] at 2020-01-11 18:28:15 on branch trunk —
    • Moved the cfg and lifetime management stuff into a CodeBuilder object owned by sema::Context. This is in preparation to allow alternative implementations of the builder, for instance to build classes.
    • Pass the context to intrinsic functions, which removes their dependency to the parser the need for the ugly "GetCurrentParser" static function.
    (user: achavasse size: 9566)

To Artifact [9e867f5b13]:

  • File bs/builtins/types/localvar/localvar.cpp — part of check-in [cc380f4f8f] at 2020-01-22 22:14:16 on branch trunk — Standardized the way type values are encoded to make room for an optional pointer to a list of predicates for refinement types. (user: achavasse size: 9574)

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
        auto bb = cfg->currentBB();
        if( !bb )
            return PoisonValue();

        // To infer the type and obtain a suitable initialization function,
        // we want the declaration to behave as if it were the following function call:
        // Params: ( $T,  _ ( LocalVar[$T], initValType ) initFunc )
        // Args:   ( pat, InitializeLocalVar                   )
        //
        // Where pat is the TNamedDecl's type pattern and initVal is the initialization
        // expression's type.

        // We construct the above expressions and unify them. The best solution (if any)
        // will give us the wanted type and the function to invoke to initialize it.

        // Create the _ texpr.
        static auto anyTVar = ValueToIRExpr( ToValue( TVar( "_"_sid ) ) );







|

|







81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
        auto bb = cfg->currentBB();
        if( !bb )
            return PoisonValue();

        // To infer the type and obtain a suitable initialization function,
        // we want the declaration to behave as if it were the following function call:
        // Params: ( $T,  _ ( LocalVar[$T], initValType ) initFunc )
        // Args:   ( pat, InitializeLocalVar                       )
        //
        // Where pat is the TNamedDecl's type pattern and initValType is the initialization
        // expression's type.

        // We construct the above expressions and unify them. The best solution (if any)
        // will give us the wanted type and the function to invoke to initialize it.

        // Create the _ texpr.
        static auto anyTVar = ValueToIRExpr( ToValue( TVar( "_"_sid ) ) );