diff options
author | Chris Lattner <sabre@nondot.org> | 2004-01-09 05:44:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-01-09 05:44:50 +0000 |
commit | 63a917bbc245accd0e020c2f8703f27f37a8579d (patch) | |
tree | ae95a1ae1f85e7d4e0aecc0e26d35880706df61a /lib/Transforms/LevelRaise.cpp | |
parent | 258b5375b4d88759f47d93db06b3dbf321035098 (diff) |
Inching towards fixing PR82
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/LevelRaise.cpp')
-rw-r--r-- | lib/Transforms/LevelRaise.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp index d76beee56f..41a47749f7 100644 --- a/lib/Transforms/LevelRaise.cpp +++ b/lib/Transforms/LevelRaise.cpp @@ -372,6 +372,7 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { 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 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { // 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; |