[llvm-commits] CVS: llvm/lib/Bytecode/Reader/InstructionReader.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Jan 8 23:43:01 PST 2004


Changes in directory llvm/lib/Bytecode/Reader:

InstructionReader.cpp updated: 1.64 -> 1.65

---
Log message:

Inching our way towards fixing PR82


---
Diffs of the changes:  (+4 -1)

Index: llvm/lib/Bytecode/Reader/InstructionReader.cpp
diff -u llvm/lib/Bytecode/Reader/InstructionReader.cpp:1.64 llvm/lib/Bytecode/Reader/InstructionReader.cpp:1.65
--- llvm/lib/Bytecode/Reader/InstructionReader.cpp:1.64	Wed Nov 19 11:21:11 2003
+++ llvm/lib/Bytecode/Reader/InstructionReader.cpp	Thu Jan  8 23:42:34 2004
@@ -354,7 +354,10 @@
     for (unsigned i = 1, e = Args.size(); i != e; ++i) {
       const CompositeType *TopTy = dyn_cast_or_null<CompositeType>(NextTy);
       if (!TopTy) throw std::string("Invalid getelementptr instruction!"); 
-      Idx.push_back(getValue(TopTy->getIndexType()->getPrimitiveID(), Args[i]));
+      // FIXME: when PR82 is resolved.
+      unsigned IdxTy = isa<StructType>(TopTy) ? Type::UByteTyID :Type::LongTyID;
+        
+      Idx.push_back(getValue(IdxTy, Args[i]));
       NextTy = GetElementPtrInst::getIndexedType(InstTy, Idx, true);
     }
 





More information about the llvm-commits mailing list