forked from OSchip/llvm-project
[ORC][C-bindings] Re-order object transform function arguments.
ObjInOut is an in-out parameter not a return value argument, so by convention it should come after the context value (Ctx).
This commit is contained in:
parent
cbfb12469b
commit
8962c68ad0
|
@ -51,7 +51,7 @@ LLVMOrcThreadSafeModuleRef createDemoModule() {
|
|||
return TSM;
|
||||
}
|
||||
|
||||
LLVMErrorRef dumpObjectsTransform(LLVMMemoryBufferRef *ObjInOut, void *Ctx) {
|
||||
LLVMErrorRef dumpObjectsTransform(void *Ctx, LLVMMemoryBufferRef *ObjInOut) {
|
||||
LLVMOrcDumpObjectsRef DumpObjects = *(LLVMOrcDumpObjectsRef *)Ctx;
|
||||
return LLVMOrcDumpObjects_CallOperator(DumpObjects, ObjInOut);
|
||||
}
|
||||
|
|
|
@ -328,7 +328,7 @@ typedef struct LLVMOrcOpaqueObjectTransformLayer
|
|||
* buffer should be disposed of and set to null.
|
||||
*/
|
||||
typedef LLVMErrorRef (*LLVMOrcObjectTransformLayerTransformFunction)(
|
||||
LLVMMemoryBufferRef *ObjInOut, void *Ctx);
|
||||
void *Ctx, LLVMMemoryBufferRef *ObjInOut);
|
||||
|
||||
/**
|
||||
* A reference to an orc::DumpObjects object.
|
||||
|
|
|
@ -524,7 +524,7 @@ void LLVMOrcObjectTransformLayerSetTransform(
|
|||
->setTransform([TransformFunction, Ctx](std::unique_ptr<MemoryBuffer> Obj)
|
||||
-> Expected<std::unique_ptr<MemoryBuffer>> {
|
||||
LLVMMemoryBufferRef ObjBuffer = wrap(Obj.release());
|
||||
if (LLVMErrorRef Err = TransformFunction(&ObjBuffer, Ctx)) {
|
||||
if (LLVMErrorRef Err = TransformFunction(Ctx, &ObjBuffer)) {
|
||||
assert(!ObjBuffer && "ObjBuffer was not reset to null on error");
|
||||
return unwrap(Err);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue