Skip to content

Add typed-handle wrappers for the ORC v2 / LLJIT C-API#269

Merged
tannergooding merged 4 commits into
dotnet:mainfrom
tannergooding:tannergooding-orc-lljit-interop
Jul 16, 2026
Merged

Add typed-handle wrappers for the ORC v2 / LLJIT C-API#269
tannergooding merged 4 commits into
dotnet:mainfrom
tannergooding:tannergooding-orc-lljit-interop

Conversation

@tannergooding

Copy link
Copy Markdown
Member

Adds typed-handle wrappers for the ORC v2 / LLJIT C-API — all 92 LLVMOrc* functions across 20 new structs, so the ORC JIT surface is usable from the middle layer instead of the raw generated LLVM.* P/Invokes.

The LLVMOrc*Ref typedefs previously had no Layer-2 struct (generated code used the raw LLVMOrcOpaque* pointers), so each new struct gets the standard implicit conversions to/from the opaque pointer plus the equality/GetHashCode/ToString boilerplate.

New structs: LLJIT, LLJITBuilder, ThreadSafeContext, ThreadSafeModule, JITTargetMachineBuilder, ExecutionSession, JITDylib, ResourceTracker, SymbolStringPool(+Entry), ObjectLayer, IRTransformLayer, ObjectTransformLayer, IndirectStubsManager, LazyCallThroughManager, DumpObjects, DefinitionGenerator, LookupState, MaterializationUnit, MaterializationResponsibility.

Conventions: errors surfaced as LLVMErrorRef; Dispose* → IDisposable (the LLJIT dispose discards its error return via _ =); retain/release exposed as explicit methods rather than auto-refcounting; function-pointer params (error reporter, transforms, custom generator/MU, memory-manager callbacks) exposed as delegate* unmanaged[Cdecl]<...> matching the extern signatures; ownership-transfer / caller-owned / pooled-no-dispose semantics documented inline where subtle.

LLVMOrcThreadSafeContextGetContext is not present in this LLVM-C surface, so ThreadSafeContext intentionally has no get-context member.

Interop-only; no generated-file edits. Builds clean (0 warnings), 2625 tests pass.

tannergooding and others added 4 commits July 15, 2026 18:00
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…types

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ypes

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tannergooding
tannergooding merged commit ec342c8 into dotnet:main Jul 16, 2026
12 checks passed
@tannergooding
tannergooding deleted the tannergooding-orc-lljit-interop branch July 16, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant