From d5b48ca422089a17fa6ba2945d3f8b46fff7d689 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1296 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/TransformInternals.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Transforms/TransformInternals.cpp') diff --git a/lib/Transforms/TransformInternals.cpp b/lib/Transforms/TransformInternals.cpp index ac8181b722..6929a5fb3c 100644 --- a/lib/Transforms/TransformInternals.cpp +++ b/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-18-g5258