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/Target/CBackend/Writer.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'llvm/lib/Target/CBackend/Writer.cpp') diff --git a/llvm/lib/Target/CBackend/Writer.cpp b/llvm/lib/Target/CBackend/Writer.cpp index 139320f6403..c1cd657cf22 100644 --- a/llvm/lib/Target/CBackend/Writer.cpp +++ b/llvm/lib/Target/CBackend/Writer.cpp @@ -620,8 +620,8 @@ void CWriter::printConstant(Constant *CPV) { printType(Out, CPV->getType()); Out << ")/*NULL*/0)"; break; - } else if (ConstantPointerRef *CPR = dyn_cast(CPV)) { - writeOperand(CPR->getValue()); + } else if (GlobalValue *GV = dyn_cast(CPV)) { + writeOperand(GV); break; } // FALL THROUGH @@ -641,7 +641,8 @@ void CWriter::writeOperandInternal(Value *Operand) { return; } - if (Constant *CPV = dyn_cast(Operand)) { + Constant* CPV = dyn_cast(Operand); + if (CPV && !isa(CPV)) { printConstant(CPV); } else { Out << Mang->getValueName(Operand); @@ -1412,9 +1413,6 @@ void CWriter::printIndexingExpression(Value *Ptr, gep_type_iterator I, // If accessing a global value with no indexing, avoid *(&GV) syndrome if (GlobalValue *V = dyn_cast(Ptr)) { HasImplicitAddress = true; - } else if (ConstantPointerRef *CPR = dyn_cast(Ptr)) { - HasImplicitAddress = true; - Ptr = CPR->getValue(); // Get to the global... } else if (isDirectAlloca(Ptr)) { HasImplicitAddress = true; } -- cgit v1.2.3