コード例 #1
0
        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))
                    }
                }
            });
        }
コード例 #2
0
 public override IEntity VisitPointerType(IPointerTypeSymbol symbol) => PointerType.Create(cx, symbol);
コード例 #3
0
ファイル: TypeExtensions.cs プロジェクト: anthrax3/Flame
 /// <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));
 }
コード例 #4
0
 public static PointerType GetVoidPtrType()
 {
     return(PointerType.Create(GetVoidType()));
 }