summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-04-10 17:39:48 +0000
committerAdrian Prantl <aprantl@apple.com>2014-04-10 17:39:48 +0000
commitb7b9bf458b2230a977ad5572b8435bb4a2d0cb13 (patch)
tree767c06da6615dd3fa6c7a3a17b0411908519e798 /include
parentf0aeabb5a61bd2ffeeee9bf6e43c6d21f312c96f (diff)
downloadllvm-b7b9bf458b2230a977ad5572b8435bb4a2d0cb13.tar.gz
llvm-b7b9bf458b2230a977ad5572b8435bb4a2d0cb13.tar.bz2
llvm-b7b9bf458b2230a977ad5572b8435bb4a2d0cb13.tar.xz
Debug info: Factor the retrieving of the DIVariable from a MachineInstr
into a function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/MachineInstr.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index 217d2b1666..9e815623a7 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -24,6 +24,7 @@
#include "llvm/ADT/ilist_node.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/CodeGen/MachineOperand.h"
+#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/MC/MCInstrDesc.h"
@@ -243,6 +244,14 @@ public:
///
DebugLoc getDebugLoc() const { return debugLoc; }
+ /// getDebugVariable() - Return the debug variable referenced by
+ /// this DBG_VALUE instruction.
+ DIVariable getDebugVariable() const {
+ assert(isDebugValue() && "not a DBG_VALUE");
+ const MDNode *Var = getOperand(getNumOperands() - 1).getMetadata();
+ return DIVariable(Var);
+ }
+
/// emitError - Emit an error referring to the source location of this
/// instruction. This should only be used for inline assembly that is somehow
/// impossible to compile. Other errors should have been handled much