[llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Sep 10 20:19:00 PDT 2002


Changes in directory llvm/lib/CWriter:

Writer.cpp updated: 1.40 -> 1.41

---
Log message:

  - Change getelementptr instruction to use long indexes instead of uint
    indexes for sequential types.


---
Diffs of the changes:

Index: llvm/lib/CWriter/Writer.cpp
diff -u llvm/lib/CWriter/Writer.cpp:1.40 llvm/lib/CWriter/Writer.cpp:1.41
--- llvm/lib/CWriter/Writer.cpp:1.40	Fri Aug 30 19:29:16 2002
+++ llvm/lib/CWriter/Writer.cpp	Tue Sep 10 20:18:27 2002
@@ -916,7 +916,7 @@
   }
 
   for (; I != E; ++I)
-    if ((*I)->getType() == Type::UIntTy) {
+    if ((*I)->getType() == Type::LongTy) {
       Out << "[((int) (";                 // sign-extend from 32 (to 64) bits
       writeOperand(*I);
       Out << " * sizeof(";
@@ -925,7 +925,7 @@
       printType(cast<PointerType>(Ptr->getType())->getElementType());
       Out << ")]";
     } else {
-      Out << ".field" << cast<ConstantUInt>(*I)->getValue();
+      Out << ".field" << cast<ConstantSInt>(*I)->getValue();
     }
 }
 





More information about the llvm-commits mailing list