Don't avoid recursing for pointer types, just reference types. Expand on

the comment.

Fixes constvars.exp on the gdb test builder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147897 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2012-01-11 00:01:29 +00:00
parent eab30279f7
commit dcc296d420
2 changed files with 29 additions and 3 deletions

View File

@ -492,9 +492,10 @@ uint64_t DIDerivedType::getOriginalTypeSize() const {
if (!BaseType.isValid())
return getSizeInBits();
// If this is a derived type, go ahead and get the base type, unless
// it's a reference or pointer type, then it's just the size of the field.
if (BaseType.getTag() == dwarf::DW_TAG_reference_type ||
BaseType.getTag() == dwarf::DW_TAG_pointer_type)
// it's a reference then it's just the size of the field. Pointer types
// have no need of this since they're a different type of qualification
// on the type.
if (BaseType.getTag() == dwarf::DW_TAG_reference_type)
return getSizeInBits();
else if (BaseType.isDerivedType())
return DIDerivedType(BaseType).getOriginalTypeSize();