Skip to content

Commit c78bb1e

Browse files
committed
[ORC][examples][LLVM-C] Fix ThreadSafeContext to wrap existing context
1 parent e41da79 commit c78bb1e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ LLVMOrcThreadSafeModuleRef createDemoModule(void) {
5555
LLVMDisposeBuilder(Builder);
5656

5757
// Create a new ThreadSafeContext to hold the context.
58-
LLVMOrcThreadSafeContextRef TSCtx = LLVMOrcCreateNewThreadSafeContext();
58+
LLVMOrcThreadSafeContextRef TSCtx = LLVMOrcCreateNewThreadSafeContextFromLLVMContext(Ctx);
5959

6060
// Our demo module is now complete. Wrap it and our ThreadSafeContext in a
6161
// ThreadSafeModule.

llvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/OrcV2CBindingsIRTransforms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ LLVMOrcThreadSafeModuleRef createDemoModule(void) {
4646
LLVMValueRef Result = LLVMBuildAdd(Builder, SumArg0, SumArg1, "result");
4747
LLVMBuildRet(Builder, Result);
4848
LLVMDisposeBuilder(Builder);
49-
LLVMOrcThreadSafeContextRef TSCtx = LLVMOrcCreateNewThreadSafeContext();
49+
LLVMOrcThreadSafeContextRef TSCtx = LLVMOrcCreateNewThreadSafeContextFromLLVMContext(Ctx);
5050
LLVMOrcThreadSafeModuleRef TSM = LLVMOrcCreateNewThreadSafeModule(M, TSCtx);
5151
LLVMOrcDisposeThreadSafeContext(TSCtx);
5252
return TSM;

llvm/examples/OrcV2Examples/OrcV2CBindingsVeryLazy/OrcV2CBindingsVeryLazy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ LLVMErrorRef parseExampleModule(const char *Source, size_t Len,
9191
}
9292

9393
// Create a new ThreadSafeContext to hold the context.
94-
LLVMOrcThreadSafeContextRef TSCtx = LLVMOrcCreateNewThreadSafeContext();
94+
LLVMOrcThreadSafeContextRef TSCtx = LLVMOrcCreateNewThreadSafeContextFromLLVMContext(Ctx);
9595

9696
// Our module is now complete. Wrap it and our ThreadSafeContext in a
9797
// ThreadSafeModule.

0 commit comments

Comments
 (0)