[llvm-commits] [llvm] r42239 - /llvm/trunk/lib/Target/CBackend/CBackend.cpp

Chris Lattner sabre at nondot.org
Sat Sep 22 13:16:51 PDT 2007


Author: lattner
Date: Sat Sep 22 15:16:48 2007
New Revision: 42239

URL: http://llvm.org/viewvc/llvm-project?rev=42239&view=rev
Log:
Fix PR1679, by printing GEP indices as signed values instead of unsigned.

Modified:
    llvm/trunk/lib/Target/CBackend/CBackend.cpp

Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=42239&r1=42238&r2=42239&view=diff

==============================================================================
--- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
+++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Sat Sep 22 15:16:48 2007
@@ -1238,6 +1238,7 @@
       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 @@
       Out << ".field" << cast<ConstantInt>(I.getOperand())->getZExtValue();
     } else {
       Out << '[';
-      writeOperand(I.getOperand());
+      writeOperandWithCast(I.getOperand(), Instruction::GetElementPtr);
       Out << ']';
     }
 }





More information about the llvm-commits mailing list