summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-02-23 22:59:39 +0000
committerDevang Patel <dpatel@apple.com>2010-02-23 22:59:39 +0000
commitb407338fe2f2f33106a0a0332d8dca3ec7d4d676 (patch)
treebbe5bd13dfae8656e0cf35b851c25418dbf7fc95 /clang/lib/CodeGen/CGDebugInfo.cpp
parentdffb51bac86d34f881b83c9db4489fe3d162d415 (diff)
downloadbcm5719-llvm-b407338fe2f2f33106a0a0332d8dca3ec7d4d676.tar.gz
bcm5719-llvm-b407338fe2f2f33106a0a0332d8dca3ec7d4d676.zip
Emit debug info for VectorType.
llvm-svn: 96999
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 3a27a379885..9ed6466af6a 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1034,6 +1034,28 @@ llvm::DIType CGDebugInfo::CreateType(const TagType *Ty,
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 @@ llvm::DIType CGDebugInfo::CreateTypeNode(QualType Ty,
// 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:
OpenPOWER on IntegriCloud