// Add our object file buffer to the JIT.
{
+ LLVMOrcJITDylibRef MainJD = LLVMOrcLLJITGetMainJITDylib(J);
LLVMErrorRef Err;
- if ((Err = LLVMOrcLLJITAddObjectFile(J, ObjectFileBuffer))) {
+ if ((Err = LLVMOrcLLJITAddObjectFile(J, MainJD, ObjectFileBuffer))) {
MainResult = handleError(Err);
goto jit_cleanup;
}
// Add our demo module to the JIT.
{
+ LLVMOrcJITDylibRef MainJD = LLVMOrcLLJITGetMainJITDylib(J);
LLVMErrorRef Err;
- if ((Err = LLVMOrcLLJITAddLLVMIRModule(J, TSM))) {
+ if ((Err = LLVMOrcLLJITAddLLVMIRModule(J, MainJD, TSM))) {
// If adding the ThreadSafeModule fails then we need to clean it up
// ourselves. If adding it succeeds the JIT will manage the memory.
LLVMOrcDisposeThreadSafeModule(TSM);
// Add our demo module to the JIT.
{
+ LLVMOrcJITDylibRef MainJD = LLVMOrcLLJITGetMainJITDylib(J);
LLVMErrorRef Err;
- if ((Err = LLVMOrcLLJITAddLLVMIRModule(J, TSM))) {
+ if ((Err = LLVMOrcLLJITAddLLVMIRModule(J, MainJD, TSM))) {
// If adding the ThreadSafeModule fails then we need to clean it up
// ourselves. If adding it succeeds the JIT will manage the memory.
LLVMOrcDisposeThreadSafeModule(TSM);
LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J, const char *UnmangledName);
/**
- * Add a buffer representing an object file to the given LLJIT instance. This
- * operation transfers ownership of the buffer to the LLJIT instance. The
- * buffer should not be disposed of or referenced once this function returns.
+ * Add a buffer representing an object file to the given JITDylib in the given
+ * LLJIT instance. This operation transfers ownership of the buffer to the
+ * LLJIT instance. The buffer should not be disposed of or referenced once this
+ * function returns.
*/
-LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J,
+LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD,
LLVMMemoryBufferRef ObjBuffer);
/**
- * Add an IR module to the main JITDylib of the given LLJIT instance. This
+ * Add an IR module to the given JITDylib of the given LLJIT instance. This
* operation transfers ownership of the TSM argument to the LLJIT instance.
* The TSM argument should not be 3disposed of or referenced once this
* function returns.
*/
LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J,
+ LLVMOrcJITDylibRef JD,
LLVMOrcThreadSafeModuleRef TSM);
/**
* Look up the given symbol in the main JITDylib of the given LLJIT instance.
unwrap(J)->mangleAndIntern(UnmangledName)));
}
-LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J,
+LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD,
LLVMMemoryBufferRef ObjBuffer) {
return wrap(unwrap(J)->addObjectFile(
- std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer))));
+ *unwrap(JD), std::unique_ptr<MemoryBuffer>(unwrap(ObjBuffer))));
}
LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J,
+ LLVMOrcJITDylibRef JD,
LLVMOrcThreadSafeModuleRef TSM) {
- return wrap(unwrap(J)->addIRModule(std::move(*unwrap(TSM))));
+ return wrap(unwrap(J)->addIRModule(*unwrap(JD), std::move(*unwrap(TSM))));
}
LLVMErrorRef LLVMOrcLLJITLookup(LLVMOrcLLJITRef J,