This revision was automatically updated to reflect the committed changes.
Closed by commit rL261734: Fix test for homogeneity in case of aggregate 
consisting of containerized… (authored by omjavaid).

Changed prior to commit:
  http://reviews.llvm.org/D17501?vs=48663&id=48909#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17501

Files:
  lldb/trunk/source/Symbol/ClangASTContext.cpp

Index: lldb/trunk/source/Symbol/ClangASTContext.cpp
===================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp
@@ -3100,9 +3100,11 @@
                         bool is_hva = false;
                         bool is_hfa = false;
                         clang::QualType base_qual_type;
+                        uint64_t base_bitwidth = 0;
                         for (field_pos = record_decl->field_begin(); field_pos 
!= field_end; ++field_pos)
                         {
                             clang::QualType field_qual_type = 
field_pos->getType();
+                            uint64_t field_bitwidth = 
getASTContext()->getTypeSize (qual_type);
                             if (field_qual_type->isFloatingType())
                             {
                                 if (field_qual_type->isComplexType())
@@ -3123,22 +3125,21 @@
                             }
                             else if (field_qual_type->isVectorType() || 
field_qual_type->isExtVectorType())
                             {
-                                const clang::VectorType *array = 
field_qual_type.getTypePtr()->getAs<clang::VectorType>();
-                                if (array && array->getNumElements() <= 4)
+                                if (num_fields == 0)
                                 {
-                                    if (num_fields == 0)
-                                        base_qual_type = 
array->getElementType();
-                                    else
-                                    {
-                                        if (is_hfa)
-                                            return 0;
-                                        is_hva = true;
-                                        if (field_qual_type.getTypePtr() != 
base_qual_type.getTypePtr())
-                                            return 0;
-                                    }
+                                    base_qual_type = field_qual_type;
+                                    base_bitwidth = field_bitwidth;
                                 }
                                 else
-                                    return 0;
+                                {
+                                    if (is_hfa)
+                                        return 0;
+                                    is_hva = true;
+                                    if (base_bitwidth != field_bitwidth)
+                                        return 0;
+                                    if (field_qual_type.getTypePtr() != 
base_qual_type.getTypePtr())
+                                        return 0;
+                                }
                             }
                             else
                                 return 0;


Index: lldb/trunk/source/Symbol/ClangASTContext.cpp
===================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp
@@ -3100,9 +3100,11 @@
                         bool is_hva = false;
                         bool is_hfa = false;
                         clang::QualType base_qual_type;
+                        uint64_t base_bitwidth = 0;
                         for (field_pos = record_decl->field_begin(); field_pos != field_end; ++field_pos)
                         {
                             clang::QualType field_qual_type = field_pos->getType();
+                            uint64_t field_bitwidth = getASTContext()->getTypeSize (qual_type);
                             if (field_qual_type->isFloatingType())
                             {
                                 if (field_qual_type->isComplexType())
@@ -3123,22 +3125,21 @@
                             }
                             else if (field_qual_type->isVectorType() || field_qual_type->isExtVectorType())
                             {
-                                const clang::VectorType *array = field_qual_type.getTypePtr()->getAs<clang::VectorType>();
-                                if (array && array->getNumElements() <= 4)
+                                if (num_fields == 0)
                                 {
-                                    if (num_fields == 0)
-                                        base_qual_type = array->getElementType();
-                                    else
-                                    {
-                                        if (is_hfa)
-                                            return 0;
-                                        is_hva = true;
-                                        if (field_qual_type.getTypePtr() != base_qual_type.getTypePtr())
-                                            return 0;
-                                    }
+                                    base_qual_type = field_qual_type;
+                                    base_bitwidth = field_bitwidth;
                                 }
                                 else
-                                    return 0;
+                                {
+                                    if (is_hfa)
+                                        return 0;
+                                    is_hva = true;
+                                    if (base_bitwidth != field_bitwidth)
+                                        return 0;
+                                    if (field_qual_type.getTypePtr() != base_qual_type.getTypePtr())
+                                        return 0;
+                                }
                             }
                             else
                                 return 0;
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to