aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Debugger/ProgramInfo.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-03-23 18:06:46 +0000
committerJim Laskey <jlaskey@mac.com>2006-03-23 18:06:46 +0000
commita8bdac875d7f646d6b997baf6480879859af5f1a (patch)
treea0430a1551f135234a7b0f15e3794d279d7b2157 /llvm/lib/Debugger/ProgramInfo.cpp
parent0cf8ed61cc93010edd79b8f6456897fe5e10d38a (diff)
downloadllvm-a8bdac875d7f646d6b997baf6480879859af5f1a.zip
llvm-a8bdac875d7f646d6b997baf6480879859af5f1a.tar.gz
llvm-a8bdac875d7f646d6b997baf6480879859af5f1a.tar.bz2
Handle new forms of llvm.dbg intrinsics.
llvm-svn: 26988
Diffstat (limited to 'llvm/lib/Debugger/ProgramInfo.cpp')
-rw-r--r--llvm/lib/Debugger/ProgramInfo.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Debugger/ProgramInfo.cpp b/llvm/lib/Debugger/ProgramInfo.cpp
index 9ed0db2..3bbb0ec 100644
--- a/llvm/lib/Debugger/ProgramInfo.cpp
+++ b/llvm/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 @@ static const GlobalVariable *getNextStopPoint(const Value *V, unsigned &LineNo,
// 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 @@ static const GlobalVariable *getNextStopPoint(const Value *V, unsigned &LineNo,
}
ShouldRecurse = false;
}
-
}
// If this is not a phi node or a stopping point, recursively scan the users