From bae6c00a1576928e7bff5f0ae74c07999112a644 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 20 Nov 2004 03:43:27 +0000 Subject: [PATCH] Allow targets to implement relocation support. llvm-svn: 18032 --- include/llvm/Target/TargetJITInfo.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/llvm/Target/TargetJITInfo.h b/include/llvm/Target/TargetJITInfo.h index 02571ece453..3f609c2bc23 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 + 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