Skip to content

Missing GetInt128Ty and GetIntNTy on LLVMSharp.Type #275

Description

@retroandchill

These APIs have analogues in the C-API, and currently there's no way to access the API I need.

This is the workaround I've come up with, but it's not ideal, so if this could be added to the public API, that would be great.

internal static class LlvmTypeHelpers
{
    extension(Type)
    {
        public static Type GetInt128Ty(LLVMContext context)
        {
            var typeRef = context.Handle.Int128Type;
            return context.GetOrCreate(typeRef);
        }
    }

    [UnsafeAccessor(UnsafeAccessorKind.Method, Name = "GetOrCreate")]
    private static extern Type GetOrCreate(this LLVMContext context, LLVMTypeRef typeRef);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions