Skip to content

Commit 81f1f6d

Browse files
committed
[lldb] Make ParseTemplateParameterInfos return false if there are no template params
This factors out the check from various callers. Reviewed By: Michael137 Differential Revision: https://reviews.llvm.org/D139649
1 parent 988ab00 commit 81f1f6d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -747,9 +747,7 @@ DWARFASTParserClang::GetDIEClassTemplateParams(const DWARFDIE &die) {
747747

748748
clang::DeclContext *decl_ctx = GetClangDeclContextContainingDIE(die, nullptr);
749749
TypeSystemClang::TemplateParameterInfos template_param_infos;
750-
if (ParseTemplateParameterInfos(die, template_param_infos) &&
751-
(!template_param_infos.args.empty() ||
752-
template_param_infos.packed_args)) {
750+
if (ParseTemplateParameterInfos(die, template_param_infos)) {
753751
// Most of the parameters here don't matter, but we make sure the base name
754752
// is empty so when we print the name we only get the template parameters.
755753
clang::ClassTemplateDecl *class_template_decl =
@@ -1787,9 +1785,7 @@ DWARFASTParserClang::ParseStructureLikeDIE(const SymbolContext &sc,
17871785
metadata.SetIsDynamicCXXType(dwarf->ClassOrStructIsVirtual(die));
17881786

17891787
TypeSystemClang::TemplateParameterInfos template_param_infos;
1790-
if (ParseTemplateParameterInfos(die, template_param_infos) &&
1791-
(!template_param_infos.args.empty() ||
1792-
template_param_infos.packed_args)) {
1788+
if (ParseTemplateParameterInfos(die, template_param_infos)) {
17931789
clang::ClassTemplateDecl *class_template_decl =
17941790
m_ast.ParseClassTemplateDecl(
17951791
decl_ctx, GetOwningClangModule(die), attrs.accessibility,
@@ -2123,7 +2119,10 @@ bool DWARFASTParserClang::ParseTemplateParameterInfos(
21232119
break;
21242120
}
21252121
}
2126-
return template_param_infos.args.size() == template_param_infos.names.size();
2122+
return template_param_infos.args.size() ==
2123+
template_param_infos.names.size() &&
2124+
(!template_param_infos.args.empty() ||
2125+
template_param_infos.packed_args);
21272126
}
21282127

21292128
bool DWARFASTParserClang::CompleteRecordType(const DWARFDIE &die,

0 commit comments

Comments
 (0)