19 #ifndef LLVM_CLANG_TOOLING_CORE_REPLACEMENT_H
20 #define LLVM_CLANG_TOOLING_CORE_REPLACEMENT_H
24 #include "llvm/ADT/StringRef.h"
39 Range(
unsigned Offset,
unsigned Length) : Offset(Offset), Length(Length) {}
51 return Offset + Length > RHS.Offset &&
Offset < RHS.Offset + RHS.Length;
56 return RHS.Offset >=
Offset &&
57 (RHS.Offset + RHS.Length) <= (
Offset + Length);
82 StringRef ReplacementText);
87 unsigned Length, StringRef ReplacementText);
91 StringRef ReplacementText,
95 template <
typename Node>
97 StringRef ReplacementText,
122 StringRef ReplacementText);
125 StringRef ReplacementText,
128 std::string FilePath;
129 Range ReplacementRange;
130 std::string ReplacementText;
134 bool operator<(
const Replacement &LHS,
const Replacement &RHS);
137 bool operator==(
const Replacement &LHS,
const Replacement &RHS);
184 void deduplicate(std::vector<Replacement> &Replaces,
185 std::vector<Range> &Conflicts);
223 template <
typename Node>
225 const Node &NodeToReplace, StringRef ReplacementText,
229 setFromSourceRange(Sources, Range, ReplacementText, LangOpts);
235 #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. The SourceManager can decode this to get at the full include stack...
ast_type_traits::DynTypedNode Node
Defines the clang::SourceLocation class and associated facilities.
This class handles loading and caching of source files into memory.