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 | 9cc1a0e40dfa4b8eda1f8a5befaef25cdd32b0f4 (patch) | |
tree | c62512dbeedf524b1bf0b7a9f520c0721a4af4b3 /llvm/lib/Transforms/LevelRaise.cpp | |
parent | bc39a1a8c440074e3c4f8964fceb3cc12fc8e3d1 (diff) | |
download | bcm5719-llvm-9cc1a0e40dfa4b8eda1f8a5befaef25cdd32b0f4.tar.gz bcm5719-llvm-9cc1a0e40dfa4b8eda1f8a5befaef25cdd32b0f4.zip |
Inching towards fixing PR82
llvm-svn: 10722
Diffstat (limited to 'llvm/lib/Transforms/LevelRaise.cpp')
-rw-r--r-- | llvm/lib/Transforms/LevelRaise.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/LevelRaise.cpp b/llvm/lib/Transforms/LevelRaise.cpp index d76beee56f9..41a47749f79 100644 --- a/llvm/lib/Transforms/LevelRaise.cpp +++ b/llvm/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; |