1 //===------ JITDwarfEmitter.h - Write dwarf tables into memory ------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
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
22 class MachineFunction;
23 class MachineModuleInfo;
27 class TargetRegisterInfo;
29 class JITDwarfEmitter {
32 const TargetRegisterInfo* RI;
33 MachineModuleInfo* MMI;
35 bool stackGrowthDirection;
37 unsigned char* EmitExceptionTable(MachineFunction* MF,
38 unsigned char* StartFunction,
39 unsigned char* EndFunction) const;
41 void EmitFrameMoves(intptr_t BaseLabelPtr,
42 const std::vector<MachineMove> &Moves) const;
44 unsigned char* EmitCommonEHFrame(const Function* Personality) const;
46 unsigned char* EmitEHFrame(const Function* Personality,
47 unsigned char* StartBufferPtr,
48 unsigned char* StartFunction,
49 unsigned char* EndFunction,
50 unsigned char* ExceptionTable) const;
52 unsigned GetExceptionTableSizeInBytes(MachineFunction* MF) const;
55 GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr,
56 const std::vector<MachineMove> &Moves) const;
58 unsigned GetCommonEHFrameSizeInBytes(const Function* Personality) const;
60 unsigned GetEHFrameSizeInBytes(const Function* Personality,
61 unsigned char* StartFunction) const;
65 JITDwarfEmitter(JIT& jit);
67 unsigned char* EmitDwarfTable(MachineFunction& F,
69 unsigned char* StartFunction,
70 unsigned char* EndFunction,
71 unsigned char* &EHFramePtr);
74 unsigned GetDwarfTableSizeInBytes(MachineFunction& F,
76 unsigned char* StartFunction,
77 unsigned char* EndFunction);
79 void setModuleInfo(MachineModuleInfo* Info) {
85 } // end namespace llvm
87 #endif // LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H