Allow targets to implement relocation support.
authorChris Lattner <sabre@nondot.org>
Sat, 20 Nov 2004 03:43:27 +0000 (03:43 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 20 Nov 2004 03:43:27 +0000 (03:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18032 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetJITInfo.h

index 02571ece453846d37bac6fbfc6a11879fa6971f2..3f609c2bc231cdd3c1dac84fa24050a939b16097 100644 (file)
 #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