diff options
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 4 | 
1 files changed, 4 insertions, 0 deletions
| diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index 7c1cc35ee9d..24b5ad44f28 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/lib/Analysis/DebugInfo.cpp @@ -409,6 +409,10 @@ uint64_t DIDerivedType::getOriginalTypeSize() const {        Tag == dwarf::DW_TAG_const_type || Tag == dwarf::DW_TAG_volatile_type ||        Tag == dwarf::DW_TAG_restrict_type) {      DIType BaseType = getTypeDerivedFrom(); +    // If this type is not derived from any type then take conservative  +    // approach. +    if (BaseType.isNull()) +      return getSizeInBits();      if (BaseType.isDerivedType())        return DIDerivedType(BaseType.getNode()).getOriginalTypeSize();      else | 

