Revert "Follow-up to r205973: change the return type to const MDNode*."
authorAdrian Prantl <aprantl@apple.com>
Thu, 10 Apr 2014 18:37:53 +0000 (18:37 +0000)
committerAdrian Prantl <aprantl@apple.com>
Thu, 10 Apr 2014 18:37:53 +0000 (18:37 +0000)
This reverts commit r205974, it turns out that this wasn't such a great idea
after all. Using DIVariable as return value is self-documenting and marginally
more type safe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205979 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h

index cb85ca897871d9791c2641d529b04a96c0a300f8..9e815623a780172be3a051188e130919dc4fb832 100644 (file)
@@ -246,9 +246,10 @@ public:
 
   /// getDebugVariable() - Return the debug variable referenced by
   /// this DBG_VALUE instruction.
-  const MDNode *getDebugVariable() const {
+  DIVariable getDebugVariable() const {
     assert(isDebugValue() && "not a DBG_VALUE");
-    return getOperand(getNumOperands() - 1).getMetadata();
+    const MDNode *Var = getOperand(getNumOperands() - 1).getMetadata();
+    return DIVariable(Var);
   }
 
   /// emitError - Emit an error referring to the source location of this