clang  13.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/Optional.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include <map>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for RewriteRule.cpp:

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

using MatchResult = MatchFinder::MatchResult

Definition at line 31 of file RewriteRule.cpp.

Function Documentation

◆ formatHeaderPath()

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

◆ hasValidKind()

static bool hasValidKind ( const DynTypedMatcher &  M)
static

Definition at line 338 of file RewriteRule.cpp.

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

◆ makeText()

static TextGenerator makeText ( std::string  S)
static

Definition at line 142 of file RewriteRule.cpp.

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

◆ rewriteDescendantsImpl()

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

Definition at line 269 of file RewriteRule.cpp.

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 347 of file RewriteRule.cpp.

◆ translateEdits()

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