llvm/clang/lib/Tooling/Transformer/Stencil.cpp

//===--- Stencil.cpp - Stencil implementation -------------------*- 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
//
//===----------------------------------------------------------------------===//

#include "clang/Tooling/Transformer/Stencil.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTTypeTraits.h"
#include "clang/AST/Expr.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Lex/Lexer.h"
#include "clang/Tooling/Transformer/SourceCode.h"
#include "clang/Tooling/Transformer/SourceCodeBuilders.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include <atomic>
#include <memory>
#include <string>

usingnamespaceclang;
usingnamespacetransformer;

BoundNodes;
MatchFinder;
errc;
Error;
Expected;
StringError;

static llvm::Expected<DynTypedNode> getNode(const BoundNodes &Nodes,
                                            StringRef Id) {}

static Error printNode(StringRef Id, const MatchFinder::MatchResult &Match,
                       std::string *Result) {}

namespace {
// An arbitrary fragment of code within a stencil.
class RawTextStencil : public StencilInterface {};

// A debugging operation to dump the AST for a particular (bound) AST node.
class DebugPrintNodeStencil : public StencilInterface {};

// Operators that take a single node Id as an argument.
enum class UnaryNodeOperator {};

// Generic container for stencil operations with a (single) node-id argument.
class UnaryOperationStencil : public StencilInterface {};

// The fragment of code corresponding to the selected range.
class SelectorStencil : public StencilInterface {};

// A stencil operation to build a member access `e.m` or `e->m`, as appropriate.
class AccessStencil : public StencilInterface {};

class IfBoundStencil : public StencilInterface {};

class SelectBoundStencil : public clang::transformer::StencilInterface {};

class SequenceStencil : public StencilInterface {};

class RunStencil : public StencilInterface {};
} // namespace

Stencil transformer::detail::makeStencil(StringRef Text) {}

Stencil transformer::detail::makeStencil(RangeSelector Selector) {}

Stencil transformer::dPrint(StringRef Id) {}

Stencil transformer::expression(llvm::StringRef Id) {}

Stencil transformer::deref(llvm::StringRef ExprId) {}

Stencil transformer::maybeDeref(llvm::StringRef ExprId) {}

Stencil transformer::addressOf(llvm::StringRef ExprId) {}

Stencil transformer::maybeAddressOf(llvm::StringRef ExprId) {}

Stencil transformer::describe(StringRef Id) {}

Stencil transformer::access(StringRef BaseId, Stencil Member) {}

Stencil transformer::ifBound(StringRef Id, Stencil TrueStencil,
                             Stencil FalseStencil) {}

Stencil transformer::selectBound(
    std::vector<std::pair<std::string, Stencil>> CaseStencils,
    Stencil DefaultStencil) {}

Stencil transformer::run(MatchConsumer<std::string> Fn) {}

Stencil transformer::catVector(std::vector<Stencil> Parts) {}