From abf40ba6e8da184d6df40289b0825ee756eb567b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 14 Nov 2001 11:02:49 +0000 Subject: Better heuristics for handling arrays llvm-svn: 1296 --- llvm/lib/Transforms/TransformInternals.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/TransformInternals.cpp') diff --git a/llvm/lib/Transforms/TransformInternals.cpp b/llvm/lib/Transforms/TransformInternals.cpp index ac8181b7224..6929a5fb3c0 100644 --- a/llvm/lib/Transforms/TransformInternals.cpp +++ b/llvm/lib/Transforms/TransformInternals.cpp @@ -102,7 +102,7 @@ void ReplaceInstWithInst(BasicBlock::InstListType &BIL, const Type *getStructOffsetType(const Type *Ty, unsigned &Offset, vector &Offsets, bool StopEarly = true) { - if (!isa(Ty) || (Offset == 0 && StopEarly)) { + if (!isa(Ty) || (Offset == 0 && StopEarly && !Offsets.empty())) { Offset = 0; // Return the offset that we were able to acheive return Ty; // Return the leaf type } -- cgit v1.2.3