[llvm-commits] CVS: llvm/lib/Transforms/LevelRaise.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Jan 8 23:45:02 PST 2004


Changes in directory llvm/lib/Transforms:

LevelRaise.cpp updated: 1.90 -> 1.91

---
Log message:

Inching towards fixing PR82


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

Index: llvm/lib/Transforms/LevelRaise.cpp
diff -u llvm/lib/Transforms/LevelRaise.cpp:1.90 llvm/lib/Transforms/LevelRaise.cpp:1.91
--- llvm/lib/Transforms/LevelRaise.cpp:1.90	Tue Dec 23 01:43:38 2003
+++ llvm/lib/Transforms/LevelRaise.cpp	Thu Jan  8 23:44:50 2004
@@ -372,6 +372,7 @@
           std::vector<Value*> Indices;
           Indices.push_back(ConstantSInt::get(Type::LongTy, 0));
           while (CurCTy && !isa<PointerType>(CurCTy)) {
+            const Type *IdxType;
             if (const StructType *CurSTy = dyn_cast<StructType>(CurCTy)) {
               // Check for a zero element struct type... if we have one, bail.
               if (CurSTy->getElementTypes().size() == 0) break;
@@ -380,12 +381,14 @@
               // offset zero in the struct.
               //
               ElTy = CurSTy->getElementTypes()[0];
+              IdxType = Type::UByteTy;   // FIXME when PR82 is fixed.
             } else {
               ElTy = cast<ArrayType>(CurCTy)->getElementType();
+              IdxType = Type::LongTy;    // FIXME when PR82 is fixed.
             }
 
             // Insert a zero to index through this type...
-            Indices.push_back(Constant::getNullValue(CurCTy->getIndexType()));
+            Indices.push_back(Constant::getNullValue(IdxType));
 
             // Did we find what we're looking for?
             if (ElTy->isLosslesslyConvertibleTo(DestPointedTy)) break;





More information about the llvm-commits mailing list