[Lldb-commits] [lldb] 81f1f6d - [lldb] Make ParseTemplateParameterInfos return false if there are no template params

Arthur Eubanks via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 12 10:29:15 PST 2022


Author: Arthur Eubanks
Date: 2022-12-12T10:28:52-08:00
New Revision: 81f1f6db40abc2cc7f964bf450a2e9f78f14a8a8

URL: https://github.com/llvm/llvm-project/commit/81f1f6db40abc2cc7f964bf450a2e9f78f14a8a8
DIFF: https://github.com/llvm/llvm-project/commit/81f1f6db40abc2cc7f964bf450a2e9f78f14a8a8.diff

LOG: [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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index d88ff00296633..a15302ac0d51c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -747,9 +747,7 @@ DWARFASTParserClang::GetDIEClassTemplateParams(const DWARFDIE &die) {
 
   clang::DeclContext *decl_ctx = GetClangDeclContextContainingDIE(die, nullptr);
   TypeSystemClang::TemplateParameterInfos template_param_infos;
-  if (ParseTemplateParameterInfos(die, template_param_infos) &&
-      (!template_param_infos.args.empty() ||
-       template_param_infos.packed_args)) {
+  if (ParseTemplateParameterInfos(die, template_param_infos)) {
     // Most of the parameters here don't matter, but we make sure the base name
     // is empty so when we print the name we only get the template parameters.
     clang::ClassTemplateDecl *class_template_decl =
@@ -1787,9 +1785,7 @@ DWARFASTParserClang::ParseStructureLikeDIE(const SymbolContext &sc,
     metadata.SetIsDynamicCXXType(dwarf->ClassOrStructIsVirtual(die));
 
     TypeSystemClang::TemplateParameterInfos template_param_infos;
-    if (ParseTemplateParameterInfos(die, template_param_infos) &&
-        (!template_param_infos.args.empty() ||
-         template_param_infos.packed_args)) {
+    if (ParseTemplateParameterInfos(die, template_param_infos)) {
       clang::ClassTemplateDecl *class_template_decl =
           m_ast.ParseClassTemplateDecl(
               decl_ctx, GetOwningClangModule(die), attrs.accessibility,
@@ -2123,7 +2119,10 @@ bool DWARFASTParserClang::ParseTemplateParameterInfos(
       break;
     }
   }
-  return template_param_infos.args.size() == template_param_infos.names.size();
+  return template_param_infos.args.size() ==
+             template_param_infos.names.size() &&
+         (!template_param_infos.args.empty() ||
+          template_param_infos.packed_args);
 }
 
 bool DWARFASTParserClang::CompleteRecordType(const DWARFDIE &die,


        


More information about the lldb-commits mailing list