summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure/Local.cpp
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2006-04-25 19:33:23 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2006-04-25 19:33:23 +0000
commitf5a713d273c97f9f96c92ec6e78ec9589849a40e (patch)
tree84d9846b3c12295a935687bb3fbb750cec44d76c /llvm/lib/Analysis/DataStructure/Local.cpp
parenta3f7583408539ee59b546f7a19f5dc897238361d (diff)
downloadbcm5719-llvm-f5a713d273c97f9f96c92ec6e78ec9589849a40e.tar.gz
bcm5719-llvm-f5a713d273c97f9f96c92ec6e78ec9589849a40e.zip
better c99 struct handling
llvm-svn: 27970
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/Local.cpp')
-rw-r--r--llvm/lib/Analysis/DataStructure/Local.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp
index 738a105e2c6..22dd2394ace 100644
--- a/llvm/lib/Analysis/DataStructure/Local.cpp
+++ b/llvm/lib/Analysis/DataStructure/Local.cpp
@@ -1122,13 +1122,12 @@ void GraphBuilder::MergeConstantInitIntoNode(DSNodeHandle &NH, Constant *C) {
for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i) {
DSNode *NHN = NH.getNode();
//Some programmers think ending a structure with a [0 x sbyte] is cute
- //This should be ok as the allocation type should grow this type when
- //it is merged in if it is bigger.
if (SL->MemberOffsets[i] < SL->StructSize) {
DSNodeHandle NewNH(NHN, NH.getOffset()+(unsigned)SL->MemberOffsets[i]);
MergeConstantInitIntoNode(NewNH, cast<Constant>(CS->getOperand(i)));
} else if (SL->MemberOffsets[i] == SL->StructSize) {
DEBUG(std::cerr << "Zero size element at end of struct\n");
+ NHN->foldNodeCompletely();
} else {
assert(0 && "type was smaller than offsets of of struct layout indicate");
}
OpenPOWER on IntegriCloud