aboutsummaryrefslogtreecommitdiff
path: root/clang-tidy/fuchsia
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2018-08-09 22:42:26 +0000
committerStephen Kelly <steveire@gmail.com>2018-08-09 22:42:26 +0000
commit4cacbf2c444f87871805c14748142cd9d92ff716 (patch)
treecd29442ae42c99a6b607b64eec72d705cda151ef /clang-tidy/fuchsia
parent0a2b7a8dca76ba0f8fc24ebc81461ab6bc0d89fd (diff)
Port getLocStart -> getBeginLoc
Reviewers: javed.absar Subscribers: nemanjai, kbarton, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50354 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@339400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-tidy/fuchsia')
-rw-r--r--clang-tidy/fuchsia/DefaultArgumentsCheck.cpp16
-rw-r--r--clang-tidy/fuchsia/MultipleInheritanceCheck.cpp5
-rw-r--r--clang-tidy/fuchsia/OverloadedOperatorCheck.cpp4
-rw-r--r--clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp2
-rw-r--r--clang-tidy/fuchsia/TrailingReturnCheck.cpp2
-rw-r--r--clang-tidy/fuchsia/VirtualInheritanceCheck.cpp2
6 files changed, 14 insertions, 17 deletions
diff --git a/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp b/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp
index 493ce9a2..f6c64ce1 100644
--- a/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp
+++ b/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp
@@ -27,8 +27,7 @@ void DefaultArgumentsCheck::check(const MatchFinder::MatchResult &Result) {
Result.Nodes.getNodeAs<CXXDefaultArgExpr>("stmt")) {
diag(S->getUsedLocation(),
"calling a function that uses a default argument is disallowed");
- diag(S->getParam()->getLocStart(),
- "default parameter was declared here",
+ diag(S->getParam()->getBeginLoc(), "default parameter was declared here",
DiagnosticIDs::Note);
} else if (const ParmVarDecl *D =
Result.Nodes.getNodeAs<ParmVarDecl>("decl")) {
@@ -37,11 +36,11 @@ void DefaultArgumentsCheck::check(const MatchFinder::MatchResult &Result) {
if (DefaultArgRange.getEnd() != D->getLocEnd()) {
return;
} else if (DefaultArgRange.getBegin().isMacroID()) {
- diag(D->getLocStart(),
+ diag(D->getBeginLoc(),
"declaring a parameter with a default argument is disallowed");
} else {
- SourceLocation StartLocation = D->getName().empty() ?
- D->getLocStart() : D->getLocation();
+ SourceLocation StartLocation =
+ D->getName().empty() ? D->getBeginLoc() : D->getLocation();
SourceRange RemovalRange(Lexer::getLocForEndOfToken(
StartLocation, 0,
@@ -51,10 +50,9 @@ void DefaultArgumentsCheck::check(const MatchFinder::MatchResult &Result) {
DefaultArgRange.getEnd()
);
- diag(D->getLocStart(),
- "declaring a parameter with a default argument is disallowed")
- << D
- << FixItHint::CreateRemoval(RemovalRange);
+ diag(D->getBeginLoc(),
+ "declaring a parameter with a default argument is disallowed")
+ << D << FixItHint::CreateRemoval(RemovalRange);
}
}
}
diff --git a/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp b/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp
index 35504c98..a49c952f 100644
--- a/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp
+++ b/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp
@@ -120,9 +120,8 @@ void MultipleInheritanceCheck::check(const MatchFinder::MatchResult &Result) {
}
if (NumConcrete > 1) {
- diag(D->getLocStart(),
- "inheriting mulitple classes that aren't "
- "pure virtual is discouraged");
+ diag(D->getBeginLoc(), "inheriting mulitple classes that aren't "
+ "pure virtual is discouraged");
}
}
}
diff --git a/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp b/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
index 847f7635..8e6c74f3 100644
--- a/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
+++ b/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
@@ -34,8 +34,8 @@ void OverloadedOperatorCheck::registerMatchers(MatchFinder *Finder) {
void OverloadedOperatorCheck::check(const MatchFinder::MatchResult &Result) {
const auto *D = Result.Nodes.getNodeAs<FunctionDecl>("decl");
assert(D && "No FunctionDecl captured!");
-
- SourceLocation Loc = D->getLocStart();
+
+ SourceLocation Loc = D->getBeginLoc();
if (Loc.isValid())
diag(Loc, "overloading %0 is disallowed") << D;
}
diff --git a/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp b/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp
index 16a534b1..e33f90ac 100644
--- a/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp
+++ b/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp
@@ -51,7 +51,7 @@ void StaticallyConstructedObjectsCheck::registerMatchers(MatchFinder *Finder) {
void StaticallyConstructedObjectsCheck::check(
const MatchFinder::MatchResult &Result) {
if (const auto *D = Result.Nodes.getNodeAs<VarDecl>("decl"))
- diag(D->getLocStart(), "static objects are disallowed; if possible, use a "
+ diag(D->getBeginLoc(), "static objects are disallowed; if possible, use a "
"constexpr constructor instead");
}
diff --git a/clang-tidy/fuchsia/TrailingReturnCheck.cpp b/clang-tidy/fuchsia/TrailingReturnCheck.cpp
index 7af0c9c6..4ffa3f79 100644
--- a/clang-tidy/fuchsia/TrailingReturnCheck.cpp
+++ b/clang-tidy/fuchsia/TrailingReturnCheck.cpp
@@ -43,7 +43,7 @@ void TrailingReturnCheck::registerMatchers(MatchFinder *Finder) {
void TrailingReturnCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *D = Result.Nodes.getNodeAs<Decl>("decl"))
- diag(D->getLocStart(),
+ diag(D->getBeginLoc(),
"a trailing return type is disallowed for this type of declaration");
}
diff --git a/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp b/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp
index f3da2b6e..82f44103 100644
--- a/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp
+++ b/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp
@@ -35,7 +35,7 @@ void VirtualInheritanceCheck::registerMatchers(MatchFinder *Finder) {
void VirtualInheritanceCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *D = Result.Nodes.getNodeAs<CXXRecordDecl>("decl"))
- diag(D->getLocStart(), "direct virtual inheritance is disallowed");
+ diag(D->getBeginLoc(), "direct virtual inheritance is disallowed");
}
} // namespace fuchsia