void ASTExporter::VisitExprWithCleanups()

in facebook-clang-plugins/libtooling/ASTExporter.h [4110:4131]


void ASTExporter<ATDWriter>::VisitExprWithCleanups(
    const ExprWithCleanups *Node) {
  VisitExpr(Node);

  bool HasDeclRefs = Node->getNumObjects() > 0;
  ObjectScope Scope(OF, 0 + HasDeclRefs);

  if (HasDeclRefs) {
    OF.emitTag("decl_refs");
    unsigned int ctr = 0;
    for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i)
      if (Node->getObject(i).is<clang::BlockDecl *>())
        ++ctr;
    ArrayScope Scope(OF, ctr);
    for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i) {
      auto p = Node->getObject(i);
      if (p.is<clang::BlockDecl *>()) {
        dumpDeclRef(**p.getAddrOfPtr1());
      }
    }
  }
}