Goose  Artifact [e3eae90053]

Artifact e3eae900538f556bf340e3aee30ef270e2b289775ff94c346e1d950dba617026:

  • File bs/builtins/types/lower.cpp — part of check-in [11b6bc7f84] at 2024-01-03 22:20:25 on branch trunk — Added _LowerType extension point, called to decide what type to use when allocating locvars (user: zlodo size: 1339)

#include "builtins/builtins.h"
#include "parse/parse.h"

using namespace goose::parse;
using namespace goose::cir;

namespace goose::builtins
{
    void SetupLower( Env& e )
    {
        // Default implementation of LowerType():
        // Do nothing.
        RegisterBuiltinFunc< Intrinsic< Value ( Value ) > >( e, e.extLowerType(),
            []( const Context& c, const Value& v )
            {
                return v;
            } );

        // Default implementation of LowerTypeForVerification():
        // Do nothing.
        RegisterBuiltinFunc< Intrinsic< Value ( Value ) > >( e, e.extLowerTypeForVerification(),
            []( const Context& c, const Value& v )
            {
                return v;
            } );

        // Default implementation of LowerConstantForVerification():
        // Do nothing.
        RegisterBuiltinFunc< Intrinsic< Value ( Value ) > >( e, e.extLowerConstantForVerification(),
            []( const Context& c, const Value& v )
            {
                return v;
            } );

        // Default implementation of LowerConstantForRuntime():
        // Do nothing.
        RegisterBuiltinFunc< Intrinsic< Value ( Value ) > >( e, e.extLowerConstantForRuntime(),
            []( const Context& c, const Value& v )
            {
                return v;
            } );
    }
}