|
@@ -1050,6 +1050,30 @@ bool CGDebugInfo::TryCollectHLSLRecordElements(const RecordType *Ty,
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
+ else if (hlsl::IsHLSLMatType(QualTy)) {
|
|
|
+ // The HLSL matrix type is defined as containing a field 'h' of
|
|
|
+ // array of extended vector type, but logically we want to represent
|
|
|
+ // it as per-element fields.
|
|
|
+ QualType ElemQualTy = hlsl::GetHLSLMatElementType(QualTy);
|
|
|
+ uint32_t NumRows, NumCols;
|
|
|
+ hlsl::GetHLSLMatRowColCount(QualTy, NumRows, NumCols);
|
|
|
+ unsigned ElemSizeInBits = CGM.getContext().getTypeSize(ElemQualTy);
|
|
|
+ for (unsigned RowIdx = 0; RowIdx < NumRows; ++RowIdx) {
|
|
|
+ for (unsigned ColIdx = 0; ColIdx < NumCols; ++ColIdx) {
|
|
|
+ char FieldName[] = "_11";
|
|
|
+ FieldName[1] += RowIdx;
|
|
|
+ FieldName[2] += ColIdx;
|
|
|
+ unsigned RowMajorIdx = RowIdx * NumCols + ColIdx;
|
|
|
+ unsigned OffsetInBits = ElemSizeInBits * RowMajorIdx;
|
|
|
+ llvm::DIType *FieldType = createFieldType(FieldName, ElemQualTy, 0,
|
|
|
+ SourceLocation(), AccessSpecifier::AS_public, OffsetInBits,
|
|
|
+ /* tunit */ nullptr, DITy, Ty->getDecl());
|
|
|
+ Elements.emplace_back(FieldType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
else if (hlsl::IsHLSLResourceType(QualTy) || hlsl::IsHLSLStreamOutputType(QualTy)) {
|
|
|
// Should appear as having no members rather than exposing our internal handles.
|
|
|
return true;
|