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 | |
| 18 | namespace llvm { |
| 19 | |
| 20 | class Function; |
Bruno Cardoso Lopes | a3f99f9 | 2009-05-30 20:51:52 +0000 | [diff] [blame] | 21 | class JITCodeEmitter; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 22 | class MachineFunction; |
| 23 | class MachineModuleInfo; |
| 24 | class MachineMove; |
| 25 | class TargetData; |
Anton Korobeynikov | d9e3385 | 2010-11-18 23:25:52 +0000 | [diff] [blame^] | 26 | class TargetFrameInfo; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 27 | class TargetMachine; |
| 28 | class TargetRegisterInfo; |
| 29 | |
| 30 | class JITDwarfEmitter { |
| 31 | const TargetData* TD; |
Bruno Cardoso Lopes | a3f99f9 | 2009-05-30 20:51:52 +0000 | [diff] [blame] | 32 | JITCodeEmitter* JCE; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 33 | const TargetRegisterInfo* RI; |
Anton Korobeynikov | d9e3385 | 2010-11-18 23:25:52 +0000 | [diff] [blame^] | 34 | const TargetFrameInfo *TFI; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 35 | MachineModuleInfo* MMI; |
| 36 | JIT& Jit; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 37 | bool stackGrowthDirection; |
| 38 | |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 39 | unsigned char* EmitExceptionTable(MachineFunction* MF, |
| 40 | unsigned char* StartFunction, |
Nicolas Geoffray | 5913e6c | 2008-04-20 17:44:19 +0000 | [diff] [blame] | 41 | unsigned char* EndFunction) const; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 42 | |
| 43 | void EmitFrameMoves(intptr_t BaseLabelPtr, |
Nicolas Geoffray | 5913e6c | 2008-04-20 17:44:19 +0000 | [diff] [blame] | 44 | const std::vector<MachineMove> &Moves) const; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 45 | |
Nicolas Geoffray | 5913e6c | 2008-04-20 17:44:19 +0000 | [diff] [blame] | 46 | unsigned char* EmitCommonEHFrame(const Function* Personality) const; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 47 | |
| 48 | unsigned char* EmitEHFrame(const Function* Personality, |
| 49 | unsigned char* StartBufferPtr, |
| 50 | unsigned char* StartFunction, |
| 51 | unsigned char* EndFunction, |
Nicolas Geoffray | 5913e6c | 2008-04-20 17:44:19 +0000 | [diff] [blame] | 52 | unsigned char* ExceptionTable) const; |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 53 | |
Nicolas Geoffray | dc17ab2 | 2008-04-18 20:59:31 +0000 | [diff] [blame] | 54 | public: |
| 55 | |
| 56 | JITDwarfEmitter(JIT& jit); |
| 57 | |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 58 | unsigned char* EmitDwarfTable(MachineFunction& F, |
Bruno Cardoso Lopes | a3f99f9 | 2009-05-30 20:51:52 +0000 | [diff] [blame] | 59 | JITCodeEmitter& JCE, |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 60 | unsigned char* StartFunction, |
Reid Kleckner | 2763217 | 2009-09-20 23:52:43 +0000 | [diff] [blame] | 61 | unsigned char* EndFunction, |
| 62 | unsigned char* &EHFramePtr); |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 63 | |
Nicolas Geoffray | dc17ab2 | 2008-04-18 20:59:31 +0000 | [diff] [blame] | 64 | |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 65 | void setModuleInfo(MachineModuleInfo* Info) { |
| 66 | MMI = Info; |
| 67 | } |
| 68 | }; |
| 69 | |
Nicolas Geoffray | dc17ab2 | 2008-04-18 20:59:31 +0000 | [diff] [blame] | 70 | |
Nicolas Geoffray | afe6c2b | 2008-02-13 18:39:37 +0000 | [diff] [blame] | 71 | } // end namespace llvm |
| 72 | |
| 73 | #endif // LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H |