llvm/clang/lib/AST/ParentMapContext.cpp

//===- ParentMapContext.cpp - Map of parents using DynTypedNode -*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// Similar to ParentMap.cpp, but generalizes to non-Stmt nodes, which can have
// multiple parents.
//
//===----------------------------------------------------------------------===//

#include "clang/AST/ParentMapContext.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
#include "clang/AST/TemplateBase.h"

usingnamespaceclang;

ParentMapContext::ParentMapContext(ASTContext &Ctx) :{}

ParentMapContext::~ParentMapContext() = default;

void ParentMapContext::clear() {}

const Expr *ParentMapContext::traverseIgnored(const Expr *E) const {}

Expr *ParentMapContext::traverseIgnored(Expr *E) const {}

DynTypedNode ParentMapContext::traverseIgnored(const DynTypedNode &N) const {}

template <typename T, typename... U>
std::tuple<bool, DynTypedNodeList, const T *, const U *...>
matchParents(const DynTypedNodeList &NodeList,
             ParentMapContext::ParentMap *ParentMap);

template <typename, typename...> struct MatchParents;

class ParentMapContext::ParentMap {};

template <typename T, typename... U> struct MatchParents {};

MatchParents<T>;

template <typename T, typename... U>
std::tuple<bool, DynTypedNodeList, const T *, const U *...>
matchParents(const DynTypedNodeList &NodeList,
             ParentMapContext::ParentMap *ParentMap) {}

/// Template specializations to abstract away from pointers and TypeLocs.
/// @{
template <typename T> static DynTypedNode createDynTypedNode(const T &Node) {}
template <> DynTypedNode createDynTypedNode(const TypeLoc &Node) {}
template <>
DynTypedNode createDynTypedNode(const NestedNameSpecifierLoc &Node) {}
template <> DynTypedNode createDynTypedNode(const ObjCProtocolLoc &Node) {}
/// @}

/// A \c RecursiveASTVisitor that builds a map from nodes to their
/// parents as defined by the \c RecursiveASTVisitor.
///
/// Note that the relationship described here is purely in terms of AST
/// traversal - there are other relationships (for example declaration context)
/// in the AST that are better modeled by special matchers.
class ParentMapContext::ParentMap::ASTVisitor
    : public RecursiveASTVisitor<ASTVisitor> {};

ParentMapContext::ParentMap::ParentMap(ASTContext &Ctx) {}

DynTypedNodeList ParentMapContext::getParents(const DynTypedNode &Node) {}