mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user