//===- OrcV2CBindingsDumpObjects.c - Dump JIT'd objects to disk via C API -===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // To run the demo build 'OrcV2CBindingsDumpObjects', then run the built // program. It will execute as for OrcV2CBindingsBasicUsage, but will write // a single JIT'd object out to the working directory. // // Try experimenting with the DumpDir and IdentifierOverride arguments to // LLVMOrcCreateDumpObjects. // //===----------------------------------------------------------------------===// #include "llvm-c/Core.h" #include "llvm-c/Error.h" #include "llvm-c/LLJIT.h" #include "llvm-c/Support.h" #include "llvm-c/Target.h" #include <stdio.h> int handleError(LLVMErrorRef Err) { … } LLVMOrcThreadSafeModuleRef createDemoModule(void) { … } LLVMErrorRef dumpObjectsTransform(void *Ctx, LLVMMemoryBufferRef *ObjInOut) { … } int main(int argc, const char *argv[]) { … }