aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/DataStructure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-09 19:25:27 +0000
committerChris Lattner <sabre@nondot.org>2002-11-09 19:25:27 +0000
commitd888893a54caeab7408e8015f7d4f423a2a4378a (patch)
tree82d1966acc1ead9e0ea5ea3f696a9d3a670df1b6 /lib/Analysis/DataStructure/DataStructure.cpp
parent0779ba6c47a6ab2b99721903f5a45d123713fe8b (diff)
Tighten up array handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4655 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/DataStructure.cpp')
-rw-r--r--lib/Analysis/DataStructure/DataStructure.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp
index 8b43653b91..6380a4967e 100644
--- a/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/lib/Analysis/DataStructure/DataStructure.cpp
@@ -135,10 +135,12 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset) {
// be used anyway. This greatly reduces the size of large static arrays used
// as global variables, for example.
//
+ bool WillBeArray = false;
while (const ArrayType *AT = dyn_cast<ArrayType>(NewTy)) {
// FIXME: we might want to keep small arrays, but must be careful about
// things like: [2 x [10000 x int*]]
NewTy = AT->getElementType();
+ WillBeArray = true;
}
// Figure out how big the new type we're merging in is...
@@ -152,8 +154,9 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset) {
// If this is the first type that this node has seen, just accept it without
// question....
assert(Offset == 0 && "Cannot have an offset into a void node!");
- assert(Ty.isArray == false && "This shouldn't happen!");
+ assert(!Ty.isArray && "This shouldn't happen!");
Ty.Ty = NewTy;
+ Ty.isArray = WillBeArray;
Size = NewTySize;
// Calculate the number of outgoing links from this node.
@@ -185,6 +188,7 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset) {
//
const Type *OldTy = Ty.Ty;
Ty.Ty = NewTy;
+ Ty.isArray = WillBeArray;
Size = NewTySize;
// Must grow links to be the appropriate size...