llvm-project
2222cfe7 - [C-API] LLVMOrcCreateObjectLinkingLayerWithInProcessMemoryManager (#169862)

Commit
146 days ago
[C-API] LLVMOrcCreateObjectLinkingLayerWithInProcessMemoryManager (#169862) Allow C programs to use JITLink with trivial new C-API wrapper. Modeled on `LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager` except that it has to deal with failure of `jitlink::InProcessMemoryManager::Create()`. Function name suggested by @lhames in https://github.com/llvm/llvm-project/issues/106203. I suppose failure of underlying platform-specific things like `sysconf(_SC_PAGESIZE)` shouldn't really happen. An alternative error reporting style might be to follow `LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess` and return `LLVMErrorRef` with an output parameter for the `LLVMOrcObjectLayerRef`, but then it wouldn't be a drop-in replacement for `LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager`. Thoughts? This is wanted by PostgreSQL (branch using this API: https://github.com/macdice/postgres/tree/llvm-22-proposed-c-api). (We're also using `LLVMCreatePerfJITEventListener`, `LLVMCreatePerfJITEventListener`, `LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener`, so it looks like we'll need to research `PerfSupportPlugin`, `DebuggerSupportPlugin`, `ObjectLinkingLayer::addPlugin()`...)
Author
Parents
Loading