[llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp
Jim Laskey
jlaskey at apple.com
Fri Dec 22 12:03:57 PST 2006
Changes in directory llvm/lib/CodeGen:
DwarfWriter.cpp updated: 1.108 -> 1.109
---
Log message:
Need to walk the derived chain of typedefs to get actual size.
---
Diffs of the changes: (+13 -4)
DwarfWriter.cpp | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.108 llvm/lib/CodeGen/DwarfWriter.cpp:1.109
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.108 Sat Dec 16 23:15:12 2006
+++ llvm/lib/CodeGen/DwarfWriter.cpp Fri Dec 22 14:03:42 2006
@@ -1539,10 +1539,19 @@
uint64_t FieldAlign = Align;
uint64_t FieldOffset = Offset;
- if (TypeDesc *FromTy = MemberDesc->getFromType()) {
- AddType(Member, FromTy, Unit);
- FieldSize = FromTy->getSize();
- FieldAlign = FromTy->getSize();
+ // Set the member type.
+ TypeDesc *FromTy = MemberDesc->getFromType();
+ AddType(Member, FromTy, Unit);
+
+ // Walk up typedefs until a real size is found.
+ while (FromTy) {
+ if (FromTy->getTag() != DW_TAG_typedef) {
+ FieldSize = FromTy->getSize();
+ FieldAlign = FromTy->getSize();
+ break;
+ }
+
+ FromTy = dyn_cast<DerivedTypeDesc>(FromTy)->getFromType();
}
// Unless we have a bit field.
More information about the llvm-commits
mailing list