Handle new forms of llvm.dbg intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26988 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Debugger/ProgramInfo.cpp b/lib/Debugger/ProgramInfo.cpp
index 9ed0db2..3bbb0ec 100644
--- a/lib/Debugger/ProgramInfo.cpp
+++ b/lib/Debugger/ProgramInfo.cpp
@@ -16,6 +16,7 @@
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Intrinsics.h"
+#include "llvm/IntrinsicInst.h"
 #include "llvm/Instructions.h"
 #include "llvm/Module.h"
 #include "llvm/Debugger/SourceFile.h"
@@ -57,17 +58,15 @@
       // Infinite loops == bad, ignore PHI nodes.
       ShouldRecurse = false;
     } else if (const CallInst *CI = dyn_cast<CallInst>(*UI)) {
+      
       // If we found a stop point, check to see if it is earlier than what we
       // already have.  If so, remember it.
       if (const Function *F = CI->getCalledFunction())
-        if (F->getIntrinsicID() == Intrinsic::dbg_stoppoint) {
-          unsigned CurLineNo = ~0, CurColNo = ~0;
+        if (const DbgStopPointInst *SPI = dyn_cast<DbgStopPointInst>(CI)) {
+          unsigned CurLineNo = SPI->getLine();
+          unsigned CurColNo = SPI->getColumn();
           const GlobalVariable *CurDesc = 0;
-          if (const ConstantInt *C = dyn_cast<ConstantInt>(CI->getOperand(1)))
-            CurLineNo = C->getRawValue();
-          if (const ConstantInt *C = dyn_cast<ConstantInt>(CI->getOperand(2)))
-            CurColNo = C->getRawValue();
-          const Value *Op = CI->getOperand(3);
+          const Value *Op = SPI->getContext();
 
           if ((CurDesc = dyn_cast<GlobalVariable>(Op)) &&
               (LineNo < LastLineNo ||
@@ -78,7 +77,6 @@
           }
           ShouldRecurse = false;
         }
-
     }
 
     // If this is not a phi node or a stopping point, recursively scan the users