LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MipsJITInfo.h
Go to the documentation of this file.
1 //===- MipsJITInfo.h - Mips Implementation of the JIT Interface -*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declaration of the MipsJITInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef MIPSJITINFO_H
15 #define MIPSJITINFO_H
16 
17 #include "MipsMachineFunction.h"
22 
23 namespace llvm {
24 class MipsTargetMachine;
25 
26 class MipsJITInfo : public TargetJITInfo {
27 
28  bool IsPIC;
29  bool IsLittleEndian;
30 
31  public:
32  explicit MipsJITInfo() :
33  IsPIC(false), IsLittleEndian(true) {}
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);
41 
42  // getStubLayout - Returns the size and alignment of the largest call stub
43  // on Mips.
44  virtual StubLayout getStubLayout();
45 
46  /// emitFunctionStub - Use the specified JITCodeEmitter object to emit a
47  /// small native function that simply calls the function at the specified
48  /// address.
49  virtual void *emitFunctionStub(const Function *F, void *Fn,
50  JITCodeEmitter &JCE);
51 
52  /// getLazyResolverFunction - Expose the lazy resolver to the JIT.
54 
55  /// relocate - Before the JIT can run a block of code that has been emitted,
56  /// it must rewrite the code to contain the actual addresses of any
57  /// referenced global symbols.
58  virtual void relocate(void *Function, MachineRelocation *MR,
59  unsigned NumRelocs, unsigned char *GOTBase);
60 
61  /// Initialize - Initialize internal stage for the function being JITted.
62  void Initialize(const MachineFunction &MF, bool isPIC,
63  bool isLittleEndian) {
64  IsPIC = isPIC;
65  IsLittleEndian = isLittleEndian;
66  }
67 
68 };
69 }
70 
71 #endif
void Initialize(const MachineFunction &MF, bool isPIC, bool isLittleEndian)
Initialize - Initialize internal stage for the function being JITted.
Definition: MipsJITInfo.h:62
F(f)
void *(* JITCompilerFn)(void *)
Definition: TargetJITInfo.h:90
#define false
Definition: ConvertUTF.c:64
void(* LazyResolverFn)()
Definition: TargetJITInfo.h:83
virtual void replaceMachineCodeForFunction(void *Old, void *New)
Definition: MipsJITInfo.cpp:29
#define true
Definition: ConvertUTF.c:65
virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn)
getLazyResolverFunction - Expose the lazy resolver to the JIT.
virtual void * emitFunctionStub(const Function *F, void *Fn, JITCodeEmitter &JCE)
virtual StubLayout getStubLayout()
Returns the maximum size and alignment for a call stub on this target.
virtual void relocate(void *Function, MachineRelocation *MR, unsigned NumRelocs, unsigned char *GOTBase)