aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-23 06:13:01 +0000
committerChris Lattner <sabre@nondot.org>2009-04-23 06:13:01 +0000
commitb700377f850a29a4fc8cb3e1b07809ef1afdcce5 (patch)
tree082308ba77133b3c9688f0b8d3881bee3975b98d /lib/CodeGen
parentb5437d238752dc297e42410e98d38d5250fe0463 (diff)
implement debug info for _Complex.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69873 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp18
-rw-r--r--lib/CodeGen/CGDebugInfo.h1
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 84e92f81a7..f2ca2e7c58 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -140,6 +140,22 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT,
Offset, /*flags*/ 0, Encoding);
}
+llvm::DIType CGDebugInfo::CreateType(const ComplexType *Ty,
+ llvm::DICompileUnit Unit) {
+ // Bit size, align and offset of the type.
+ unsigned Encoding = llvm::dwarf::DW_ATE_complex_float;
+ if (Ty->isComplexIntegerType())
+ Encoding = llvm::dwarf::DW_ATE_lo_user;
+
+ uint64_t Size = M->getContext().getTypeSize(Ty);
+ uint64_t Align = M->getContext().getTypeAlign(Ty);
+ uint64_t Offset = 0;
+
+ return DebugFactory.CreateBasicType(Unit, "complex",
+ Unit, 0, Size, Align,
+ Offset, /*flags*/ 0, Encoding);
+}
+
/// getOrCreateCVRType - Get the CVR qualified type from the cache or create
/// a new one if necessary.
llvm::DIType CGDebugInfo::CreateCVRType(QualType Ty, llvm::DICompileUnit Unit) {
@@ -569,7 +585,6 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty,
#include "clang/AST/TypeNodes.def"
assert(false && "Dependent types cannot show up in debug information");
- case Type::Complex:
case Type::LValueReference:
case Type::RValueReference:
case Type::Vector:
@@ -589,6 +604,7 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty,
case Type::ObjCInterface:
return Slot = CreateType(cast<ObjCInterfaceType>(Ty), Unit);
case Type::Builtin: return Slot = CreateType(cast<BuiltinType>(Ty), Unit);
+ case Type::Complex: return Slot = CreateType(cast<ComplexType>(Ty), Unit);
case Type::Pointer: return Slot = CreateType(cast<PointerType>(Ty), Unit);
case Type::Typedef: return Slot = CreateType(cast<TypedefType>(Ty), Unit);
case Type::Record:
diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h
index 1798165dfa..4a59ecaaa5 100644
--- a/lib/CodeGen/CGDebugInfo.h
+++ b/lib/CodeGen/CGDebugInfo.h
@@ -49,6 +49,7 @@ class CGDebugInfo {
/// Helper functions for getOrCreateType.
llvm::DIType CreateType(const BuiltinType *Ty, llvm::DICompileUnit U);
+ llvm::DIType CreateType(const ComplexType *Ty, llvm::DICompileUnit U);
llvm::DIType CreateCVRType(QualType Ty, llvm::DICompileUnit U);
llvm::DIType CreateType(const TypedefType *Ty, llvm::DICompileUnit U);
llvm::DIType CreateType(const PointerType *Ty, llvm::DICompileUnit U);