Emit debug info for VectorType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96999 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 3a27a37..9ed6466 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1034,6 +1034,28 @@
   return llvm::DIType();
 }
 
+llvm::DIType CGDebugInfo::CreateType(const VectorType *Ty,
+				     llvm::DICompileUnit Unit) {
+  llvm::DIType ElementTy = getOrCreateType(Ty->getElementType(), Unit);
+  uint64_t NumElems = Ty->getNumElements();
+  if (NumElems > 0)
+    --NumElems;
+  llvm::SmallVector<llvm::DIDescriptor, 8> Subscripts;
+  Subscripts.push_back(DebugFactory.GetOrCreateSubrange(0, NumElems));
+
+  llvm::DIArray SubscriptArray =
+    DebugFactory.GetOrCreateArray(Subscripts.data(), Subscripts.size());
+
+  uint64_t Size = CGM.getContext().getTypeSize(Ty);
+  uint64_t Align = CGM.getContext().getTypeAlign(Ty);
+
+  return
+    DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_vector_type,
+                                     Unit, "", llvm::DICompileUnit(),
+                                     0, Size, Align, 0, 0,
+				     ElementTy,  SubscriptArray);
+}
+
 llvm::DIType CGDebugInfo::CreateType(const ArrayType *Ty,
                                      llvm::DICompileUnit Unit) {
   uint64_t Size;
@@ -1214,9 +1236,10 @@
 
   // FIXME: Handle these.
   case Type::ExtVector:
-  case Type::Vector:
     return llvm::DIType();
-      
+
+  case Type::Vector:
+    return CreateType(cast<VectorType>(Ty), Unit);
   case Type::ObjCObjectPointer:
     return CreateType(cast<ObjCObjectPointerType>(Ty), Unit);
   case Type::ObjCInterface: