clang 19.0.0git
Typedefs | Functions
RewriteRule.cpp File Reference
#include "clang/Tooling/Transformer/RewriteRule.h"
#include "clang/AST/ASTTypeTraits.h"
#include "clang/AST/Stmt.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Tooling/Transformer/SourceCode.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include <map>
#include <string>
#include <utility>
#include <vector>

Go to the source code of this file.

Typedefs

using MatchResult = MatchFinder::MatchResult
 

Functions

static Expected< SmallVector< transformer::Edit, 1 > > translateEdits (const MatchResult &Result, ArrayRef< ASTEdit > ASTEdits)
 
static TextGenerator makeText (std::string S)
 
static std::string formatHeaderPath (StringRef Header, IncludeFormat Format)
 
template<typename T >
llvm::Expected< SmallVector< clang::transformer::Edit, 1 > > rewriteDescendantsImpl (const T &Node, RewriteRule Rule, const MatchResult &Result)
 
static bool hasValidKind (const DynTypedMatcher &M)
 
static std::vector< DynTypedMatcher > taggedMatchers (StringRef TagBase, const SmallVectorImpl< std::pair< size_t, RewriteRule::Case > > &Cases, TraversalKind DefaultTraversalKind)
 

Typedef Documentation

◆ MatchResult

Definition at line 30 of file RewriteRule.cpp.

Function Documentation

◆ formatHeaderPath()

static std::string formatHeaderPath ( StringRef  Header,
IncludeFormat  Format 
)
static

Definition at line 166 of file RewriteRule.cpp.

Referenced by clang::transformer::addInclude().

◆ hasValidKind()

static bool hasValidKind ( const DynTypedMatcher &  M)
static

Definition at line 369 of file RewriteRule.cpp.

Referenced by clang::transformer::detail::buildMatchers().

◆ makeText()

static TextGenerator makeText ( std::string  S)
static

Definition at line 158 of file RewriteRule.cpp.

Referenced by clang::transformer::addInclude(), and clang::transformer::remove().

◆ rewriteDescendantsImpl()

template<typename T >
llvm::Expected< SmallVector< clang::transformer::Edit, 1 > > rewriteDescendantsImpl ( const T &  Node,
RewriteRule  Rule,
const MatchResult Result 
)

Definition at line 300 of file RewriteRule.cpp.

References Node, and clang::T.

Referenced by clang::transformer::detail::rewriteDescendants().

◆ taggedMatchers()

static std::vector< DynTypedMatcher > taggedMatchers ( StringRef  TagBase,
const SmallVectorImpl< std::pair< size_t, RewriteRule::Case > > &  Cases,
TraversalKind  DefaultTraversalKind 
)
static

Definition at line 378 of file RewriteRule.cpp.

Referenced by clang::transformer::detail::buildMatchers().

◆ translateEdits()

static Expected< SmallVector< transformer::Edit, 1 > > translateEdits ( const MatchResult Result,
ArrayRef< ASTEdit ASTEdits 
)
static