make doxygen comment much better. Patch by B. Scott Michel!
[oota-llvm.git] / include / llvm / Target / TargetJITInfo.h
index 4c2e185164fd1e663f95a23a0b6e594469e06187..b80b0558f1e1b676683c20f0c62d6a52194e632e 100644 (file)
@@ -1,10 +1,10 @@
 //===- Target/TargetJITInfo.h - Target Information for JIT ------*- C++ -*-===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file exposes an abstract interface used by the Just-In-Time code
 #define LLVM_TARGET_TARGETJITINFO_H
 
 #include <cassert>
+#include <vector>
 
 namespace llvm {
   class Function;
   class FunctionPassManager;
+  class MachineBasicBlock;
   class MachineCodeEmitter;
   class MachineRelocation;
 
@@ -30,24 +32,20 @@ namespace llvm {
   class TargetJITInfo {
   public:
     virtual ~TargetJITInfo() {}
-    
-    /// addPassesToJITCompile - Add passes to the specified pass manager to
-    /// implement a fast code generator for this target.
-    ///
-    virtual void addPassesToJITCompile(FunctionPassManager &PM) = 0;
-    
+
     /// replaceMachineCodeForFunction - Make it so that calling the function
     /// whose machine code is at OLD turns into a call to NEW, perhaps by
     /// overwriting OLD with a branch to NEW.  This is used for self-modifying
     /// code.
     ///
     virtual void replaceMachineCodeForFunction(void *Old, void *New) = 0;
-    
+
     /// emitFunctionStub - Use the specified MachineCodeEmitter object to emit a
     /// small native function that simply calls the function at the specified
     /// address.  Return the address of the resultant function.
     virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) {
       assert(0 && "This target doesn't implement emitFunctionStub!");
+      return 0;
     }
 
     /// LazyResolverFn - This typedef is used to represent the function that
@@ -76,9 +74,16 @@ namespace llvm {
     /// it must rewrite the code to contain the actual addresses of any
     /// referenced global symbols.
     virtual void relocate(void *Function, MachineRelocation *MR,
-                          unsigned NumRelocs) {
+                          unsigned NumRelocs, unsigned char* GOTBase) {
       assert(NumRelocs == 0 && "This target does not have relocations!");
     }
+
+    /// needsGOT - Allows a target to specify that it would like the
+    // JIT to manage a GOT for it.
+    bool needsGOT() const { return useGOT; }
+
+  protected:
+    bool useGOT;
   };
 } // End llvm namespace