Delete the V9 specific findOptimalStorageSize method, inlining it into all callers.
[oota-llvm.git] / include / llvm / Target / TargetJITInfo.h
1 //===- Target/TargetJITInfo.h - Target Information for JIT ------*- C++ -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file exposes an abstract interface used by the Just-In-Time code
11 // generator to perform target-specific activities, such as emitting stubs.  If
12 // a TargetMachine supports JIT code generation, it should provide one of these
13 // objects through the getJITInfo() method.
14 //
15 //===----------------------------------------------------------------------===//
16
17 #ifndef LLVM_TARGET_TARGETJITINFO_H
18 #define LLVM_TARGET_TARGETJITINFO_H
19
20 namespace llvm {
21   class Function;
22   class FunctionPassManager;
23   class MachineCodeEmitter;
24
25   /// TargetJITInfo - Target specific information required by the Just-In-Time
26   /// code generator.
27   struct TargetJITInfo {
28     virtual ~TargetJITInfo() {}
29     
30     /// addPassesToJITCompile - Add passes to the specified pass manager to
31     /// implement a fast code generator for this target.
32     ///
33     virtual void addPassesToJITCompile(FunctionPassManager &PM) = 0;
34     
35     /// replaceMachineCodeForFunction - Make it so that calling the function
36     /// whose machine code is at OLD turns into a call to NEW, perhaps by
37     /// overwriting OLD with a branch to NEW.  This is used for self-modifying
38     /// code.
39     ///
40     virtual void replaceMachineCodeForFunction (void *Old, void *New) = 0;
41     
42     /// getJITStubForFunction - Create or return a stub for the specified
43     /// function.  This stub acts just like the specified function, except that
44     /// it allows the "address" of the function to be taken without having to
45     /// generate code for it.  Targets do not need to implement this method, but
46     /// doing so will allow for faster startup of the JIT.
47     ///
48     virtual void *getJITStubForFunction(Function *F, MachineCodeEmitter &MCE) {
49       return 0;
50     }
51   };
52 } // End llvm namespace
53
54 #endif