void ASTExporter::VisitIfStmt()

in facebook-clang-plugins/libtooling/ASTExporter.h [3163:3187]


void ASTExporter<ATDWriter>::VisitIfStmt(const IfStmt *Node) {
  VisitStmt(Node);
  const Stmt *Init = Node->getInit();
  const DeclStmt *CondVar = Node->getConditionVariableDeclStmt();
  bool hasElseStorage = Node->hasElseStorage();
  ObjectScope Scope(OF, 2 + (bool)Init + (bool)CondVar + hasElseStorage);
  if (Init) {
    OF.emitTag("init");
    dumpPointer(Init);
  }
  if (CondVar) {
    OF.emitTag("cond_var");
    dumpStmt(CondVar);
  }
  OF.emitTag("cond");
  dumpPointer(Node->getCond());
  OF.emitTag("then");
  dumpPointer(Node->getThen());
  if (hasElseStorage) {
    OF.emitTag("else");
    TupleScope Scope(OF, 2);
    dumpPointer(Node->getElse());
    dumpSourceLocation(Node->getElseLoc());
  }
}