aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-01-07 01:21:02 +0000
committerNico Weber <nicolasweber@gmx.de>2013-01-07 01:21:02 +0000
commit4a2ef80d896c1bac38ce113ec19a8d509a619288 (patch)
treefb9610d322033e7b2525fe1d5136ce6651ecaf18
parent2626a2ad844a762dfda50b861c46918924eb44aa (diff)
Simplify. No behavior change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171680 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/Diagnostic.h4
-rw-r--r--include/clang/Basic/SourceLocation.h12
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) {