llvm/clang/utils/TableGen/ASTTableGen.cpp

//=== ASTTableGen.cpp - Helper functions for working with AST records -----===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file defines some helper functions for working with tblegen reocrds
// for the Clang AST: that is, the contents of files such as DeclNodes.td,
// StmtNodes.td, and TypeNodes.td.
//
//===----------------------------------------------------------------------===//

#include "ASTTableGen.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/Error.h"
#include <optional>

usingnamespacellvm;
usingnamespaceclang;
usingnamespaceclang::tblgen;

StringRef clang::tblgen::HasProperties::getName() const {}

static StringRef removeExpectedNodeNameSuffix(const Record *node,
                                              StringRef suffix) {}

// Decl node names don't end in Decl for historical reasons, and it would
// be somewhat annoying to fix now.  Conveniently, this means the ID matches
// is exactly the node name, and the class name is simply that plus Decl.
std::string clang::tblgen::DeclNode::getClassName() const {}
StringRef clang::tblgen::DeclNode::getId() const {}

// Type nodes are all named ending in Type, just like the corresponding
// C++ class, and the ID just strips this suffix.
StringRef clang::tblgen::TypeNode::getClassName() const {}
StringRef clang::tblgen::TypeNode::getId() const {}

// Stmt nodes are named the same as the C++ class, which has no regular
// naming convention (all the non-expression statements end in Stmt,
// and *many* expressions end in Expr, but there are also several
// core expression classes like IntegerLiteral and BinaryOperator with
// no standard suffix).  The ID adds "Class" for historical reasons.
StringRef clang::tblgen::StmtNode::getClassName() const {}
std::string clang::tblgen::StmtNode::getId() const {}

/// Emit a string spelling out the C++ value type.
void PropertyType::emitCXXValueTypeName(bool forRead, raw_ostream &out) const {}

// A map from a node to each of its child nodes.
ChildMap;

static void visitASTNodeRecursive(ASTNode node, ASTNode base,
                                  const ChildMap &map,
                                  ASTNodeHierarchyVisitor<ASTNode> visit) {}

static void visitHierarchy(const RecordKeeper &records, StringRef nodeClassName,
                           ASTNodeHierarchyVisitor<ASTNode> visit) {}

void clang::tblgen::visitASTNodeHierarchyImpl(
    const RecordKeeper &records, StringRef nodeClassName,
    ASTNodeHierarchyVisitor<ASTNode> visit) {}