diff options
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/CodeGen/MachineCodeEmitter.h | 8 | ||||
-rw-r--r-- | llvm/include/llvm/ExecutionEngine/JITEventListener.h | 15 | ||||
-rw-r--r-- | llvm/include/llvm/Support/DebugLoc.h | 3 |
3 files changed, 25 insertions, 1 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineCodeEmitter.h b/llvm/include/llvm/CodeGen/MachineCodeEmitter.h index ece416c78db..20a9ad78e7e 100644 --- a/llvm/include/llvm/CodeGen/MachineCodeEmitter.h +++ b/llvm/include/llvm/CodeGen/MachineCodeEmitter.h @@ -18,6 +18,7 @@ #define LLVM_CODEGEN_MACHINECODEEMITTER_H #include "llvm/Support/DataTypes.h" +#include "llvm/Support/DebugLoc.h" namespace llvm { @@ -232,7 +233,12 @@ public: (*(uint64_t*)Addr) = (uint64_t)Value; } - + /// processDebugLoc - Records debug location information about a + /// MachineInstruction. This is called before emitting any bytes associated + /// with the instruction. Even if successive instructions have the same debug + /// location, this method will be called for each one. + virtual void processDebugLoc(DebugLoc DL) {} + /// emitLabel - Emits a label virtual void emitLabel(uint64_t LabelID) = 0; diff --git a/llvm/include/llvm/ExecutionEngine/JITEventListener.h b/llvm/include/llvm/ExecutionEngine/JITEventListener.h index 7d42284078a..8d3a1d77f04 100644 --- a/llvm/include/llvm/ExecutionEngine/JITEventListener.h +++ b/llvm/include/llvm/ExecutionEngine/JITEventListener.h @@ -16,13 +16,28 @@ #define LLVM_EXECUTION_ENGINE_JIT_EVENTLISTENER_H #include "llvm/Support/DataTypes.h" +#include "llvm/Support/DebugLoc.h" + +#include <vector> namespace llvm { class Function; +class MachineFunction; /// Empty for now, but this object will contain all details about the /// generated machine code that a Listener might care about. struct JITEvent_EmittedFunctionDetails { + const MachineFunction *MF; + + struct LineStart { + // The address at which the current line changes. + uintptr_t Address; + // The new location information. These can be translated to + // DebugLocTuples using MF->getDebugLocTuple(). + DebugLoc Loc; + }; + // This holds line boundary information sorted by address. + std::vector<LineStart> LineStarts; }; /// JITEventListener - This interface is used by the JIT to notify clients about diff --git a/llvm/include/llvm/Support/DebugLoc.h b/llvm/include/llvm/Support/DebugLoc.h index 5c089efc98c..8ef7e4afc44 100644 --- a/llvm/include/llvm/Support/DebugLoc.h +++ b/llvm/include/llvm/Support/DebugLoc.h @@ -27,6 +27,9 @@ namespace llvm { GlobalVariable *CompileUnit; unsigned Line, Col; + DebugLocTuple() + : CompileUnit(0), Line(~0U), Col(~0U) {}; + DebugLocTuple(GlobalVariable *v, unsigned l, unsigned c) : CompileUnit(v), Line(l), Col(c) {}; |