LEFT | RIGHT |
1 //===- JITEventListener.h - Exposes events from JIT compilation -*- C++ -*-===// | 1 //===- JITEventListener.h - Exposes events from JIT compilation -*- C++ -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines the JITEventListener interface, which lets users get | 10 // This file defines the JITEventListener interface, which lets users get |
11 // callbacks when significant events happen during the JIT compilation process. | 11 // callbacks when significant events happen during the JIT compilation process. |
12 // | 12 // |
13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
14 | 14 |
15 #ifndef LLVM_EXECUTION_ENGINE_JIT_EVENTLISTENER_H | 15 #ifndef LLVM_EXECUTION_ENGINE_JIT_EVENTLISTENER_H |
16 #define LLVM_EXECUTION_ENGINE_JIT_EVENTLISTENER_H | 16 #define LLVM_EXECUTION_ENGINE_JIT_EVENTLISTENER_H |
17 | 17 |
18 #include "llvm/CodeGen/MachineFunction.h" | |
19 #include "llvm/Support/DataTypes.h" | 18 #include "llvm/Support/DataTypes.h" |
20 #include "llvm/Support/DebugLoc.h" | 19 #include "llvm/Support/DebugLoc.h" |
21 | 20 |
22 #include <vector> | 21 #include <vector> |
23 | 22 |
24 namespace llvm { | 23 namespace llvm { |
25 class Function; | 24 class Function; |
| 25 class MachineFunction; |
26 | 26 |
27 /// Empty for now, but this object will contain all details about the generated | 27 /// Empty for now, but this object will contain all details about the |
28 /// machine code that a Listener might care about. | 28 /// generated machine code that a Listener might care about. |
29 struct JITEvent_EmittedFunctionDetails { | 29 struct JITEvent_EmittedFunctionDetails { |
30 const MachineFunction *MF; | 30 const MachineFunction *MF; |
31 | 31 |
32 struct LineStart { | 32 struct LineStart { |
33 // The address at which the current line changes. | 33 // The address at which the current line changes. |
34 uintptr_t Address; | 34 uintptr_t Address; |
35 // The new location information. These can be translated to | 35 // The new location information. These can be translated to |
36 // DebugLocTuples using MF->getDebugLocTuple(). | 36 // DebugLocTuples using MF->getDebugLocTuple(). |
37 DebugLoc Loc; | 37 DebugLoc Loc; |
38 }; | 38 }; |
39 // This holds line boundary information in sorted order. | 39 // This holds line boundary information sorted by address. |
40 std::vector<LineStart> LineStarts; | 40 std::vector<LineStart> LineStarts; |
41 }; | 41 }; |
42 | 42 |
43 /// JITEventListener - This interface is used by the JIT to notify clients about | 43 /// JITEventListener - This interface is used by the JIT to notify clients about |
44 /// significant events during compilation. For example, we could have | 44 /// significant events during compilation. For example, we could have |
45 /// implementations for profilers and debuggers that need to know where | 45 /// implementations for profilers and debuggers that need to know where |
46 /// functions have been emitted. | 46 /// functions have been emitted. |
47 /// | 47 /// |
48 /// Each method defaults to doing nothing, so you only need to override the ones | 48 /// Each method defaults to doing nothing, so you only need to override the ones |
49 /// you care about. | 49 /// you care about. |
(...skipping 17 matching lines...) Expand all Loading... |
67 virtual void NotifyFreeingMachineCode(const Function &F, void *OldPtr) {} | 67 virtual void NotifyFreeingMachineCode(const Function &F, void *OldPtr) {} |
68 }; | 68 }; |
69 | 69 |
70 // These return NULL if support isn't available. | 70 // These return NULL if support isn't available. |
71 JITEventListener *createMacOSJITEventListener(); | 71 JITEventListener *createMacOSJITEventListener(); |
72 JITEventListener *createOProfileJITEventListener(); | 72 JITEventListener *createOProfileJITEventListener(); |
73 | 73 |
74 } // end namespace llvm. | 74 } // end namespace llvm. |
75 | 75 |
76 #endif | 76 #endif |
LEFT | RIGHT |