- Replace ConstantPointerRef usage with GlobalValue usage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14953 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2004-07-18 00:44:37 +00:00
parent 593eb95228
commit 518310cb0d
19 changed files with 54 additions and 78 deletions

View File

@@ -620,8 +620,8 @@ void CWriter::printConstant(Constant *CPV) {
printType(Out, CPV->getType());
Out << ")/*NULL*/0)";
break;
} else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CPV)) {
writeOperand(CPR->getValue());
} else if (GlobalValue *GV = dyn_cast<GlobalValue>(CPV)) {
writeOperand(GV);
break;
}
// FALL THROUGH
@@ -641,7 +641,8 @@ void CWriter::writeOperandInternal(Value *Operand) {
return;
}
if (Constant *CPV = dyn_cast<Constant>(Operand)) {
Constant* CPV = dyn_cast<Constant>(Operand);
if (CPV && !isa<GlobalValue>(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<GlobalValue>(Ptr)) {
HasImplicitAddress = true;
} else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(Ptr)) {
HasImplicitAddress = true;
Ptr = CPR->getValue(); // Get to the global...
} else if (isDirectAlloca(Ptr)) {
HasImplicitAddress = true;
}