Goose  Artifact [bfd7c86c46]

Artifact bfd7c86c46e4d4fbf42ced33f54fa442de80cf81ce56a9ac36f0a302b67d3da9:

  • File bs/g0api/types.h — part of check-in [1ad61a2717] at 2021-11-11 20:05:58 on branch trunk — Refactored the code builder: it is now carried around as a Value, and accessed through a bunch of extension points, so we can have different builders (and even user defined ones) later to make classes etc. (user: zlodo size: 2051)

#ifndef GOOSE_G0API_TYPEWRAPPERS_H
#define GOOSE_G0API_TYPEWRAPPERS_H

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

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

    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< TypePredicates > >
    {
        static auto typeId() { return "TypePredicates"_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; }
    };

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

#endif