Merge branch 'master' into msp430
[llvm/msp430.git] / lib / ExecutionEngine / JIT / JITDwarfEmitter.h
blobcf5681e3c1ca8c9566e91c179f74c8778d336dbc
1 //===------ JITDwarfEmitter.h - Write dwarf tables into memory ------------===//
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 defines a JITDwarfEmitter object that is used by the JIT to
11 // write dwarf tables to memory.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
16 #define LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
18 namespace llvm {
20 class Function;
21 class MachineCodeEmitter;
22 class MachineFunction;
23 class MachineModuleInfo;
24 class MachineMove;
25 class TargetData;
26 class TargetMachine;
27 class TargetRegisterInfo;
29 class JITDwarfEmitter {
30 const TargetData* TD;
31 MachineCodeEmitter* MCE;
32 const TargetRegisterInfo* RI;
33 MachineModuleInfo* MMI;
34 JIT& Jit;
35 bool needsIndirectEncoding;
36 bool stackGrowthDirection;
38 unsigned char* EmitExceptionTable(MachineFunction* MF,
39 unsigned char* StartFunction,
40 unsigned char* EndFunction) const;
42 void EmitFrameMoves(intptr_t BaseLabelPtr,
43 const std::vector<MachineMove> &Moves) const;
45 unsigned char* EmitCommonEHFrame(const Function* Personality) const;
47 unsigned char* EmitEHFrame(const Function* Personality,
48 unsigned char* StartBufferPtr,
49 unsigned char* StartFunction,
50 unsigned char* EndFunction,
51 unsigned char* ExceptionTable) const;
53 unsigned GetExceptionTableSizeInBytes(MachineFunction* MF) const;
55 unsigned
56 GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr,
57 const std::vector<MachineMove> &Moves) const;
59 unsigned GetCommonEHFrameSizeInBytes(const Function* Personality) const;
61 unsigned GetEHFrameSizeInBytes(const Function* Personality,
62 unsigned char* StartFunction) const;
64 public:
66 JITDwarfEmitter(JIT& jit);
68 unsigned char* EmitDwarfTable(MachineFunction& F,
69 MachineCodeEmitter& MCE,
70 unsigned char* StartFunction,
71 unsigned char* EndFunction);
74 unsigned GetDwarfTableSizeInBytes(MachineFunction& F,
75 MachineCodeEmitter& MCE,
76 unsigned char* StartFunction,
77 unsigned char* EndFunction);
79 void setModuleInfo(MachineModuleInfo* Info) {
80 MMI = Info;
85 } // end namespace llvm
87 #endif // LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H