r351269 - Re-order overrides in FunctionDecl dump

Stephen Kelly via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 15 15:05:26 PST 2019


On 15/01/2019 23:00, Aaron Ballman wrote:
> On Tue, Jan 15, 2019 at 5:54 PM Stephen Kelly via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
>> Author: steveire
>> Date: Tue Jan 15 14:50:37 2019
>> New Revision: 351269
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=351269&view=rev
>> Log:
>> Re-order overrides in FunctionDecl dump
>>
>> Output all content which is local to the FunctionDecl before traversing
>> to child AST nodes.
>>
>> This is necessary so that all of the part which is local to the
>> FunctionDecl can be split into a different method.
>>
>> Reviewers: aaron.ballman
>>
>> Differential Revision: https://reviews.llvm.org/D55083
>>
>> Modified:
>>      cfe/trunk/lib/AST/ASTDumper.cpp
>>      cfe/trunk/test/AST/ast-dump-funcs.cpp
>>
>> Modified: cfe/trunk/lib/AST/ASTDumper.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=351269&r1=351268&r2=351269&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/AST/ASTDumper.cpp (original)
>> +++ cfe/trunk/lib/AST/ASTDumper.cpp Tue Jan 15 14:50:37 2019
>> @@ -612,20 +612,6 @@ void ASTDumper::VisitFunctionDecl(const
>>       }
>>     }
>>
>> -  if (const FunctionTemplateSpecializationInfo *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())
>> -      dumpDecl(Parameter);
>> -
>> -  if (const CXXConstructorDecl *C = dyn_cast<CXXConstructorDecl>(D))
>> -    for (const auto *I : C->inits())
>> -      dumpCXXCtorInitializer(I);
>> -
>>     if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) {
>>       if (MD->size_overridden_methods() != 0) {
>>         auto dumpOverride = [=](const CXXMethodDecl *D) {
>> @@ -649,6 +635,22 @@ void ASTDumper::VisitFunctionDecl(const
>>       }
>>     }
>>
>> +  if (const FunctionTemplateSpecializationInfo *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())
>> +      dumpDecl(Parameter);
>> +
>> +  if (const CXXConstructorDecl *C = dyn_cast<CXXConstructorDecl>(D))
> Missed this nit from the review.
>
>> +    for (CXXConstructorDecl::init_const_iterator I = C->init_begin(),
>> +                                                 E = C->init_end();
>> +         I != E; ++I)
>> +      dumpCXXCtorInitializer(*I);
> This accidentally reverts what you did in r351268.


Lol, thanks! Fixing now

Stephen.




More information about the cfe-commits mailing list