[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Nov 9 13:26:06 PST 2002
Changes in directory llvm/lib/Analysis/DataStructure:
DataStructure.cpp updated: 1.55 -> 1.56
---
Log message:
Tighten up array handling
---
Diffs of the changes:
Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.55 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.56
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.55 Fri Nov 8 18:49:05 2002
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Sat Nov 9 13:25:27 2002
@@ -135,10 +135,12 @@
// 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 @@
// 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 @@
//
const Type *OldTy = Ty.Ty;
Ty.Ty = NewTy;
+ Ty.isArray = WillBeArray;
Size = NewTySize;
// Must grow links to be the appropriate size...
More information about the llvm-commits
mailing list