diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2006-04-25 19:33:23 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2006-04-25 19:33:23 +0000 |
commit | ceeb17d8d8642b057e5d1d1b4161d36a0f387d09 (patch) | |
tree | cb7582c640c807e9f59e9f6e68c38725382c9346 /lib/Analysis/DataStructure | |
parent | 044edfe019968bf5778c1525b40acdd014beae62 (diff) |
better c99 struct handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27970 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure')
-rw-r--r-- | lib/Analysis/DataStructure/Local.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp index 738a105e2c..22dd2394ac 100644 --- a/lib/Analysis/DataStructure/Local.cpp +++ b/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"); } |