@@ -140,6 +140,22 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT,
140140 Offset, /* flags*/ 0 , Encoding);
141141}
142142
143+ llvm::DIType CGDebugInfo::CreateType (const ComplexType *Ty,
144+ llvm::DICompileUnit Unit) {
145+ // Bit size, align and offset of the type.
146+ unsigned Encoding = llvm::dwarf::DW_ATE_complex_float;
147+ if (Ty->isComplexIntegerType ())
148+ Encoding = llvm::dwarf::DW_ATE_lo_user;
149+
150+ uint64_t Size = M->getContext ().getTypeSize (Ty);
151+ uint64_t Align = M->getContext ().getTypeAlign (Ty);
152+ uint64_t Offset = 0 ;
153+
154+ return DebugFactory.CreateBasicType (Unit, " complex" ,
155+ Unit, 0 , Size, Align,
156+ Offset, /* flags*/ 0 , Encoding);
157+ }
158+
143159// / getOrCreateCVRType - Get the CVR qualified type from the cache or create
144160// / a new one if necessary.
145161llvm::DIType CGDebugInfo::CreateCVRType (QualType Ty, llvm::DICompileUnit Unit) {
@@ -569,7 +585,6 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty,
569585#include " clang/AST/TypeNodes.def"
570586 assert (false && " Dependent types cannot show up in debug information" );
571587
572- case Type::Complex:
573588 case Type::LValueReference:
574589 case Type::RValueReference:
575590 case Type::Vector:
@@ -589,6 +604,7 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty,
589604 case Type::ObjCInterface:
590605 return Slot = CreateType (cast<ObjCInterfaceType>(Ty), Unit);
591606 case Type::Builtin: return Slot = CreateType (cast<BuiltinType>(Ty), Unit);
607+ case Type::Complex: return Slot = CreateType (cast<ComplexType>(Ty), Unit);
592608 case Type::Pointer: return Slot = CreateType (cast<PointerType>(Ty), Unit);
593609 case Type::Typedef: return Slot = CreateType (cast<TypedefType>(Ty), Unit);
594610 case Type::Record:
0 commit comments