Add 8-bit regclass and pattern for sext_inreg
[llvm/msp430.git] / lib / Target / X86 / X86JITInfo.h
blob9affa3176b2dfbf7a4278fd2420b7ec9bf470d65
1 //===- X86JITInfo.h - X86 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 X86 implementation of the TargetJITInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef X86JITINFO_H
15 #define X86JITINFO_H
17 #include "llvm/Function.h"
18 #include "llvm/Target/TargetJITInfo.h"
20 namespace llvm {
21 class X86TargetMachine;
23 class X86JITInfo : public TargetJITInfo {
24 X86TargetMachine &TM;
25 uintptr_t PICBase;
26 char* TLSOffset;
27 public:
28 explicit X86JITInfo(X86TargetMachine &tm) : TM(tm) {
29 useGOT = 0;
30 TLSOffset = 0;
33 /// replaceMachineCodeForFunction - Make it so that calling the function
34 /// whose machine code is at OLD turns into a call to NEW, perhaps by
35 /// overwriting OLD with a branch to NEW. This is used for self-modifying
36 /// code.
37 ///
38 virtual void replaceMachineCodeForFunction(void *Old, void *New);
40 /// emitGlobalValueIndirectSym - Use the specified MachineCodeEmitter object
41 /// to emit an indirect symbol which contains the address of the specified
42 /// ptr.
43 virtual void *emitGlobalValueIndirectSym(const GlobalValue* GV, void *ptr,
44 MachineCodeEmitter &MCE);
46 /// emitFunctionStub - Use the specified MachineCodeEmitter 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 MachineCodeEmitter &MCE);
52 /// emitFunctionStubAtAddr - Use the specified MachineCodeEmitter object to
53 /// emit a small native function that simply calls Fn. Emit the stub into
54 /// the supplied buffer.
55 virtual void emitFunctionStubAtAddr(const Function* F, void *Fn,
56 void *Buffer, MachineCodeEmitter &MCE);
58 /// getPICJumpTableEntry - Returns the value of the jumptable entry for the
59 /// specific basic block.
60 virtual uintptr_t getPICJumpTableEntry(uintptr_t BB, uintptr_t JTBase);
62 /// getLazyResolverFunction - Expose the lazy resolver to the JIT.
63 virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn);
65 /// relocate - Before the JIT can run a block of code that has been emitted,
66 /// it must rewrite the code to contain the actual addresses of any
67 /// referenced global symbols.
68 virtual void relocate(void *Function, MachineRelocation *MR,
69 unsigned NumRelocs, unsigned char* GOTBase);
71 /// allocateThreadLocalMemory - Each target has its own way of
72 /// handling thread local variables. This method returns a value only
73 /// meaningful to the target.
74 virtual char* allocateThreadLocalMemory(size_t size);
76 /// setPICBase / getPICBase - Getter / setter of PICBase, used to compute
77 /// PIC jumptable entry.
78 void setPICBase(uintptr_t Base) { PICBase = Base; }
79 uintptr_t getPICBase() const { return PICBase; }
83 #endif