LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SparcJITInfo.h
Go to the documentation of this file.
1 //==- SparcJITInfo.h - Sparc 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 SparcJITInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef SPARCJITINFO_H
15 #define SPARCJITINFO_H
16 
20 
21 namespace llvm {
22 class SparcTargetMachine;
23 
24 class SparcJITInfo : public TargetJITInfo {
25 
26  bool IsPIC;
27 
28  public:
29  explicit SparcJITInfo()
30  : IsPIC(false) {}
31 
32  /// replaceMachineCodeForFunction - Make it so that calling the function
33  /// whose machine code is at OLD turns into a call to NEW, perhaps by
34  /// overwriting OLD with a branch to NEW. This is used for self-modifying
35  /// code.
36  ///
37  virtual void replaceMachineCodeForFunction(void *Old, void *New);
38 
39  // getStubLayout - Returns the size and alignment of the largest call stub
40  // on Sparc.
41  virtual StubLayout getStubLayout();
42 
43 
44  /// emitFunctionStub - Use the specified JITCodeEmitter object to emit a
45  /// small native function that simply calls the function at the specified
46  /// address.
47  virtual void *emitFunctionStub(const Function *F, void *Fn,
48  JITCodeEmitter &JCE);
49 
50  /// getLazyResolverFunction - Expose the lazy resolver to the JIT.
52 
53  /// relocate - Before the JIT can run a block of code that has been emitted,
54  /// it must rewrite the code to contain the actual addresses of any
55  /// referenced global symbols.
56  virtual void relocate(void *Function, MachineRelocation *MR,
57  unsigned NumRelocs, unsigned char *GOTBase);
58 
59  /// Initialize - Initialize internal stage for the function being JITted.
60  void Initialize(const MachineFunction &MF, bool isPIC) {
61  IsPIC = isPIC;
62  }
63 
64 };
65 }
66 
67 #endif
F(f)
virtual StubLayout getStubLayout()
Returns the maximum size and alignment for a call stub on this target.
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)
void Initialize(const MachineFunction &MF, bool isPIC)
Initialize - Initialize internal stage for the function being JITted.
Definition: SparcJITInfo.h:60
virtual void relocate(void *Function, MachineRelocation *MR, unsigned NumRelocs, unsigned char *GOTBase)
virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn)
getLazyResolverFunction - Expose the lazy resolver to the JIT.
virtual void * emitFunctionStub(const Function *F, void *Fn, JITCodeEmitter &JCE)