Goose  Artifact [3db8f9215c]

Artifact 3db8f9215ca31dcfbbc3909018deb1fba66f4100391272feb7b4f8d557a6031d:

  • File bs/g0api/extensibility/types.h — part of check-in [447824df93] at 2021-09-18 18:43:50 on branch trunk — g0 api: more work on the CIR api (user: achavasse size: 1779)

#ifndef GOOSE_G0API_EXTENSIBILITY_TYPEWRAPPERS_H
#define GOOSE_G0API_EXTENSIBILITY_TYPEWRAPPERS_H

namespace goose::g0api
{
    extern void SetupTypeWrappers( Env& e );
}

namespace goose::builtins
{
    template<>
    struct TypeWrapperTraits< LocationId >
    {
        static auto typeId() { return "LocationId"_sid; }
    };

    template<>
    struct TypeWrapperTraits< StringId >
    {
        static auto typeId() { return "StringId"_sid; }
    };

    template<>
    struct TypeWrapperTraits< Hole >
    {
        static auto typeId() { return "Hole"_sid; }
    };

    template<>
    struct TypeWrapperTraits< AnyTerm >
    {
        static auto typeId() { return "AnyTerm"_sid; }
    };

    template<>
    struct TypeWrapperTraits< VecOfLength >
    {
        static auto typeId() { return "VecOfLength"_sid; }
    };

    template<>
    struct TypeWrapperTraits< pvec >
    {
        static auto typeId() { return "Vec"_sid; }
    };

    template<>
    struct TypeWrapperTraits< APSInt >
    {
        static auto typeId() { return "FixedInt"_sid; }
    };

    template<>
    struct TypeWrapperTraits< ptr< cir::CFG > >
    {
        static auto typeId() { return "CFG"_sid; }
    };

    template<>
    struct TypeWrapperTraits< ptr< cir::BasicBlock > >
    {
        static auto typeId() { return "BasicBlock"_sid; }
    };

    template<>
    struct TypeWrapperTraits< wptr< cir::BasicBlock > >
    {
        static auto typeId() { return "BasicBlock"_sid; }
    };

    template<>
    struct TypeWrapperTraits< ptr< cir::Instruction > >
    {
        static auto typeId() { return "Instruction"_sid; }
    };

    template<>
    struct TypeWrapperTraits< ptr< cir::Terminator > >
    {
        static auto typeId() { return "Terminator"_sid; }
    };
}

#endif