14#include "llvm/Support/Error.h"
22using ::clang::ast_matchers::MatchFinder;
28 if (
Result.Context->getDiagnostics().hasErrorOccurred())
40 std::map<FileID, AtomicChange> ChangesByFileID;
41 for (
const auto &
T : Edits) {
42 auto ID =
Result.SourceManager->getFileID(
T.Range.getBegin());
43 auto Iter = ChangesByFileID
45 T.Range.getBegin(),
T.Metadata))
47 auto &AC =
Iter->second;
51 AC.replace(*
Result.SourceManager,
T.Range,
T.Replacement)) {
52 return std::move(Err);
56 AC.addHeader(
T.Replacement);
62 Changes.reserve(ChangesByFileID.size());
63 for (
auto &IDChangePair : ChangesByFileID)
64 Changes.push_back(std::move(IDChangePair.second));
72 for (
auto &Matcher : Impl->buildMatchers())
77 if (
Result.Context->getDiagnostics().hasErrorOccurred())
Defines the clang::SourceLocation class and associated facilities.
A class to allow finding matches over the Clang AST.
bool addDynamicMatcher(const internal::DynTypedMatcher &NodeMatch, MatchCallback *Action)
Adds a matcher to execute when running over the AST.
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.
const FunctionProtoType * T
Contains all information for a given match.