diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-20 03:43:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-20 03:43:27 +0000 |
commit | 9da3c56efd98cd9bf55104ca7d484728470eda6a (patch) | |
tree | b76040b57daf7a30e913401b3963816152e00e23 /include | |
parent | e6e7e3aaddd810bcb2ddc526ccc21ac20bb6a004 (diff) | |
download | external_llvm-9da3c56efd98cd9bf55104ca7d484728470eda6a.zip external_llvm-9da3c56efd98cd9bf55104ca7d484728470eda6a.tar.gz external_llvm-9da3c56efd98cd9bf55104ca7d484728470eda6a.tar.bz2 |
Allow targets to implement relocation support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18032 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetJITInfo.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetJITInfo.h b/include/llvm/Target/TargetJITInfo.h index 02571ec..3f609c2 100644 --- a/include/llvm/Target/TargetJITInfo.h +++ b/include/llvm/Target/TargetJITInfo.h @@ -17,10 +17,13 @@ #ifndef LLVM_TARGET_TARGETJITINFO_H #define LLVM_TARGET_TARGETJITINFO_H +#include <cassert> + namespace llvm { class Function; class FunctionPassManager; class MachineCodeEmitter; + class MachineRelocation; /// TargetJITInfo - Target specific information required by the Just-In-Time /// code generator. @@ -49,6 +52,14 @@ namespace llvm { virtual void *getJITStubForFunction(Function *F, MachineCodeEmitter &MCE) { return 0; } + + /// relocate - Before the JIT can run a block of code that has been emitted, + /// it must rewrite the code to contain the actual addresses of any + /// referenced global symbols. + virtual void relocate(void *Function, MachineRelocation *MR, + unsigned NumRelocs) { + assert(NumRelocs == 0 && "This target does not have relocations!"); + } }; } // End llvm namespace |