1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

Fix the Ocaml bindings for the ExecutionEngine: with the change to build

libraries instead of relinked objects, the interpreter, JIT, and native
target libraries were not being linked in to an ocaml program using the
ExecutionEngine.

llvm-svn: 74117
This commit is contained in:
Bob Wilson 2009-06-24 21:09:18 +00:00
parent a809ad5166
commit 653f309975
6 changed files with 16 additions and 15 deletions

View File

@ -16,6 +16,7 @@
\*===----------------------------------------------------------------------===*/
#include "llvm-c/ExecutionEngine.h"
#include "llvm-c/Target.h"
#include "caml/alloc.h"
#include "caml/custom.h"
#include "caml/fail.h"
@ -23,6 +24,12 @@
#include <string.h>
#include <assert.h>
/* Force the LLVM interpreter, JIT, and native target to be linked in. */
void llvm_initialize(void) {
LLVMLinkInInterpreter();
LLVMLinkInJIT();
LLVMInitializeNativeTarget();
}
/* Can't use the recommended caml_named_value mechanism for backwards
compatibility reasons. This is largely equivalent. */

View File

@ -26,6 +26,9 @@
extern "C" {
#endif
void LLVMLinkInJIT(void);
void LLVMLinkInInterpreter(void);
typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef;
typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef;

View File

@ -18,9 +18,7 @@
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include <cstdlib>
namespace llvm {
extern void LinkInInterpreter();
}
extern "C" void LLVMLinkInInterpreter();
namespace {
struct ForceInterpreterLinking {
@ -32,7 +30,7 @@ namespace {
if (std::getenv("bar") != (char*) -1)
return;
llvm::LinkInInterpreter();
LLVMLinkInInterpreter();
}
} ForceInterpreterLinking;
}

View File

@ -18,9 +18,7 @@
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include <cstdlib>
namespace llvm {
extern void LinkInJIT();
}
extern "C" void LLVMLinkInJIT();
namespace {
struct ForceJITLinking {
@ -32,7 +30,7 @@ namespace {
if (std::getenv("bar") != (char*) -1)
return;
llvm::LinkInJIT();
LLVMLinkInJIT();
}
} ForceJITLinking;
}

View File

@ -29,10 +29,7 @@ static struct RegisterInterp {
}
namespace llvm {
void LinkInInterpreter() {
}
}
extern "C" void LLVMLinkInInterpreter() { }
/// create - Create a new interpreter object. This can never fail.
///

View File

@ -60,9 +60,7 @@ static struct RegisterJIT {
}
namespace llvm {
void LinkInJIT() {
}
extern "C" void LLVMLinkInJIT() {
}