private Context(LLVMContextRef contextRef) { ContextHandle = contextRef; lock ( ContextCache ) { ContextCache.Add(contextRef, this); } ActiveHandler = new WrappedNativeCallback(new LLVMDiagnosticHandler(DiagnosticHandler)); NativeMethods.ContextSetDiagnosticHandler(ContextHandle, ActiveHandler.GetFuncPointer( ), IntPtr.Zero); }