blob: 72c9b45b3b70794dcb2b5c5d8cc2af04ff20f8b3 [file] [log] [blame]
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +00001//===------ 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.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
16#define LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
17
18namespace llvm {
19
20class Function;
21class MachineCodeEmitter;
22class MachineFunction;
23class MachineModuleInfo;
24class MachineMove;
25class TargetData;
26class TargetMachine;
27class TargetRegisterInfo;
28
29class JITDwarfEmitter {
30 const TargetData* TD;
31 MachineCodeEmitter* MCE;
32 const TargetRegisterInfo* RI;
33 MachineModuleInfo* MMI;
34 JIT& Jit;
35 bool needsIndirectEncoding;
36 bool stackGrowthDirection;
37
38public:
39 JITDwarfEmitter(JIT& jit);
40
41 unsigned char* EmitExceptionTable(MachineFunction* MF,
42 unsigned char* StartFunction,
43 unsigned char* EndFunction);
44
45 void EmitFrameMoves(intptr_t BaseLabelPtr,
46 const std::vector<MachineMove> &Moves);
47
48 unsigned char* EmitCommonEHFrame(const Function* Personality);
49
50 unsigned char* EmitEHFrame(const Function* Personality,
51 unsigned char* StartBufferPtr,
52 unsigned char* StartFunction,
53 unsigned char* EndFunction,
54 unsigned char* ExceptionTable);
55
56
57 unsigned char* EmitDwarfTable(MachineFunction& F,
58 MachineCodeEmitter& MCE,
59 unsigned char* StartFunction,
60 unsigned char* EndFunction);
61
62 void setModuleInfo(MachineModuleInfo* Info) {
63 MMI = Info;
64 }
65};
66
67} // end namespace llvm
68
69#endif // LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H