summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp b/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp
index 954f92d43b0..8be88724908 100644
--- a/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp
+++ b/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp
@@ -12,7 +12,7 @@
namespace clang {
namespace tidy {
-namespace utils {
+namespace utils {
namespace {
@@ -254,7 +254,8 @@ std::vector<FixItHint> IncludeSorter::GetEdits() {
// Otherwise report the current block edit and start a new block.
} else {
if (CurrentEndLine) {
- Fixes.push_back(CreateFixIt(CurrentRange, CurrentText));
+ Fixes.push_back(
+ FixItHint::CreateReplacement(CurrentRange, CurrentText));
}
CurrentEndLine = LineEdit.first;
@@ -264,7 +265,7 @@ std::vector<FixItHint> IncludeSorter::GetEdits() {
}
// Finally, report the current block edit if there is one.
if (CurrentEndLine) {
- Fixes.push_back(CreateFixIt(CurrentRange, CurrentText));
+ Fixes.push_back(FixItHint::CreateReplacement(CurrentRange, CurrentText));
}
// Reset the remaining internal state.
@@ -273,16 +274,6 @@ std::vector<FixItHint> IncludeSorter::GetEdits() {
return Fixes;
}
-// Creates a fix-it for the given replacements.
-// Takes the the source location that will be replaced, and the new text.
-FixItHint IncludeSorter::CreateFixIt(SourceRange EditRange,
- const std::string &NewText) {
- FixItHint Fix;
- Fix.RemoveRange = CharSourceRange::getCharRange(EditRange);
- Fix.CodeToInsert = NewText;
- return Fix;
-}
-
IncludeSorter::IncludeStyle
IncludeSorter::parseIncludeStyle(const std::string &Value) {
return Value == "llvm" ? IS_LLVM : IS_Google;
OpenPOWER on IntegriCloud