Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 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 | |
Chandler Carruth | d04a8d4 | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 18 | #include "llvm/Support/DataTypes.h" |
| 19 | #include <vector> |
| 20 | |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 21 | namespace llvm { |
| 22 | |
| 23 | class Function; |
Chandler Carruth | d04a8d4 | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 24 | class JIT; |
Bruno Cardoso Lopes | a3f99f9 | 2009-05-30 20:51:52 +0000 | [diff] [blame] | 25 | class JITCodeEmitter; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 26 | class MachineFunction; |
| 27 | class MachineModuleInfo; |
| 28 | class MachineMove; |
Evan Cheng | 2d28617 | 2011-07-18 22:29:13 +0000 | [diff] [blame] | 29 | class MCAsmInfo; |
Micah Villmow | 3574eca | 2012-10-08 16:38:25 +0000 | [diff] [blame] | 30 | class DataLayout; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 31 | class TargetMachine; |
| 32 | class TargetRegisterInfo; |
| 33 | |
| 34 | class JITDwarfEmitter { |
Micah Villmow | 3574eca | 2012-10-08 16:38:25 +0000 | [diff] [blame] | 35 | const DataLayout* TD; |
Bruno Cardoso Lopes | a3f99f9 | 2009-05-30 20:51:52 +0000 | [diff] [blame] | 36 | JITCodeEmitter* JCE; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 37 | const TargetRegisterInfo* RI; |
Evan Cheng | 2d28617 | 2011-07-18 22:29:13 +0000 | [diff] [blame] | 38 | const MCAsmInfo *MAI; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 39 | MachineModuleInfo* MMI; |
| 40 | JIT& Jit; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 41 | bool stackGrowthDirection; |
Jim Grosbach | 8bf0ecd | 2011-03-22 15:21:58 +0000 | [diff] [blame] | 42 | |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 43 | unsigned char* EmitExceptionTable(MachineFunction* MF, |
Jim Grosbach | 8bf0ecd | 2011-03-22 15:21:58 +0000 | [diff] [blame] | 44 | unsigned char* StartFunction, |
Nicolas Geoffray | 5913e6c | 2008-04-20 17:44:19 +0000 | [diff] [blame] | 45 | unsigned char* EndFunction) const; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 46 | |
Jim Grosbach | 8bf0ecd | 2011-03-22 15:21:58 +0000 | [diff] [blame] | 47 | void EmitFrameMoves(intptr_t BaseLabelPtr, |
Nicolas Geoffray | 5913e6c | 2008-04-20 17:44:19 +0000 | [diff] [blame] | 48 | const std::vector<MachineMove> &Moves) const; |
Jim Grosbach | 8bf0ecd | 2011-03-22 15:21:58 +0000 | [diff] [blame] | 49 | |
Nicolas Geoffray | 5913e6c | 2008-04-20 17:44:19 +0000 | [diff] [blame] | 50 | unsigned char* EmitCommonEHFrame(const Function* Personality) const; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 51 | |
Jim Grosbach | 8bf0ecd | 2011-03-22 15:21:58 +0000 | [diff] [blame] | 52 | unsigned char* EmitEHFrame(const Function* Personality, |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 53 | unsigned char* StartBufferPtr, |
Jim Grosbach | 8bf0ecd | 2011-03-22 15:21:58 +0000 | [diff] [blame] | 54 | unsigned char* StartFunction, |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 55 | unsigned char* EndFunction, |
Nicolas Geoffray | 5913e6c | 2008-04-20 17:44:19 +0000 | [diff] [blame] | 56 | unsigned char* ExceptionTable) const; |
Jim Grosbach | 8bf0ecd | 2011-03-22 15:21:58 +0000 | [diff] [blame] | 57 | |
Nicolas Geoffray | dc17ab2 | 2008-04-18 20:59:31 +0000 | [diff] [blame] | 58 | public: |
Jim Grosbach | 8bf0ecd | 2011-03-22 15:21:58 +0000 | [diff] [blame] | 59 | |
Nicolas Geoffray | dc17ab2 | 2008-04-18 20:59:31 +0000 | [diff] [blame] | 60 | JITDwarfEmitter(JIT& jit); |
Jim Grosbach | 8bf0ecd | 2011-03-22 15:21:58 +0000 | [diff] [blame] | 61 | |
| 62 | unsigned char* EmitDwarfTable(MachineFunction& F, |
Bruno Cardoso Lopes | a3f99f9 | 2009-05-30 20:51:52 +0000 | [diff] [blame] | 63 | JITCodeEmitter& JCE, |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 64 | unsigned char* StartFunction, |
Reid Kleckner | 2763217 | 2009-09-20 23:52:43 +0000 | [diff] [blame] | 65 | unsigned char* EndFunction, |
| 66 | unsigned char* &EHFramePtr); |
Jim Grosbach | 8bf0ecd | 2011-03-22 15:21:58 +0000 | [diff] [blame] | 67 | |
| 68 | |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 69 | void setModuleInfo(MachineModuleInfo* Info) { |
| 70 | MMI = Info; |
| 71 | } |
| 72 | }; |
| 73 | |
Nicolas Geoffray | dc17ab2 | 2008-04-18 20:59:31 +0000 | [diff] [blame] | 74 | |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 75 | } // end namespace llvm |
| 76 | |
| 77 | #endif // LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H |