From cb3fb5d4f5902d6759a27e04521a4a30b8fef7e7 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sun, 18 Jul 2004 00:44:37 +0000 Subject: bug 122: - Replace ConstantPointerRef usage with GlobalValue usage llvm-svn: 14953 --- llvm/lib/Debugger/ProgramInfo.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'llvm/lib/Debugger/ProgramInfo.cpp') diff --git a/llvm/lib/Debugger/ProgramInfo.cpp b/llvm/lib/Debugger/ProgramInfo.cpp index a3e55a3aef1..c08a8aaa647 100644 --- a/llvm/lib/Debugger/ProgramInfo.cpp +++ b/llvm/lib/Debugger/ProgramInfo.cpp @@ -61,8 +61,8 @@ static std::string getStringValue(Value *V, unsigned Offset = 0) { } } } else if (Constant *C = dyn_cast(V)) { - if (ConstantPointerRef *CPR = dyn_cast(C)) - return getStringValue(CPR->getValue(), Offset); + if (GlobalValue *GV = dyn_cast(C)) + return getStringValue(GV, Offset); else if (ConstantExpr *CE = dyn_cast(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(CI->getOperand(3))) CurColNo = C->getRawValue(); const Value *Op = CI->getOperand(4); - if (const ConstantPointerRef *CPR = dyn_cast(Op)) - Op = CPR->getValue(); if ((CurDesc = dyn_cast(Op)) && (LineNo < LastLineNo || @@ -192,11 +190,9 @@ SourceFunctionInfo::SourceFunctionInfo(ProgramInfo &PI, if (ConstantStruct *CS = dyn_cast(Desc->getInitializer())) if (CS->getNumOperands() > 2) { // Entry #1 is the file descriptor. - if (const ConstantPointerRef *CPR = - dyn_cast(CS->getOperand(1))) - if (const GlobalVariable *GV = - dyn_cast(CPR->getValue())) - SourceFile = &PI.getSourceFile(GV); + if (const GlobalVariable *GV = + dyn_cast(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(Desc->getInitializer())) if (CS->getNumOperands() > 0) - if (const ConstantPointerRef *CPR = - dyn_cast(CS->getOperand(1))) - SourceFileDesc = dyn_cast(CPR->getValue()); + if (const GlobalVariable *GV = + dyn_cast(CS->getOperand(1))) + SourceFileDesc = GV; const SourceLanguage &Lang = getSourceFile(SourceFileDesc).getLanguage(); return *(Result = Lang.createSourceFunctionInfo(Desc, *this)); -- cgit v1.2.3