diff options
-rw-r--r-- | include/clang/Basic/Diagnostic.h | 4 | ||||
-rw-r--r-- | include/clang/Basic/SourceLocation.h | 12 |
2 files changed, 5 insertions, 11 deletions
diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index 85e2cf5c7a..3af8ea2094 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -77,7 +77,7 @@ public: bool BeforePreviousInsertions = false) { FixItHint Hint; Hint.RemoveRange = - CharSourceRange(SourceRange(InsertionLoc, InsertionLoc), false); + CharSourceRange::getCharRange(InsertionLoc, InsertionLoc); Hint.CodeToInsert = Code; Hint.BeforePreviousInsertions = BeforePreviousInsertions; return Hint; @@ -90,7 +90,7 @@ public: bool BeforePreviousInsertions = false) { FixItHint Hint; Hint.RemoveRange = - CharSourceRange(SourceRange(InsertionLoc, InsertionLoc), false); + CharSourceRange::getCharRange(InsertionLoc, InsertionLoc); Hint.InsertFromRange = FromRange; Hint.BeforePreviousInsertions = BeforePreviousInsertions; return Hint; diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h index cc7415ce56..edfdafdb03 100644 --- a/include/clang/Basic/SourceLocation.h +++ b/include/clang/Basic/SourceLocation.h @@ -227,20 +227,14 @@ class CharSourceRange { bool IsTokenRange; public: CharSourceRange() : IsTokenRange(false) {} - CharSourceRange(SourceRange R, bool ITR) : Range(R),IsTokenRange(ITR){} + CharSourceRange(SourceRange R, bool ITR) : Range(R), IsTokenRange(ITR) {} static CharSourceRange getTokenRange(SourceRange R) { - CharSourceRange Result; - Result.Range = R; - Result.IsTokenRange = true; - return Result; + return CharSourceRange(R, true); } static CharSourceRange getCharRange(SourceRange R) { - CharSourceRange Result; - Result.Range = R; - Result.IsTokenRange = false; - return Result; + return CharSourceRange(R, false); } static CharSourceRange getTokenRange(SourceLocation B, SourceLocation E) { |