This revision was automatically updated to reflect the committed changes. Closed by commit rL351601: [ASTDump] Mark null params with a tag rather than a child node (authored by steveire, committed by ). Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D56753?vs=182476&id=182604#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56753/new/ https://reviews.llvm.org/D56753 Files: cfe/trunk/lib/AST/ASTDumper.cpp Index: cfe/trunk/lib/AST/ASTDumper.cpp =================================================================== --- cfe/trunk/lib/AST/ASTDumper.cpp +++ cfe/trunk/lib/AST/ASTDumper.cpp @@ -633,13 +633,18 @@ } } + // Since NumParams comes from the FunctionProtoType of the FunctionDecl and + // the Params are set later, it is possible for a dump during debugging to + // encounter a FunctionDecl that has been created but hasn't been assigned + // ParmVarDecls yet. + if (!D->param_empty() && !D->param_begin()) + OS << " <<<NULL params x " << D->getNumParams() << ">>>"; + if (const auto *FTSI = D->getTemplateSpecializationInfo()) dumpTemplateArgumentList(*FTSI->TemplateArguments); - if (!D->param_begin() && D->getNumParams()) - dumpChild([=] { OS << "<<NULL params x " << D->getNumParams() << ">>"; }); - else - for (const ParmVarDecl *Parameter : D->parameters()) + if (D->param_begin()) + for (const auto *Parameter : D->parameters()) dumpDecl(Parameter); if (const auto *C = dyn_cast<CXXConstructorDecl>(D))
Index: cfe/trunk/lib/AST/ASTDumper.cpp =================================================================== --- cfe/trunk/lib/AST/ASTDumper.cpp +++ cfe/trunk/lib/AST/ASTDumper.cpp @@ -633,13 +633,18 @@ } } + // Since NumParams comes from the FunctionProtoType of the FunctionDecl and + // the Params are set later, it is possible for a dump during debugging to + // encounter a FunctionDecl that has been created but hasn't been assigned + // ParmVarDecls yet. + if (!D->param_empty() && !D->param_begin()) + OS << " <<<NULL params x " << D->getNumParams() << ">>>"; + if (const auto *FTSI = D->getTemplateSpecializationInfo()) dumpTemplateArgumentList(*FTSI->TemplateArguments); - if (!D->param_begin() && D->getNumParams()) - dumpChild([=] { OS << "<<NULL params x " << D->getNumParams() << ">>"; }); - else - for (const ParmVarDecl *Parameter : D->parameters()) + if (D->param_begin()) + for (const auto *Parameter : D->parameters()) dumpDecl(Parameter); if (const auto *C = dyn_cast<CXXConstructorDecl>(D))
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits