mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Fix PR1679, by printing GEP indices as signed values instead of unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42239 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d40bc4ad43
commit
96b207c380
@ -1238,6 +1238,7 @@ void CWriter::writeOperandWithCast(Value* Operand, unsigned Opcode) {
|
||||
shouldCast = true;
|
||||
castIsSigned = false;
|
||||
break;
|
||||
case Instruction::GetElementPtr:
|
||||
case Instruction::AShr:
|
||||
case Instruction::SDiv:
|
||||
case Instruction::SRem: // Cast to signed first
|
||||
@ -2859,7 +2860,7 @@ void CWriter::printIndexingExpression(Value *Ptr, gep_type_iterator I,
|
||||
Out << ".field" << cast<ConstantInt>(I.getOperand())->getZExtValue();
|
||||
} else {
|
||||
Out << '[';
|
||||
writeOperand(I.getOperand());
|
||||
writeOperandWithCast(I.getOperand(), Instruction::GetElementPtr);
|
||||
Out << ']';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user