Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,7 @@ private StackValueKind GetStackValueKind(TypeDesc type)
case TypeFlags.ByRef:
return StackValueKind.ByRef;
case TypeFlags.Pointer:
case TypeFlags.FunctionPointer:
return StackValueKind.NativeInt;
default:
return StackValueKind.Unknown;
Expand Down Expand Up @@ -1285,6 +1286,8 @@ internal static LLVMTypeRef GetLLVMTypeForTypeDesc(TypeDesc type)

case TypeFlags.Pointer:
return LLVMTypeRef.CreatePointer(type.GetParameterType().IsVoid ? LLVMTypeRef.Int8 : GetLLVMTypeForTypeDesc(type.GetParameterType()), 0);
case TypeFlags.FunctionPointer:
return LLVMTypeRef.CreatePointer(LLVMTypeRef.Int8, 0);

case TypeFlags.Int64:
case TypeFlags.UInt64:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,14 @@ private void EmitNativeMain(LLVMContextRef context)
},
"returnValue");

LLVMValueRef RhpReversePInvokeReturn2 = Module.GetNamedFunction("RhpReversePInvokeReturn2");
LLVMTypeRef reversePInvokeFunctionType = LLVMTypeRef.CreateFunction(LLVMTypeRef.Void, new LLVMTypeRef[] { LLVMTypeRef.CreatePointer(reversePInvokeFrameType, 0) }, false);
if (RhpReversePInvoke2.Handle == IntPtr.Zero)
{
RhpReversePInvokeReturn2 = Module.AddFunction("RhpReversePInvokeReturn2", reversePInvokeFunctionType);
}
builder.BuildCall(RhpReversePInvokeReturn2, new LLVMValueRef[] { reversePinvokeFrame }, "");

builder.BuildRet(mainReturn);
mainFunc.Linkage = LLVMLinkage.LLVMExternalLinkage;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal static void ShutdownCore()
{
// TODO: shut down threading etc.

#if !TARGET_WASM // WASMTODO
#if !TARGET_WASM // WASMTODO Be careful what happens here as if the code has called emscripten_set_main_loop then the main loop method will normally be called repeatedly after this method
AppContext.OnProcessExit();
#endif
}
Expand Down