aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/TransformInternals.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-11-14 11:02:49 +0000
committerChris Lattner <sabre@nondot.org>2001-11-14 11:02:49 +0000
commitd5b48ca422089a17fa6ba2945d3f8b46fff7d689 (patch)
treeb15922c1bc493fbcc56e16ac2b4963d91845c9f5 /lib/Transforms/TransformInternals.cpp
parent84dce16fb193b46d473dc4165f2ca71bd0f622d1 (diff)
Better heuristics for handling arrays
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/TransformInternals.cpp')
-rw-r--r--lib/Transforms/TransformInternals.cpp2
1 files changed, 1 insertions, 1 deletions
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<ConstPoolVal*> &Offsets,
bool StopEarly = true) {
- if (!isa<StructType>(Ty) || (Offset == 0 && StopEarly)) {
+ if (!isa<StructType>(Ty) || (Offset == 0 && StopEarly && !Offsets.empty())) {
Offset = 0; // Return the offset that we were able to acheive
return Ty; // Return the leaf type
}