blob: 30956820f357ec430121312f285e22b33f036e0f [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;
Bruno Cardoso Lopesa3f99f92009-05-30 20:51:52 +000021class JITCodeEmitter;
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000022class MachineFunction;
23class MachineModuleInfo;
24class MachineMove;
25class TargetData;
26class TargetMachine;
27class TargetRegisterInfo;
28
29class JITDwarfEmitter {
30 const TargetData* TD;
Bruno Cardoso Lopesa3f99f92009-05-30 20:51:52 +000031 JITCodeEmitter* JCE;
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000032 const TargetRegisterInfo* RI;
33 MachineModuleInfo* MMI;
34 JIT& Jit;
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000035 bool stackGrowthDirection;
36
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000037 unsigned char* EmitExceptionTable(MachineFunction* MF,
38 unsigned char* StartFunction,
Nicolas Geoffray5913e6c2008-04-20 17:44:19 +000039 unsigned char* EndFunction) const;
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000040
41 void EmitFrameMoves(intptr_t BaseLabelPtr,
Nicolas Geoffray5913e6c2008-04-20 17:44:19 +000042 const std::vector<MachineMove> &Moves) const;
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000043
Nicolas Geoffray5913e6c2008-04-20 17:44:19 +000044 unsigned char* EmitCommonEHFrame(const Function* Personality) const;
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000045
46 unsigned char* EmitEHFrame(const Function* Personality,
47 unsigned char* StartBufferPtr,
48 unsigned char* StartFunction,
49 unsigned char* EndFunction,
Nicolas Geoffray5913e6c2008-04-20 17:44:19 +000050 unsigned char* ExceptionTable) const;
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000051
Nicolas Geoffraydc17ab22008-04-18 20:59:31 +000052public:
53
54 JITDwarfEmitter(JIT& jit);
55
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000056 unsigned char* EmitDwarfTable(MachineFunction& F,
Bruno Cardoso Lopesa3f99f92009-05-30 20:51:52 +000057 JITCodeEmitter& JCE,
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000058 unsigned char* StartFunction,
Reid Kleckner27632172009-09-20 23:52:43 +000059 unsigned char* EndFunction,
60 unsigned char* &EHFramePtr);
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000061
Nicolas Geoffraydc17ab22008-04-18 20:59:31 +000062
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000063 void setModuleInfo(MachineModuleInfo* Info) {
64 MMI = Info;
65 }
66};
67
Nicolas Geoffraydc17ab22008-04-18 20:59:31 +000068
Nicolas Geoffrayafe6c2b2008-02-13 18:39:37 +000069} // end namespace llvm
70
71#endif // LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H