private static IReadOnlyDictionary <string, TypeMember> CreateMembers(GlobalCompilationContext ctx) { var global = ctx.GlobalNamespace; return(new Dictionary <string, TypeMember>(2) { { "allocate_fn", new TypeMember { Index = 0, Name = "allocate_fn", Type = PointerType.Create(FunctionType.Create(global.Types["void*"], new[] { global.Types["u32"] }, false, ctx)), } }, { "free_fn", new TypeMember { Index = 1, Name = "free_fn", Type = PointerType.Create(FunctionType.Create(global.Types["void"], new [] { global.Types["void*"] }, false, ctx)) } } }); }
public override IEntity VisitPointerType(IPointerTypeSymbol symbol) => PointerType.Create(cx, symbol);
/// <summary> /// Creates a pointer type of a particular kind that has a /// type as element. /// </summary> /// <param name="type"> /// The type of values referred to by the pointer type. /// </param> /// <param name="kind"> /// The kind of the pointer type. /// </param> /// <returns>A pointer type.</returns> public static PointerType MakePointerType(this IType type, PointerKind kind) { return(PointerType.Create(type, kind)); }
public static PointerType GetVoidPtrType() { return(PointerType.Create(GetVoidType())); }