mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
Add support to describe template parameter type in debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124752 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1151,6 +1151,18 @@ void DwarfDebug::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
|
||||
DIDescriptor Context = CTy.getContext();
|
||||
addToContextOwner(&Buffer, Context);
|
||||
}
|
||||
|
||||
if (Tag == dwarf::DW_TAG_class_type) {
|
||||
DIArray TParams = CTy.getTemplateParams();
|
||||
unsigned N = TParams.getNumElements();
|
||||
// Add template parameters.
|
||||
for (unsigned i = 0; i < N; ++i) {
|
||||
DIDescriptor Element = TParams.getElement(i);
|
||||
if (Element.isTemplateTypeParameter())
|
||||
Buffer.addChild(getOrCreateTemplateTypeParameterDIE(
|
||||
DITemplateTypeParameter(Element)));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -1181,6 +1193,21 @@ void DwarfDebug::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
|
||||
}
|
||||
}
|
||||
|
||||
/// getOrCreateTemplateTypeParameterDIE - Find existing DIE or create new DIE
|
||||
/// for the given DITemplateTypeParameter.
|
||||
DIE *
|
||||
DwarfDebug::getOrCreateTemplateTypeParameterDIE(DITemplateTypeParameter TP) {
|
||||
CompileUnit *TypeCU = getCompileUnit(TP);
|
||||
DIE *ParamDIE = TypeCU->getDIE(TP);
|
||||
if (ParamDIE)
|
||||
return ParamDIE;
|
||||
|
||||
ParamDIE = new DIE(dwarf::DW_TAG_template_type_parameter);
|
||||
addType(ParamDIE, TP.getType());
|
||||
addString(ParamDIE, dwarf::DW_AT_name, dwarf::DW_FORM_string, TP.getName());
|
||||
return ParamDIE;
|
||||
}
|
||||
|
||||
/// constructSubrangeDIE - Construct subrange DIE from DISubrange.
|
||||
void DwarfDebug::constructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy){
|
||||
int64_t L = SR.getLo();
|
||||
|
||||
Reference in New Issue
Block a user