14#include "llvm/Support/Error.h"
21using ::clang::ast_matchers::MatchFinder;
27 if (
Result.Context->getDiagnostics().hasErrorOccurred())
39 std::map<FileID, AtomicChange> ChangesByFileID;
40 for (
const auto &
T : Edits) {
41 auto ID =
Result.SourceManager->getFileID(
T.Range.getBegin());
42 auto Iter = ChangesByFileID
44 T.Range.getBegin(),
T.Metadata))
46 auto &AC =
Iter->second;
50 AC.replace(*
Result.SourceManager,
T.Range,
T.Replacement)) {
51 return std::move(Err);
55 AC.addHeader(
T.Replacement);
61 Changes.reserve(ChangesByFileID.size());
62 for (
auto &IDChangePair : ChangesByFileID)
63 Changes.push_back(std::move(IDChangePair.second));
71 for (
auto &Matcher : Impl->buildMatchers())
76 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.