Esempio n. 1
0
 private static LLVMTypeRef MethodPollFunctionType(this ContextWrapper context) => LLVMTypeRef.FunctionType(
     context.VoidType,
     new LLVMTypeRef[]
 {
     context.VoidPointerType(),
     LLVMTypeRef.PointerType(context.ScheduledTaskFunctionType(), 0u),
     context.VoidPointerType()
 },
     false);
 public static LLVMTypeRef PollFunctionType(ContextWrapper context) => LLVMTypeRef.FunctionType(
     context.VoidType,
     new LLVMTypeRef[]
 {
     context.VoidPointerType(),
     LLVMTypeRef.PointerType(context.ScheduledTaskFunctionType(), 0u),
     context.VoidPointerType()
 },
     false);
Esempio n. 3
0
 public static LLVMTypeRef WakerType(this ContextWrapper context) => context.StructType(
     new LLVMTypeRef[]
 {
     // task function pointer
     LLVMTypeRef.PointerType(context.ScheduledTaskFunctionType(), 0u),
     // task state
     context.VoidPointerType()
 });
Esempio n. 4
0
 internal static LLVMTypeRef CreateLLVMMethodCallPromiseType(this ContextWrapper context, LLVMTypeRef innerType)
 {
     return(context.StructType(new LLVMTypeRef[]
     {
         LLVMTypeRef.PointerType(context.MethodPollFunctionType(), 0u),
         context.VoidPointerType(),
         innerType,
     }));
 }
Esempio n. 5
0
 public static LLVMTypeRef GetScheduledTaskType(this ContextWrapper context)
 {
     return(context.GetCachedStructType("scheduled_task", () => new[]
     {
         // task function pointer
         LLVMTypeRef.PointerType(context.ScheduledTaskFunctionType(), 0u),
         // task state
         context.VoidPointerType()
     }));
 }
Esempio n. 6
0
 public static LLVMTypeRef ScheduledTaskFunctionType(this ContextWrapper context) => LLVMTypeRef.FunctionType(context.VoidType, new[] { context.VoidPointerType() }, false);
Esempio n. 7
0
 public static LLVMValueRef NullVoidPointer(this ContextWrapper context) => LLVMSharp.LLVM.ConstPointerNull(context.VoidPointerType());
Esempio n. 8
0
 public static LLVMTypeRef FileHandleType(this ContextWrapper context) => context.StructType(
     new LLVMTypeRef[]
 {
     context.VoidPointerType()
 });