@@ -589,17 +589,22 @@ class InlayHintVisitor : public RecursiveASTVisitor<InlayHintVisitor> {
589
589
return true ;
590
590
}
591
591
592
- bool dataTraverseStmtPre (Stmt *S ) {
593
- // Do not show inlay hints for the __builtin_dump_struct, which would expand
594
- // to a PseudoObjectExpr that includes a couple of calls to a printf
595
- // function. Printing parameter names for that anyway would end up with
596
- // duplicate parameter names (which, however, got de-duplicated after
592
+ bool TraversePseudoObjectExpr (PseudoObjectExpr *E ) {
593
+ // Do not show inlay hints for the __builtin_dump_struct, which would
594
+ // expand to a PseudoObjectExpr that includes a couple of calls to a
595
+ // printf function. Printing parameter names for that anyway would end up
596
+ // with duplicate parameter names (which, however, got de-duplicated after
597
597
// visiting) for the printf function.
598
- if (auto *POE = dyn_cast<PseudoObjectExpr>(S))
599
- if (auto *CE = dyn_cast<CallExpr>(POE->getSyntacticForm ());
600
- CE && CE->getBuiltinCallee () == Builtin::BI__builtin_dump_struct)
601
- return false ;
602
- return true ;
598
+ if (auto *CE = dyn_cast<CallExpr>(E->getSyntacticForm ());
599
+ CE && CE->getBuiltinCallee () == Builtin::BI__builtin_dump_struct)
600
+ // Only traverse the syntactic forms. This leaves the door open in case
601
+ // the arguments in the syntactic form for __builtin_dump_struct could
602
+ // possibly get parameter names.
603
+ return RecursiveASTVisitor<InlayHintVisitor>::TraverseStmt (
604
+ E->getSyntacticForm ());
605
+ // FIXME: Shall we ignore semantic forms for other pseudo object
606
+ // expressions?
607
+ return RecursiveASTVisitor<InlayHintVisitor>::TraversePseudoObjectExpr (E);
603
608
}
604
609
605
610
bool VisitCallExpr (CallExpr *E) {
0 commit comments