summaryrefslogtreecommitdiff
path: root/lib/Debugger
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-07-18 00:44:37 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-07-18 00:44:37 +0000
commit518310cb0d136906ff0a99d7a24cb460794de5bf (patch)
treed8ad6b32edf261c90ce2c190f4c74dc3d044502f /lib/Debugger
parent593eb952281138e1877adbfb11b88b6e32fdd732 (diff)
downloadllvm-518310cb0d136906ff0a99d7a24cb460794de5bf.tar.gz
llvm-518310cb0d136906ff0a99d7a24cb460794de5bf.tar.bz2
llvm-518310cb0d136906ff0a99d7a24cb460794de5bf.tar.xz
bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Debugger')
-rw-r--r--lib/Debugger/ProgramInfo.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/Debugger/ProgramInfo.cpp b/lib/Debugger/ProgramInfo.cpp
index a3e55a3aef..c08a8aaa64 100644
--- a/lib/Debugger/ProgramInfo.cpp
+++ b/lib/Debugger/ProgramInfo.cpp
@@ -61,8 +61,8 @@ static std::string getStringValue(Value *V, unsigned Offset = 0) {
}
}
} else if (Constant *C = dyn_cast<Constant>(V)) {
- if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(C))
- return getStringValue(CPR->getValue(), Offset);
+ if (GlobalValue *GV = dyn_cast<GlobalValue>(C))
+ return getStringValue(GV, Offset);
else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
if (CE->getOpcode() == Instruction::GetElementPtr) {
// Turn a gep into the specified offset.
@@ -108,8 +108,6 @@ static const GlobalVariable *getNextStopPoint(const Value *V, unsigned &LineNo,
if (const ConstantInt *C = dyn_cast<ConstantInt>(CI->getOperand(3)))
CurColNo = C->getRawValue();
const Value *Op = CI->getOperand(4);
- if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(Op))
- Op = CPR->getValue();
if ((CurDesc = dyn_cast<GlobalVariable>(Op)) &&
(LineNo < LastLineNo ||
@@ -192,11 +190,9 @@ SourceFunctionInfo::SourceFunctionInfo(ProgramInfo &PI,
if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Desc->getInitializer()))
if (CS->getNumOperands() > 2) {
// Entry #1 is the file descriptor.
- if (const ConstantPointerRef *CPR =
- dyn_cast<ConstantPointerRef>(CS->getOperand(1)))
- if (const GlobalVariable *GV =
- dyn_cast<GlobalVariable>(CPR->getValue()))
- SourceFile = &PI.getSourceFile(GV);
+ if (const GlobalVariable *GV =
+ dyn_cast<GlobalVariable>(CS->getOperand(1)))
+ SourceFile = &PI.getSourceFile(GV);
// Entry #2 is the function name.
Name = getStringValue(CS->getOperand(2));
@@ -366,9 +362,9 @@ ProgramInfo::getFunction(const GlobalVariable *Desc) {
if (Desc && Desc->hasInitializer())
if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Desc->getInitializer()))
if (CS->getNumOperands() > 0)
- if (const ConstantPointerRef *CPR =
- dyn_cast<ConstantPointerRef>(CS->getOperand(1)))
- SourceFileDesc = dyn_cast<GlobalVariable>(CPR->getValue());
+ if (const GlobalVariable *GV =
+ dyn_cast<GlobalVariable>(CS->getOperand(1)))
+ SourceFileDesc = GV;
const SourceLanguage &Lang = getSourceFile(SourceFileDesc).getLanguage();
return *(Result = Lang.createSourceFunctionInfo(Desc, *this));