Defines the RewriteRule class and related functions for creating, modifying and interpreting RewriteRules.
More...
|
EditGenerator | clang::transformer::edit (ASTEdit E) |
| Generates a single (specified) edit.
|
|
EditGenerator | clang::transformer::editList (llvm::SmallVector< ASTEdit, 1 > Edits) |
| Lifts a list of ASTEdit s into an EditGenerator .
|
|
EditGenerator | clang::transformer::noEdits () |
| Generates no edits.
|
|
EditGenerator | clang::transformer::noopEdit (RangeSelector Anchor) |
| Generates a single, no-op edit anchored at the start location of the specified range.
|
|
ASTEdit | clang::transformer::note (RangeSelector Anchor, TextGenerator Note) |
| Generates a single, no-op edit with the associated note anchored at the start location of the specified range.
|
|
EditGenerator | clang::transformer::ifBound (std::string ID, ASTEdit TrueEdit, ASTEdit FalseEdit) |
| Version of ifBound specialized to ASTEdit .
|
|
EditGenerator | clang::transformer::ifBound (std::string ID, ASTEdit TrueEdit) |
| Version of ifBound that has no "False" branch.
|
|
EditGenerator | clang::transformer::flattenVector (SmallVector< EditGenerator, 2 > Generators) |
| Flattens a list of generators into a single generator whose elements are the concatenation of the results of the argument generators.
|
|
EditGenerator | clang::transformer::detail::injectEdits (ASTEdit E) |
| Helper function to construct an EditGenerator .
|
|
EditGenerator | clang::transformer::detail::injectEdits (EditGenerator G) |
|
template<typename... Ts> |
EditGenerator | clang::transformer::flatten (Ts &&...Edits) |
|
ASTEdit | clang::transformer::changeTo (RangeSelector Target, TextGenerator Replacement) |
| Replaces a portion of the source text with Replacement .
|
|
ASTEdit | clang::transformer::change (RangeSelector Target, TextGenerator Replacement) |
| DEPRECATED: use changeTo .
|
|
ASTEdit | clang::transformer::changeTo (TextGenerator Replacement) |
| Replaces the entirety of a RewriteRule's match with Replacement .
|
|
ASTEdit | clang::transformer::change (TextGenerator Replacement) |
| DEPRECATED: use changeTo .
|
|
ASTEdit | clang::transformer::insertBefore (RangeSelector S, TextGenerator Replacement) |
| Inserts Replacement before S , leaving the source selected by \S unchanged.
|
|
ASTEdit | clang::transformer::insertAfter (RangeSelector S, TextGenerator Replacement) |
| Inserts Replacement after S , leaving the source selected by \S unchanged.
|
|
ASTEdit | clang::transformer::remove (RangeSelector S) |
| Removes the source selected by S .
|
|
ASTEdit | clang::transformer::addInclude (RangeSelector Target, StringRef Header, IncludeFormat Format=IncludeFormat::Quoted) |
| Adds an include directive for the given header to the file of Target .
|
|
ASTEdit | clang::transformer::addInclude (StringRef Header, IncludeFormat Format=IncludeFormat::Quoted) |
| Adds an include directive for the given header to the file associated with RootID .
|
|
template<typename Callable > |
ASTEdit | clang::transformer::withMetadata (ASTEdit Edit, Callable Metadata) |
|
EditGenerator | clang::transformer::shrinkTo (RangeSelector outer, RangeSelector inner) |
| Assuming that the inner range is enclosed by the outer range, creates precision edits to remove the parts of the outer range that are not included in the inner range.
|
|
RewriteRule | clang::transformer::detail::makeRule (ast_matchers::internal::DynTypedMatcher M, EditGenerator Edits) |
|
template<typename MetadataT > |
RewriteRuleWith< MetadataT > | clang::transformer::detail::makeRule (ast_matchers::internal::DynTypedMatcher M, EditGenerator Edits, Generator< MetadataT > Metadata) |
|
EditGenerator | clang::transformer::detail::makeEditGenerator (EditGenerator Edits) |
|
EditGenerator | clang::transformer::detail::makeEditGenerator (llvm::SmallVector< ASTEdit, 1 > Edits) |
|
EditGenerator | clang::transformer::detail::makeEditGenerator (ASTEdit Edit) |
|
void | clang::transformer::addInclude (RewriteRuleBase &Rule, llvm::StringRef Header, IncludeFormat Format=IncludeFormat::Quoted) |
| For every case in Rule, adds an include directive for the given header.
|
|
template<int & ..., typename MetadataT > |
std::enable_if_t<!std::is_same< MetadataT, void >::value, RewriteRule > | clang::transformer::stripMetadata (RewriteRuleWith< MetadataT > Rule) |
| Converts a RewriteRuleWith<T> to a RewriteRule by stripping off the metadata generators.
|
|
EditGenerator | clang::transformer::rewriteDescendants (std::string NodeId, RewriteRule Rule) |
| Applies Rule to all descendants of the node bound to NodeId .
|
|
ast_matchers::internal::DynTypedMatcher | clang::transformer::detail::buildMatcher (const RewriteRuleBase &Rule) |
| Builds a single matcher for the rule, covering all of the rule's cases.
|
|
std::vector< ast_matchers::internal::DynTypedMatcher > | clang::transformer::detail::buildMatchers (const RewriteRuleBase &Rule) |
| Builds a set of matchers that cover the rule.
|
|
SourceLocation | clang::transformer::detail::getRuleMatchLoc (const ast_matchers::MatchFinder::MatchResult &Result) |
| Gets the beginning location of the source matched by a rewrite rule.
|
|
size_t | clang::transformer::detail::findSelectedCase (const ast_matchers::MatchFinder::MatchResult &Result, const RewriteRuleBase &Rule) |
| Returns the index of the Case of Rule that was selected in the match result.
|
|
|
template<int & ..., typename EditsT > |
RewriteRule | clang::transformer::makeRule (ast_matchers::internal::DynTypedMatcher M, EditsT &&Edits) |
| Constructs a simple RewriteRule .
|
|
RewriteRule | clang::transformer::makeRule (ast_matchers::internal::DynTypedMatcher M, std::initializer_list< ASTEdit > Edits) |
|
|
template<typename MetadataT , int & ..., typename EditsT > |
RewriteRuleWith< MetadataT > | clang::transformer::makeRule (ast_matchers::internal::DynTypedMatcher M, EditsT &&Edits, Generator< MetadataT > Metadata) |
| Overloads of makeRule that also generate metadata when matching.
|
|
template<typename MetadataT > |
RewriteRuleWith< MetadataT > | clang::transformer::makeRule (ast_matchers::internal::DynTypedMatcher M, std::initializer_list< ASTEdit > Edits, Generator< MetadataT > Metadata) |
|
|
template<typename MetadataT > |
RewriteRuleWith< MetadataT > | clang::transformer::applyFirst (ArrayRef< RewriteRuleWith< MetadataT > > Rules) |
| Applies the first rule whose pattern matches; other rules are ignored.
|
|
template<> |
RewriteRuleWith< void > | clang::transformer::applyFirst (ArrayRef< RewriteRuleWith< void > > Rules) |
|
template<typename MetadataT > |
RewriteRuleWith< MetadataT > | clang::transformer::applyFirst (const std::vector< RewriteRuleWith< MetadataT > > &Rules) |
|
template<typename MetadataT > |
RewriteRuleWith< MetadataT > | clang::transformer::applyFirst (std::initializer_list< RewriteRuleWith< MetadataT > > Rules) |
|
|
llvm::Expected< SmallVector< Edit, 1 > > | clang::transformer::detail::rewriteDescendants (const Decl &Node, RewriteRule Rule, const ast_matchers::MatchFinder::MatchResult &Result) |
| The following overload set is a version of rewriteDescendants that operates directly on the AST, rather than generating a Transformer combinator.
|
|
llvm::Expected< SmallVector< Edit, 1 > > | clang::transformer::detail::rewriteDescendants (const Stmt &Node, RewriteRule Rule, const ast_matchers::MatchFinder::MatchResult &Result) |
|
llvm::Expected< SmallVector< Edit, 1 > > | clang::transformer::detail::rewriteDescendants (const TypeLoc &Node, RewriteRule Rule, const ast_matchers::MatchFinder::MatchResult &Result) |
|
llvm::Expected< SmallVector< Edit, 1 > > | clang::transformer::detail::rewriteDescendants (const DynTypedNode &Node, RewriteRule Rule, const ast_matchers::MatchFinder::MatchResult &Result) |
|
Defines the RewriteRule class and related functions for creating, modifying and interpreting RewriteRules.
Definition in file RewriteRule.h.