• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
16 #define LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
17 
18 #include "llvm/Support/DataTypes.h"
19 #include <vector>
20 
21 namespace llvm {
22 
23 class Function;
24 class JIT;
25 class JITCodeEmitter;
26 class MachineFunction;
27 class MachineModuleInfo;
28 class MachineMove;
29 class MCAsmInfo;
30 class DataLayout;
31 class TargetMachine;
32 class TargetRegisterInfo;
33 
34 class JITDwarfEmitter {
35   const DataLayout* TD;
36   JITCodeEmitter* JCE;
37   const TargetRegisterInfo* RI;
38   const MCAsmInfo *MAI;
39   MachineModuleInfo* MMI;
40   JIT& Jit;
41   bool stackGrowthDirection;
42 
43   unsigned char* EmitExceptionTable(MachineFunction* MF,
44                                     unsigned char* StartFunction,
45                                     unsigned char* EndFunction) const;
46 
47   void EmitFrameMoves(intptr_t BaseLabelPtr,
48                       const std::vector<MachineMove> &Moves) const;
49 
50   unsigned char* EmitCommonEHFrame(const Function* Personality) const;
51 
52   unsigned char* EmitEHFrame(const Function* Personality,
53                              unsigned char* StartBufferPtr,
54                              unsigned char* StartFunction,
55                              unsigned char* EndFunction,
56                              unsigned char* ExceptionTable) const;
57 
58 public:
59 
60   JITDwarfEmitter(JIT& jit);
61 
62   unsigned char* EmitDwarfTable(MachineFunction& F,
63                                 JITCodeEmitter& JCE,
64                                 unsigned char* StartFunction,
65                                 unsigned char* EndFunction,
66                                 unsigned char* &EHFramePtr);
67 
68 
setModuleInfo(MachineModuleInfo * Info)69   void setModuleInfo(MachineModuleInfo* Info) {
70     MMI = Info;
71   }
72 };
73 
74 
75 } // end namespace llvm
76 
77 #endif // LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
78