15#ifndef LLVM_CLANG_TOOLING_TRANSFORMER_REWRITERULE_H
16#define LLVM_CLANG_TOOLING_TRANSFORMER_REWRITERULE_H
24#include "llvm/ADT/Any.h"
25#include "llvm/ADT/STLExtras.h"
26#include "llvm/ADT/SmallVector.h"
27#include "llvm/Support/Error.h"
33namespace transformer {
65template <
typename T>
using Generator = std::shared_ptr<MatchComputation<T>>;
150 edit(std::move(FalseEdit)));
179extern const char RootID[];
199 return changeTo(std::move(Replacement));
211 return changeTo(
after(std::move(S)), std::move(Replacement));
243template <
typename Callable>
246 [Gen = std::move(Metadata)](
284 ast_matchers::internal::DynTypedMatcher
Matcher;
308template <
typename MetadataT>
313 R.
Cases = {{std::move(M), std::move(Edits)}};
327template <
int &...,
typename EditsT>
335 std::initializer_list<ASTEdit> Edits);
340template <
typename MetadataT,
int &...,
typename EditsT>
346 std::move(Metadata));
349template <
typename MetadataT>
351 std::initializer_list<ASTEdit> Edits,
355 std::move(Metadata));
412template <
typename MetadataT>
416 for (
auto &Rule : Rules) {
417 assert(Rule.Cases.size() == Rule.Metadata.size() &&
418 "mis-match in case and metadata array size");
419 R.
Cases.append(Rule.Cases.begin(), Rule.Cases.end());
420 R.
Metadata.append(Rule.Metadata.begin(), Rule.Metadata.end());
428template <
typename MetadataT>
429RewriteRuleWith<MetadataT>
434template <
typename MetadataT>
435RewriteRuleWith<MetadataT>
443template <
int &...,
typename MetadataT>
444std::enable_if_t<!std::is_same<MetadataT, void>::value,
RewriteRule>
447 R.
Cases = std::move(Rule.Cases);
513ast_matchers::internal::DynTypedMatcher
523std::vector<ast_matchers::internal::DynTypedMatcher>
535 const RewriteRuleBase &Rule);
llvm::MachO::Target Target
Defines a combinator library supporting the definition of selectors, which select source ranges based...
Represents a character-granular source range.
Decl - This represents one declaration (or definition), e.g.
A dynamically typed AST node container.
Encodes a location in the source.
Stmt - This represents one statement.
Base wrapper for a particular "section" of type source info.
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.
Contains all information for a given match.