aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/MachineCodeEmitter.h7
-rw-r--r--include/llvm/ExecutionEngine/ExecutionEngine.h8
-rw-r--r--include/llvm/ExecutionEngine/JITMemoryManager.h11
-rw-r--r--include/llvm/Target/TargetJITInfo.h8
4 files changed, 34 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineCodeEmitter.h b/include/llvm/CodeGen/MachineCodeEmitter.h
index 1161704490..226c4c2ad8 100644
--- a/include/llvm/CodeGen/MachineCodeEmitter.h
+++ b/include/llvm/CodeGen/MachineCodeEmitter.h
@@ -82,6 +82,13 @@ public:
virtual void startGVStub(const GlobalValue* GV, unsigned StubSize,
unsigned Alignment = 1) = 0;
+ /// startGVStub - This callback is invoked when the JIT needs the address of a
+ /// GV (e.g. function) that has not been code generated yet. Buffer points to
+ /// memory already allocated for this stub.
+ ///
+ virtual void startGVStub(const GlobalValue* GV, void *Buffer,
+ unsigned StubSize) = 0;
+
/// finishGVStub - This callback is invoked to terminate a GV stub.
///
virtual void *finishGVStub(const GlobalValue* F) = 0;
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h
index 3559ede31c..0c53a53e75 100644
--- a/include/llvm/ExecutionEngine/ExecutionEngine.h
+++ b/include/llvm/ExecutionEngine/ExecutionEngine.h
@@ -66,6 +66,7 @@ class ExecutionEngine {
bool LazyCompilationDisabled;
bool GVCompilationDisabled;
bool SymbolSearchingDisabled;
+ bool DlsymStubsEnabled;
protected:
/// Modules - This is a list of ModuleProvider's that we are JIT'ing from. We
@@ -288,6 +289,13 @@ public:
return SymbolSearchingDisabled;
}
+ /// EnableDlsymStubs -
+ void EnableDlsymStubs(bool Enabled = true) {
+ DlsymStubsEnabled = Enabled;
+ }
+ bool areDlsymStubsEnabled() const {
+ return DlsymStubsEnabled;
+ }
/// InstallLazyFunctionCreator - If an unknown function is needed, the
/// specified function pointer is invoked to create it. If it returns null,
diff --git a/include/llvm/ExecutionEngine/JITMemoryManager.h b/include/llvm/ExecutionEngine/JITMemoryManager.h
index 61c34434c2..581300e6e3 100644
--- a/include/llvm/ExecutionEngine/JITMemoryManager.h
+++ b/include/llvm/ExecutionEngine/JITMemoryManager.h
@@ -62,6 +62,17 @@ public:
/// return a pointer to its base.
virtual unsigned char *getGOTBase() const = 0;
+ /// SetDlsymTable - If the JIT must be able to relocate stubs after they have
+ /// been emitted, potentially because they are being copied to a process
+ /// where external symbols live at different addresses than in the JITing
+ /// process, allocate a table with sufficient information to do so.
+ virtual void SetDlsymTable(void *ptr) = 0;
+
+ /// getDlsymTable - If this is managing a table of entries so that stubs to
+ /// external symbols can be later relocated, this method should return a
+ /// pointer to it.
+ virtual void *getDlsymTable() const = 0;
+
/// NeedsExactSize - If the memory manager requires to know the size of the
/// objects to be emitted
bool NeedsExactSize() const {
diff --git a/include/llvm/Target/TargetJITInfo.h b/include/llvm/Target/TargetJITInfo.h
index 1d06cd790d..ff7dc0bcf7 100644
--- a/include/llvm/Target/TargetJITInfo.h
+++ b/include/llvm/Target/TargetJITInfo.h
@@ -56,6 +56,14 @@ namespace llvm {
assert(0 && "This target doesn't implement emitFunctionStub!");
return 0;
}
+
+ /// emitFunctionStubAtAddr - Use the specified MachineCodeEmitter object to
+ /// emit a small native function that simply calls Fn. Emit the stub into
+ /// the supplied buffer.
+ virtual void emitFunctionStubAtAddr(const Function* F, void *Fn,
+ void *Buffer, MachineCodeEmitter &MCE) {
+ assert(0 && "This target doesn't implement emitFunctionStubAtAddr!");
+ }
/// getPICJumpTableEntry - Returns the value of the jumptable entry for the
/// specific basic block.