@@ -59,18 +59,18 @@ bool MapASTVisitor::mapDecl(const T *D, bool IsDefinition) {
5959 bool IsFileInRootDir;
6060 llvm::SmallString<128 > File =
6161 getFile (D, D->getASTContext (), CDCtx.SourceRoot , IsFileInRootDir);
62- auto I = serialize::emitInfo (D, getComment (D, D-> getASTContext ()),
63- getLine (D, D->getASTContext ()), File ,
64- IsFileInRootDir, CDCtx.PublicOnly );
65-
66- // A null in place of I indicates that the serializer is skipping this decl
67- // for some reason (e.g. we're only reporting public decls).
68- if (I. first )
69- CDCtx.ECtx ->reportResult (llvm::toHex (llvm::toStringRef (I. first ->USR )),
70- serialize::serialize (I. first ));
71- if (I. second )
72- CDCtx.ECtx ->reportResult (llvm::toHex (llvm::toStringRef (I. second ->USR )),
73- serialize::serialize (I. second ));
62+ auto [Child, Parent] = serialize::emitInfo (
63+ D, getComment (D, D-> getASTContext ()), getLine (D, D->getASTContext ()),
64+ File, IsFileInRootDir, CDCtx.PublicOnly );
65+
66+ // A null in place of a valid Info indicates that the serializer is skipping
67+ // this decl for some reason (e.g. we're only reporting public decls).
68+ if (Child )
69+ CDCtx.ECtx ->reportResult (llvm::toHex (llvm::toStringRef (Child ->USR )),
70+ serialize::serialize (Child ));
71+ if (Parent )
72+ CDCtx.ECtx ->reportResult (llvm::toHex (llvm::toStringRef (Parent ->USR )),
73+ serialize::serialize (Parent ));
7474 return true ;
7575}
7676
0 commit comments