19 #ifndef LLVM_CLANG_TOOLING_CORE_REPLACEMENT_H
20 #define LLVM_CLANG_TOOLING_CORE_REPLACEMENT_H
24 #include "llvm/ADT/StringRef.h"
25 #include "llvm/Support/Error.h"
41 Range(
unsigned Offset,
unsigned Length) : Offset(Offset), Length(Length) {}
53 return Offset + Length > RHS.Offset &&
Offset < RHS.Offset + RHS.Length;
58 return RHS.Offset >=
Offset &&
59 (RHS.Offset + RHS.Length) <= (
Offset + Length);
89 StringRef ReplacementText);
94 unsigned Length, StringRef ReplacementText);
98 StringRef ReplacementText,
102 template <
typename Node>
104 StringRef ReplacementText,
129 StringRef ReplacementText);
132 StringRef ReplacementText,
135 std::string FilePath;
136 Range ReplacementRange;
137 std::string ReplacementText;
195 void deduplicate(std::vector<Replacement> &Replaces,
196 std::vector<Range> &Conflicts);
229 const std::vector<Range> &Ranges);
233 std::map<std::string, Replacements>
242 template <
typename Node>
244 const Node &NodeToReplace, StringRef ReplacementText,
248 setFromSourceRange(Sources, Range, ReplacementText, LangOpts);
254 #endif // LLVM_CLANG_TOOLING_CORE_REPLACEMENT_H
static CharSourceRange getTokenRange(SourceRange R)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Defines the clang::LangOptions interface.
Represents a character-granular source range.
Encodes a location in the source.
ast_type_traits::DynTypedNode Node
Rewriter - This is the main interface to the rewrite buffers.
Defines the clang::SourceLocation class and associated facilities.
This class handles loading and caching of source files into memory.