-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Description
Hi,
The OrcV2CBindings
examples have recently changed, as the C function LLVMOrcThreadSafeContextGetContext()
has been removed in favor of LLVMOrcCreateNewThreadSafeContextFromLLVMContext()
.
In the new examples:
-
A new context and module are created here:
llvm-project/llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c
Line 26 in dff8788
LLVMContextRef Ctx = LLVMContextCreate();
llvm-project/llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c
Line 29 in dff8788
LLVMModuleRef M = LLVMModuleCreateWithNameInContext("demo", Ctx); -
A thread-safe module is constructed using the previously mentioned module, but the thread-safe context appears to hold a different context than the module:
llvm-project/llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c
Lines 57 to 62 in dff8788
// Create a new ThreadSafeContext to hold the context. LLVMOrcThreadSafeContextRef TSCtx = LLVMOrcCreateNewThreadSafeContext(); // Our demo module is now complete. Wrap it and our ThreadSafeContext in a // ThreadSafeModule. LLVMOrcThreadSafeModuleRef TSM = LLVMOrcCreateNewThreadSafeModule(M, TSCtx);
Could this be an issue?
From my understanding, LLVMOrcCreateNewThreadSafeContextFromLLVMContext()
should have been used to wrap the original context instead of creating a new one with LLVMOrcCreateNewThreadSafeContext()
.