[clang-tools-extra] r339400 - Port getLocStart -> getBeginLoc
Stephen Kelly via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 9 15:42:27 PDT 2018
Author: steveire
Date: Thu Aug 9 15:42:26 2018
New Revision: 339400
URL: http://llvm.org/viewvc/llvm-project?rev=339400&view=rev
Log:
Port getLocStart -> getBeginLoc
Reviewers: javed.absar
Subscribers: nemanjai, kbarton, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D50354
Modified:
clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
clang-tools-extra/trunk/clang-doc/Mapper.cpp
clang-tools-extra/trunk/clang-move/ClangMove.cpp
clang-tools-extra/trunk/clang-tidy/abseil/StringFindStartswithCheck.cpp
clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp
clang-tools-extra/trunk/clang-tidy/android/ComparisonInTempFailureRetryCheck.cpp
clang-tools-extra/trunk/clang-tidy/boost/UseToStringCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/AssertSideEffectCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/DanglingHandleCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/IntegerDivisionCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/MisplacedWideningCastCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/MultipleStatementMacroCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/SizeofContainerCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/SizeofExpressionCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/StringConstructorCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/SwappedArgumentsCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/TerminatingContinueCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/UndelegatedConstructorCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
clang-tools-extra/trunk/clang-tidy/bugprone/VirtualNearMissCheck.cpp
clang-tools-extra/trunk/clang-tidy/cert/LimitedRandomnessCheck.cpp
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp
clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp
clang-tools-extra/trunk/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp
clang-tools-extra/trunk/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
clang-tools-extra/trunk/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp
clang-tools-extra/trunk/clang-tidy/fuchsia/TrailingReturnCheck.cpp
clang-tools-extra/trunk/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp
clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp
clang-tools-extra/trunk/clang-tidy/google/ExplicitMakePairCheck.cpp
clang-tools-extra/trunk/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
clang-tools-extra/trunk/clang-tidy/google/IntegerTypesCheck.cpp
clang-tools-extra/trunk/clang-tidy/google/OverloadedUnaryAndCheck.cpp
clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
clang-tools-extra/trunk/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp
clang-tools-extra/trunk/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp
clang-tools-extra/trunk/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp
clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/ShrinkToFitCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/UnaryStaticAssertCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/UseBoolLiteralsCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDefaultCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/UseTransparentFunctorsCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/UseUsingCheck.cpp
clang-tools-extra/trunk/clang-tidy/objc/AvoidNSErrorInitCheck.cpp
clang-tools-extra/trunk/clang-tidy/objc/AvoidSpinlockCheck.cpp
clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp
clang-tools-extra/trunk/clang-tidy/performance/ForRangeCopyCheck.cpp
clang-tools-extra/trunk/clang-tidy/performance/ImplicitConversionInLoopCheck.cpp
clang-tools-extra/trunk/clang-tidy/performance/InefficientAlgorithmCheck.cpp
clang-tools-extra/trunk/clang-tidy/performance/InefficientVectorOperationCheck.cpp
clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp
clang-tools-extra/trunk/clang-tidy/performance/TypePromotionInMathFnCheck.cpp
clang-tools-extra/trunk/clang-tidy/performance/UnnecessaryValueParamCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp
clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/DeletedDefaultCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/MisplacedArrayIndexCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/NonConstParameterCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/RedundantStringCStrCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/StringCompareCheck.cpp
clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
clang-tools-extra/trunk/clang-tidy/utils/ASTUtils.cpp
clang-tools-extra/trunk/clang-tidy/utils/NamespaceAliaser.cpp
clang-tools-extra/trunk/clang-tidy/utils/UsingInserter.cpp
clang-tools-extra/trunk/clangd/CodeComplete.cpp
clang-tools-extra/trunk/clangd/CodeCompletionStrings.cpp
clang-tools-extra/trunk/clangd/XRefs.cpp
clang-tools-extra/trunk/tool-template/ToolTemplate.cpp
clang-tools-extra/trunk/unittests/clang-tidy/IncludeInserterTest.cpp
clang-tools-extra/trunk/unittests/clang-tidy/NamespaceAliaserTest.cpp
clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp
clang-tools-extra/trunk/unittests/clang-tidy/UsingInserterTest.cpp
Modified: clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp (original)
+++ clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp Thu Aug 9 15:42:26 2018
@@ -46,7 +46,7 @@ SourceLocation startLocationForType(Type
return NestedNameSpecifier.getBeginLoc();
TLoc = TLoc.getNextTypeLoc();
}
- return TLoc.getLocStart();
+ return TLoc.getBeginLoc();
}
SourceLocation endLocationForType(TypeLoc TLoc) {
@@ -275,7 +275,7 @@ bool isNestedDeclContext(const DeclConte
// Returns true if \p D is visible at \p Loc with DeclContext \p DeclCtx.
bool isDeclVisibleAtLocation(const SourceManager &SM, const Decl *D,
const DeclContext *DeclCtx, SourceLocation Loc) {
- SourceLocation DeclLoc = SM.getSpellingLoc(D->getLocStart());
+ SourceLocation DeclLoc = SM.getSpellingLoc(D->getBeginLoc());
Loc = SM.getSpellingLoc(Loc);
return SM.isBeforeInTranslationUnit(DeclLoc, Loc) &&
(SM.getFileID(DeclLoc) == SM.getFileID(Loc) &&
@@ -634,7 +634,7 @@ static SourceLocation getLocAfterNamespa
const SourceManager &SM,
const LangOptions &LangOpts) {
std::unique_ptr<Lexer> Lex =
- getLexerStartingFromLoc(NsDecl->getLocStart(), SM, LangOpts);
+ getLexerStartingFromLoc(NsDecl->getBeginLoc(), SM, LangOpts);
assert(Lex.get() &&
"Failed to create lexer from the beginning of namespace.");
if (!Lex.get())
@@ -709,7 +709,7 @@ void ChangeNamespaceTool::moveOldNamespa
void ChangeNamespaceTool::moveClassForwardDeclaration(
const ast_matchers::MatchFinder::MatchResult &Result,
const NamedDecl *FwdDecl) {
- SourceLocation Start = FwdDecl->getLocStart();
+ SourceLocation Start = FwdDecl->getBeginLoc();
SourceLocation End = FwdDecl->getLocEnd();
const SourceManager &SM = *Result.SourceManager;
SourceLocation AfterSemi = Lexer::findLocationAfterToken(
@@ -879,7 +879,7 @@ void ChangeNamespaceTool::fixTypeLoc(
if (!llvm::StringRef(D->getQualifiedNameAsString())
.startswith(OldNamespace + "::"))
return false;
- auto ExpansionLoc = Result.SourceManager->getExpansionLoc(D->getLocStart());
+ auto ExpansionLoc = Result.SourceManager->getExpansionLoc(D->getBeginLoc());
if (ExpansionLoc.isInvalid())
return false;
llvm::StringRef Filename = Result.SourceManager->getFilename(ExpansionLoc);
@@ -910,7 +910,7 @@ void ChangeNamespaceTool::fixTypeLoc(
void ChangeNamespaceTool::fixUsingShadowDecl(
const ast_matchers::MatchFinder::MatchResult &Result,
const UsingDecl *UsingDeclaration) {
- SourceLocation Start = UsingDeclaration->getLocStart();
+ SourceLocation Start = UsingDeclaration->getBeginLoc();
SourceLocation End = UsingDeclaration->getLocEnd();
if (Start.isInvalid() || End.isInvalid())
return;
Modified: clang-tools-extra/trunk/clang-doc/Mapper.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-doc/Mapper.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-doc/Mapper.cpp (original)
+++ clang-tools-extra/trunk/clang-doc/Mapper.cpp Thu Aug 9 15:42:26 2018
@@ -78,13 +78,13 @@ MapASTVisitor::getComment(const NamedDec
int MapASTVisitor::getLine(const NamedDecl *D,
const ASTContext &Context) const {
- return Context.getSourceManager().getPresumedLoc(D->getLocStart()).getLine();
+ return Context.getSourceManager().getPresumedLoc(D->getBeginLoc()).getLine();
}
llvm::StringRef MapASTVisitor::getFile(const NamedDecl *D,
const ASTContext &Context) const {
return Context.getSourceManager()
- .getPresumedLoc(D->getLocStart())
+ .getPresumedLoc(D->getBeginLoc())
.getFilename();
}
Modified: clang-tools-extra/trunk/clang-move/ClangMove.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-move/ClangMove.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-move/ClangMove.cpp (original)
+++ clang-tools-extra/trunk/clang-move/ClangMove.cpp Thu Aug 9 15:42:26 2018
@@ -117,7 +117,7 @@ AST_POLYMORPHIC_MATCHER_P(isExpansionInF
AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc),
std::string, AbsoluteFilePath) {
auto &SourceManager = Finder->getASTContext().getSourceManager();
- auto ExpansionLoc = SourceManager.getExpansionLoc(Node.getLocStart());
+ auto ExpansionLoc = SourceManager.getExpansionLoc(Node.getBeginLoc());
if (ExpansionLoc.isInvalid())
return false;
auto FileEntry =
@@ -323,7 +323,7 @@ clang::CharSourceRange
getFullRange(const clang::Decl *D,
const clang::LangOptions &options = clang::LangOptions()) {
const auto &SM = D->getASTContext().getSourceManager();
- clang::SourceRange Full(SM.getExpansionLoc(D->getLocStart()),
+ clang::SourceRange Full(SM.getExpansionLoc(D->getBeginLoc()),
getLocForEndOfDecl(D));
// Expand to comments that are associated with the Decl.
if (const auto *Comment = D->getASTContext().getRawCommentForDeclNoCache(D)) {
@@ -331,8 +331,8 @@ getFullRange(const clang::Decl *D,
Full.setEnd(Comment->getLocEnd());
// FIXME: Don't delete a preceding comment, if there are no other entities
// it could refer to.
- if (SM.isBeforeInTranslationUnit(Comment->getLocStart(), Full.getBegin()))
- Full.setBegin(Comment->getLocStart());
+ if (SM.isBeforeInTranslationUnit(Comment->getBeginLoc(), Full.getBegin()))
+ Full.setBegin(Comment->getBeginLoc());
}
return clang::CharSourceRange::getCharRange(Full);
@@ -351,7 +351,7 @@ bool isInHeaderFile(const clang::Decl *D
const auto &SM = D->getASTContext().getSourceManager();
if (OldHeader.empty())
return false;
- auto ExpansionLoc = SM.getExpansionLoc(D->getLocStart());
+ auto ExpansionLoc = SM.getExpansionLoc(D->getBeginLoc());
if (ExpansionLoc.isInvalid())
return false;
Modified: clang-tools-extra/trunk/clang-tidy/abseil/StringFindStartswithCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/abseil/StringFindStartswithCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/abseil/StringFindStartswithCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/abseil/StringFindStartswithCheck.cpp Thu Aug 9 15:42:26 2018
@@ -71,7 +71,7 @@ void StringFindStartswithCheck::check(co
->getImplicitObjectArgument();
assert(Haystack != nullptr);
- if (ComparisonExpr->getLocStart().isMacroID())
+ if (ComparisonExpr->getBeginLoc().isMacroID())
return;
// Get the source code blocks (as characters) for both the string object
@@ -94,7 +94,7 @@ void StringFindStartswithCheck::check(co
// Create the warning message and a FixIt hint replacing the original expr.
auto Diagnostic =
- diag(ComparisonExpr->getLocStart(),
+ diag(ComparisonExpr->getBeginLoc(),
(StringRef("use ") + StartswithStr + " instead of find() " +
ComparisonExpr->getOpcodeStr() + " 0")
.str());
@@ -107,7 +107,7 @@ void StringFindStartswithCheck::check(co
// Create a preprocessor #include FixIt hint (CreateIncludeInsertion checks
// whether this already exists).
auto IncludeHint = IncludeInserter->CreateIncludeInsertion(
- Source.getFileID(ComparisonExpr->getLocStart()), AbseilStringsMatchHeader,
+ Source.getFileID(ComparisonExpr->getBeginLoc()), AbseilStringsMatchHeader,
false);
if (IncludeHint) {
Diagnostic << *IncludeHint;
Modified: clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp Thu Aug 9 15:42:26 2018
@@ -25,7 +25,7 @@ namespace {
// end of the string. Else, add <Mode>.
std::string buildFixMsgForStringFlag(const Expr *Arg, const SourceManager &SM,
const LangOptions &LangOpts, char Mode) {
- if (Arg->getLocStart().isMacroID())
+ if (Arg->getBeginLoc().isMacroID())
return (Lexer::getSourceText(
CharSourceRange::getTokenRange(Arg->getSourceRange()), SM,
LangOpts) +
@@ -75,7 +75,7 @@ void CloexecCheck::insertMacroFlag(const
void CloexecCheck::replaceFunc(const MatchFinder::MatchResult &Result,
StringRef WarningMsg, StringRef FixMsg) {
const auto *MatchedCall = Result.Nodes.getNodeAs<CallExpr>(FuncBindingStr);
- diag(MatchedCall->getLocStart(), WarningMsg)
+ diag(MatchedCall->getBeginLoc(), WarningMsg)
<< FixItHint::CreateReplacement(MatchedCall->getSourceRange(), FixMsg);
}
@@ -94,7 +94,7 @@ void CloexecCheck::insertStringFlag(
const std::string &ReplacementText = buildFixMsgForStringFlag(
ModeArg, *Result.SourceManager, Result.Context->getLangOpts(), Mode);
- diag(ModeArg->getLocStart(), "use %0 mode '%1' to set O_CLOEXEC")
+ diag(ModeArg->getBeginLoc(), "use %0 mode '%1' to set O_CLOEXEC")
<< FD << std::string(1, Mode)
<< FixItHint::CreateReplacement(ModeArg->getSourceRange(),
ReplacementText);
Modified: clang-tools-extra/trunk/clang-tidy/android/ComparisonInTempFailureRetryCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/android/ComparisonInTempFailureRetryCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/android/ComparisonInTempFailureRetryCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/android/ComparisonInTempFailureRetryCheck.cpp Thu Aug 9 15:42:26 2018
@@ -21,15 +21,15 @@ namespace android {
namespace {
AST_MATCHER(BinaryOperator, isRHSATempFailureRetryArg) {
- if (!Node.getLocStart().isMacroID())
+ if (!Node.getBeginLoc().isMacroID())
return false;
const SourceManager &SM = Finder->getASTContext().getSourceManager();
- if (!SM.isMacroArgExpansion(Node.getRHS()->IgnoreParenCasts()->getLocStart()))
+ if (!SM.isMacroArgExpansion(Node.getRHS()->IgnoreParenCasts()->getBeginLoc()))
return false;
const LangOptions &Opts = Finder->getASTContext().getLangOpts();
- SourceLocation LocStart = Node.getLocStart();
+ SourceLocation LocStart = Node.getBeginLoc();
while (LocStart.isMacroID()) {
SourceLocation Invocation = SM.getImmediateMacroCallerLoc(LocStart);
Token Tok;
Modified: clang-tools-extra/trunk/clang-tidy/boost/UseToStringCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/boost/UseToStringCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/boost/UseToStringCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/boost/UseToStringCheck.cpp Thu Aug 9 15:42:26 2018
@@ -56,7 +56,7 @@ void UseToStringCheck::check(const Match
else
return;
- auto Loc = Call->getLocStart();
+ auto Loc = Call->getBeginLoc();
auto Diag =
diag(Loc, "use std::to_%0 instead of boost::lexical_cast<std::%0>")
<< StringType;
@@ -65,8 +65,8 @@ void UseToStringCheck::check(const Match
return;
Diag << FixItHint::CreateReplacement(
- CharSourceRange::getCharRange(Call->getLocStart(),
- Call->getArg(0)->getLocStart()),
+ CharSourceRange::getCharRange(Call->getBeginLoc(),
+ Call->getArg(0)->getBeginLoc()),
(llvm::Twine("std::to_") + StringType + "(").str());
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp Thu Aug 9 15:42:26 2018
@@ -242,7 +242,7 @@ void ArgumentCommentCheck::checkCallArgs
}
CharSourceRange BeforeArgument =
- makeFileCharRange(ArgBeginLoc, Args[I]->getLocStart());
+ makeFileCharRange(ArgBeginLoc, Args[I]->getBeginLoc());
ArgBeginLoc = Args[I]->getLocEnd();
std::vector<std::pair<SourceLocation, StringRef>> Comments;
@@ -251,7 +251,7 @@ void ArgumentCommentCheck::checkCallArgs
} else {
// Fall back to parsing back from the start of the argument.
CharSourceRange ArgsRange = makeFileCharRange(
- Args[I]->getLocStart(), Args[NumArgs - 1]->getLocEnd());
+ Args[I]->getBeginLoc(), Args[NumArgs - 1]->getLocEnd());
Comments = getCommentsBeforeLoc(Ctx, ArgsRange.getBegin());
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/AssertSideEffectCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/AssertSideEffectCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/AssertSideEffectCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/AssertSideEffectCheck.cpp Thu Aug 9 15:42:26 2018
@@ -102,7 +102,7 @@ void AssertSideEffectCheck::registerMatc
void AssertSideEffectCheck::check(const MatchFinder::MatchResult &Result) {
const SourceManager &SM = *Result.SourceManager;
const LangOptions LangOpts = getLangOpts();
- SourceLocation Loc = Result.Nodes.getNodeAs<Stmt>("condStmt")->getLocStart();
+ SourceLocation Loc = Result.Nodes.getNodeAs<Stmt>("condStmt")->getBeginLoc();
StringRef AssertMacroName;
while (Loc.isValid() && Loc.isMacroID()) {
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.cpp Thu Aug 9 15:42:26 2018
@@ -36,7 +36,7 @@ void BoolPointerImplicitConversionCheck:
auto *Var = Result.Nodes.getNodeAs<DeclRefExpr>("expr");
// Ignore macros.
- if (Var->getLocStart().isMacroID())
+ if (Var->getBeginLoc().isMacroID())
return;
// Only allow variable accesses for now, no function calls or member exprs.
@@ -63,9 +63,9 @@ void BoolPointerImplicitConversionCheck:
.empty())
return;
- diag(Var->getLocStart(), "dubious check of 'bool *' against 'nullptr', did "
+ diag(Var->getBeginLoc(), "dubious check of 'bool *' against 'nullptr', did "
"you mean to dereference it?")
- << FixItHint::CreateInsertion(Var->getLocStart(), "*");
+ << FixItHint::CreateInsertion(Var->getBeginLoc(), "*");
}
} // namespace bugprone
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp Thu Aug 9 15:42:26 2018
@@ -104,7 +104,7 @@ void CopyConstructorInitCheck::check(con
SourceLocation FixItLoc;
// There is no initialization list in this constructor.
if (!HasWrittenInitializer) {
- FixItLoc = Ctor->getBody()->getLocStart();
+ FixItLoc = Ctor->getBody()->getBeginLoc();
FixItMsg = " : " + FixItMsg;
} else {
// We apply the missing ctors at the beginning of the initialization list.
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/DanglingHandleCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/DanglingHandleCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/DanglingHandleCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/DanglingHandleCheck.cpp Thu Aug 9 15:42:26 2018
@@ -178,7 +178,7 @@ void DanglingHandleCheck::registerMatche
void DanglingHandleCheck::check(const MatchFinder::MatchResult &Result) {
auto *Handle = Result.Nodes.getNodeAs<CXXRecordDecl>("handle");
- diag(Result.Nodes.getNodeAs<Stmt>("bad_stmt")->getLocStart(),
+ diag(Result.Nodes.getNodeAs<Stmt>("bad_stmt")->getBeginLoc(),
"%0 outlives its value")
<< Handle->getQualifiedNameAsString();
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp Thu Aug 9 15:42:26 2018
@@ -57,7 +57,7 @@ void InaccurateEraseCheck::check(const M
Result.Nodes.getNodeAs<CXXMemberCallExpr>("erase");
const auto *EndExpr =
Result.Nodes.getNodeAs<CXXMemberCallExpr>("end");
- const SourceLocation Loc = MemberCall->getLocStart();
+ const SourceLocation Loc = MemberCall->getBeginLoc();
FixItHint Hint;
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp Thu Aug 9 15:42:26 2018
@@ -61,7 +61,7 @@ void IncorrectRoundingsCheck::registerMa
void IncorrectRoundingsCheck::check(const MatchFinder::MatchResult &Result) {
const auto *CastExpr = Result.Nodes.getNodeAs<ImplicitCastExpr>("CastExpr");
- diag(CastExpr->getLocStart(),
+ diag(CastExpr->getBeginLoc(),
"casting (double + 0.5) to integer leads to incorrect rounding; "
"consider using lround (#include <cmath>) instead");
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/IntegerDivisionCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/IntegerDivisionCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/IntegerDivisionCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/IntegerDivisionCheck.cpp Thu Aug 9 15:42:26 2018
@@ -48,7 +48,7 @@ void IntegerDivisionCheck::registerMatch
void IntegerDivisionCheck::check(const MatchFinder::MatchResult &Result) {
const auto *IntDiv = Result.Nodes.getNodeAs<BinaryOperator>("IntDiv");
- diag(IntDiv->getLocStart(), "result of integer division used in a floating "
+ diag(IntDiv->getBeginLoc(), "result of integer division used in a floating "
"point context; possible loss of precision");
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp Thu Aug 9 15:42:26 2018
@@ -102,9 +102,10 @@ void MisplacedOperatorInStrlenInAllocChe
StrLen->getSourceRange(),
(StrLenBegin + LHSText + StrLenEnd + " + " + RHSText).str());
- diag(Alloc->getLocStart(),
+ diag(Alloc->getBeginLoc(),
"addition operator is applied to the argument of %0 instead of its "
- "result") << StrLen->getDirectCallee()->getName() << Hint;
+ "result")
+ << StrLen->getDirectCallee()->getName() << Hint;
}
} // namespace bugprone
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/MisplacedWideningCastCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/MisplacedWideningCastCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/MisplacedWideningCastCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/MisplacedWideningCastCheck.cpp Thu Aug 9 15:42:26 2018
@@ -185,11 +185,11 @@ void MisplacedWideningCastCheck::check(c
const auto *Cast = Result.Nodes.getNodeAs<CastExpr>("Cast");
if (!CheckImplicitCasts && isa<ImplicitCastExpr>(Cast))
return;
- if (Cast->getLocStart().isMacroID())
+ if (Cast->getBeginLoc().isMacroID())
return;
const auto *Calc = Result.Nodes.getNodeAs<Expr>("Calc");
- if (Calc->getLocStart().isMacroID())
+ if (Calc->getBeginLoc().isMacroID())
return;
if (Cast->isTypeDependent() || Cast->isValueDependent() ||
@@ -223,7 +223,7 @@ void MisplacedWideningCastCheck::check(c
if (Context.getIntWidth(CalcType) >= getMaxCalculationWidth(Context, Calc))
return;
- diag(Cast->getLocStart(), "either cast from %0 to %1 is ineffective, or "
+ diag(Cast->getBeginLoc(), "either cast from %0 to %1 is ineffective, or "
"there is loss of precision before the conversion")
<< CalcType << CastType;
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp Thu Aug 9 15:42:26 2018
@@ -29,7 +29,7 @@ static void replaceMoveWithForward(const
CharSourceRange CallRange =
Lexer::makeFileCharRange(CharSourceRange::getTokenRange(
- Callee->getLocStart(), Callee->getLocEnd()),
+ Callee->getBeginLoc(), Callee->getLocEnd()),
SM, LangOpts);
if (CallRange.isValid()) {
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/MultipleStatementMacroCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/MultipleStatementMacroCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/MultipleStatementMacroCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/MultipleStatementMacroCheck.cpp Thu Aug 9 15:42:26 2018
@@ -19,7 +19,7 @@ namespace bugprone {
namespace {
-AST_MATCHER(Expr, isInMacro) { return Node.getLocStart().isMacroID(); }
+AST_MATCHER(Expr, isInMacro) { return Node.getBeginLoc().isMacroID(); }
/// \brief Find the next statement after `S`.
const Stmt *nextStmt(const MatchFinder::MatchResult &Result, const Stmt *S) {
@@ -73,13 +73,13 @@ void MultipleStatementMacroCheck::check(
if (!Next)
return;
- SourceLocation OuterLoc = Outer->getLocStart();
+ SourceLocation OuterLoc = Outer->getBeginLoc();
if (Result.Nodes.getNodeAs<Stmt>("else"))
OuterLoc = cast<IfStmt>(Outer)->getElseLoc();
- auto InnerRanges = getExpansionRanges(Inner->getLocStart(), Result);
+ auto InnerRanges = getExpansionRanges(Inner->getBeginLoc(), Result);
auto OuterRanges = getExpansionRanges(OuterLoc, Result);
- auto NextRanges = getExpansionRanges(Next->getLocStart(), Result);
+ auto NextRanges = getExpansionRanges(Next->getBeginLoc(), Result);
// Remove all the common ranges, starting from the top (the last ones in the
// list).
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/SizeofContainerCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/SizeofContainerCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/SizeofContainerCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/SizeofContainerCheck.cpp Thu Aug 9 15:42:26 2018
@@ -40,7 +40,7 @@ void SizeofContainerCheck::check(const M
Result.Nodes.getNodeAs<UnaryExprOrTypeTraitExpr>("sizeof");
auto Diag =
- diag(SizeOf->getLocStart(), "sizeof() doesn't return the size of the "
+ diag(SizeOf->getBeginLoc(), "sizeof() doesn't return the size of the "
"container; did you mean .size()?");
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/SizeofExpressionCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/SizeofExpressionCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/SizeofExpressionCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/SizeofExpressionCheck.cpp Thu Aug 9 15:42:26 2018
@@ -216,29 +216,29 @@ void SizeofExpressionCheck::check(const
const ASTContext &Ctx = *Result.Context;
if (const auto *E = Result.Nodes.getNodeAs<Expr>("sizeof-constant")) {
- diag(E->getLocStart(),
+ diag(E->getBeginLoc(),
"suspicious usage of 'sizeof(K)'; did you mean 'K'?");
} else if (const auto *E =
Result.Nodes.getNodeAs<Expr>("sizeof-integer-call")) {
- diag(E->getLocStart(), "suspicious usage of 'sizeof()' on an expression "
+ diag(E->getBeginLoc(), "suspicious usage of 'sizeof()' on an expression "
"that results in an integer");
} else if (const auto *E = Result.Nodes.getNodeAs<Expr>("sizeof-this")) {
- diag(E->getLocStart(),
+ diag(E->getBeginLoc(),
"suspicious usage of 'sizeof(this)'; did you mean 'sizeof(*this)'");
} else if (const auto *E = Result.Nodes.getNodeAs<Expr>("sizeof-charp")) {
- diag(E->getLocStart(),
+ diag(E->getBeginLoc(),
"suspicious usage of 'sizeof(char*)'; do you mean 'strlen'?");
} else if (const auto *E =
Result.Nodes.getNodeAs<Expr>("sizeof-pointer-to-aggregate")) {
- diag(E->getLocStart(),
+ diag(E->getBeginLoc(),
"suspicious usage of 'sizeof(A*)'; pointer to aggregate");
} else if (const auto *E =
Result.Nodes.getNodeAs<Expr>("sizeof-compare-constant")) {
- diag(E->getLocStart(),
+ diag(E->getBeginLoc(),
"suspicious comparison of 'sizeof(expr)' to a constant");
} else if (const auto *E =
Result.Nodes.getNodeAs<Expr>("sizeof-comma-expr")) {
- diag(E->getLocStart(), "suspicious usage of 'sizeof(..., ...)'");
+ diag(E->getBeginLoc(), "suspicious usage of 'sizeof(..., ...)'");
} else if (const auto *E =
Result.Nodes.getNodeAs<Expr>("sizeof-divide-expr")) {
const auto *NumTy = Result.Nodes.getNodeAs<Type>("num-type");
@@ -252,30 +252,30 @@ void SizeofExpressionCheck::check(const
if (DenominatorSize > CharUnits::Zero() &&
!NumeratorSize.isMultipleOf(DenominatorSize)) {
- diag(E->getLocStart(), "suspicious usage of 'sizeof(...)/sizeof(...)';"
+ diag(E->getBeginLoc(), "suspicious usage of 'sizeof(...)/sizeof(...)';"
" numerator is not a multiple of denominator");
} else if (ElementSize > CharUnits::Zero() &&
DenominatorSize > CharUnits::Zero() &&
ElementSize != DenominatorSize) {
- diag(E->getLocStart(), "suspicious usage of 'sizeof(...)/sizeof(...)';"
+ diag(E->getBeginLoc(), "suspicious usage of 'sizeof(...)/sizeof(...)';"
" numerator is not a multiple of denominator");
} else if (NumTy && DenomTy && NumTy == DenomTy) {
- diag(E->getLocStart(),
+ diag(E->getBeginLoc(),
"suspicious usage of sizeof pointer 'sizeof(T)/sizeof(T)'");
} else if (PointedTy && DenomTy && PointedTy == DenomTy) {
- diag(E->getLocStart(),
+ diag(E->getBeginLoc(),
"suspicious usage of sizeof pointer 'sizeof(T*)/sizeof(T)'");
} else if (NumTy && DenomTy && NumTy->isPointerType() &&
DenomTy->isPointerType()) {
- diag(E->getLocStart(),
+ diag(E->getBeginLoc(),
"suspicious usage of sizeof pointer 'sizeof(P*)/sizeof(Q*)'");
}
} else if (const auto *E =
Result.Nodes.getNodeAs<Expr>("sizeof-sizeof-expr")) {
- diag(E->getLocStart(), "suspicious usage of 'sizeof(sizeof(...))'");
+ diag(E->getBeginLoc(), "suspicious usage of 'sizeof(sizeof(...))'");
} else if (const auto *E =
Result.Nodes.getNodeAs<Expr>("sizeof-multiply-sizeof")) {
- diag(E->getLocStart(), "suspicious 'sizeof' by 'sizeof' multiplication");
+ diag(E->getBeginLoc(), "suspicious 'sizeof' by 'sizeof' multiplication");
}
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/StringConstructorCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/StringConstructorCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/StringConstructorCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/StringConstructorCheck.cpp Thu Aug 9 15:42:26 2018
@@ -106,7 +106,7 @@ void StringConstructorCheck::check(const
const ASTContext &Ctx = *Result.Context;
const auto *E = Result.Nodes.getNodeAs<CXXConstructExpr>("constructor");
assert(E && "missing constructor expression");
- SourceLocation Loc = E->getLocStart();
+ SourceLocation Loc = E->getBeginLoc();
if (Result.Nodes.getNodeAs<Expr>("swapped-parameter")) {
const Expr *P0 = E->getArg(0);
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp Thu Aug 9 15:42:26 2018
@@ -39,7 +39,7 @@ void StringIntegerAssignmentCheck::regis
void StringIntegerAssignmentCheck::check(
const MatchFinder::MatchResult &Result) {
const auto *Argument = Result.Nodes.getNodeAs<Expr>("expr");
- SourceLocation Loc = Argument->getLocStart();
+ SourceLocation Loc = Argument->getBeginLoc();
auto Diag =
diag(Loc, "an integer is interpreted as a character code when assigning "
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp Thu Aug 9 15:42:26 2018
@@ -68,14 +68,14 @@ void StringLiteralWithEmbeddedNulCheck::
SL->getCodeUnit(Offset + 1) == 'x' &&
isDigit(SL->getCodeUnit(Offset + 2)) &&
isDigit(SL->getCodeUnit(Offset + 3))) {
- diag(SL->getLocStart(), "suspicious embedded NUL character");
+ diag(SL->getBeginLoc(), "suspicious embedded NUL character");
return;
}
}
}
if (const auto *SL = Result.Nodes.getNodeAs<StringLiteral>("truncated")) {
- diag(SL->getLocStart(),
+ diag(SL->getBeginLoc(),
"truncated string literal with embedded NUL character");
}
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp Thu Aug 9 15:42:26 2018
@@ -61,7 +61,7 @@ void SuspiciousMemsetUsageCheck::check(c
SourceRange CharRange = CharZeroFill->getSourceRange();
auto Diag =
- diag(CharZeroFill->getLocStart(), "memset fill value is char '0', "
+ diag(CharZeroFill->getBeginLoc(), "memset fill value is char '0', "
"potentially mistaken for int 0");
// Only suggest a fix if no macros are involved.
@@ -82,7 +82,7 @@ void SuspiciousMemsetUsageCheck::check(c
(NumValue >= 0 && NumValue <= UCharMax))
return;
- diag(NumFill->getLocStart(), "memset fill value is out of unsigned "
+ diag(NumFill->getBeginLoc(), "memset fill value is out of unsigned "
"character range, gets truncated");
}
@@ -110,7 +110,7 @@ void SuspiciousMemsetUsageCheck::check(c
// `byte_count` is known to be zero at compile time, and `fill_char` is
// either not known or known to be a positive integer. Emit a warning
// and fix-its to swap the arguments.
- auto D = diag(Call->getLocStart(),
+ auto D = diag(Call->getBeginLoc(),
"memset of size zero, potentially swapped arguments");
StringRef RHSString = tooling::fixit::getText(*ByteCount, *Result.Context);
StringRef LHSString = tooling::fixit::getText(*FillChar, *Result.Context);
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp Thu Aug 9 15:42:26 2018
@@ -120,7 +120,7 @@ void SuspiciousMissingCommaCheck::check(
if (double(Count) / Size > RatioThreshold)
return;
- diag(ConcatenatedLiteral->getLocStart(),
+ diag(ConcatenatedLiteral->getBeginLoc(),
"suspicious string literal, probably missing a comma");
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp Thu Aug 9 15:42:26 2018
@@ -34,7 +34,7 @@ void SuspiciousSemicolonCheck::check(con
return;
const auto *Semicolon = Result.Nodes.getNodeAs<NullStmt>("semi");
- SourceLocation LocStart = Semicolon->getLocStart();
+ SourceLocation LocStart = Semicolon->getBeginLoc();
if (LocStart.isMacroID())
return;
@@ -60,7 +60,7 @@ void SuspiciousSemicolonCheck::check(con
if (Lexer.LexFromRawLexer(Token))
return;
- unsigned BaseIndent = SM.getSpellingColumnNumber(Statement->getLocStart());
+ unsigned BaseIndent = SM.getSpellingColumnNumber(Statement->getBeginLoc());
unsigned NewTokenIndent = SM.getSpellingColumnNumber(Token.getLocation());
unsigned NewTokenLine = SM.getSpellingLineNumber(Token.getLocation());
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp Thu Aug 9 15:42:26 2018
@@ -177,7 +177,7 @@ void SuspiciousStringCompareCheck::check
Call->getRParenLoc(), 0, Result.Context->getSourceManager(),
getLangOpts());
- diag(Call->getLocStart(),
+ diag(Call->getBeginLoc(),
"function %0 is called without explicitly comparing result")
<< Decl << FixItHint::CreateInsertion(EndLoc, " != 0");
}
@@ -186,29 +186,30 @@ void SuspiciousStringCompareCheck::check
SourceLocation EndLoc = Lexer::getLocForEndOfToken(
Call->getRParenLoc(), 0, Result.Context->getSourceManager(),
getLangOpts());
- SourceLocation NotLoc = E->getLocStart();
+ SourceLocation NotLoc = E->getBeginLoc();
- diag(Call->getLocStart(),
+ diag(Call->getBeginLoc(),
"function %0 is compared using logical not operator")
- << Decl << FixItHint::CreateRemoval(
- CharSourceRange::getTokenRange(NotLoc, NotLoc))
+ << Decl
+ << FixItHint::CreateRemoval(
+ CharSourceRange::getTokenRange(NotLoc, NotLoc))
<< FixItHint::CreateInsertion(EndLoc, " == 0");
}
if (Result.Nodes.getNodeAs<Stmt>("invalid-comparison")) {
- diag(Call->getLocStart(),
+ diag(Call->getBeginLoc(),
"function %0 is compared to a suspicious constant")
<< Decl;
}
if (const auto *BinOp =
Result.Nodes.getNodeAs<BinaryOperator>("suspicious-operator")) {
- diag(Call->getLocStart(), "results of function %0 used by operator '%1'")
+ diag(Call->getBeginLoc(), "results of function %0 used by operator '%1'")
<< Decl << BinOp->getOpcodeStr();
}
if (Result.Nodes.getNodeAs<Stmt>("invalid-conversion")) {
- diag(Call->getLocStart(), "function %0 has suspicious implicit cast")
+ diag(Call->getBeginLoc(), "function %0 has suspicious implicit cast")
<< Decl;
}
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/SwappedArgumentsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/SwappedArgumentsCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/SwappedArgumentsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/SwappedArgumentsCheck.cpp Thu Aug 9 15:42:26 2018
@@ -84,7 +84,7 @@ void SwappedArgumentsCheck::check(const
continue;
// Emit a warning and fix-its that swap the arguments.
- diag(Call->getLocStart(), "argument with implicit conversion from %0 "
+ diag(Call->getBeginLoc(), "argument with implicit conversion from %0 "
"to %1 followed by argument converted from "
"%2 to %3, potentially swapped arguments.")
<< LHS->getType() << LHSFrom->getType() << RHS->getType()
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/TerminatingContinueCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/TerminatingContinueCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/TerminatingContinueCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/TerminatingContinueCheck.cpp Thu Aug 9 15:42:26 2018
@@ -39,7 +39,7 @@ void TerminatingContinueCheck::check(con
const auto *ContStmt = Result.Nodes.getNodeAs<ContinueStmt>("continue");
auto Diag =
- diag(ContStmt->getLocStart(),
+ diag(ContStmt->getBeginLoc(),
"'continue' in loop with false condition is equivalent to 'break'")
<< tooling::fixit::createReplacement(*ContStmt, "break");
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp Thu Aug 9 15:42:26 2018
@@ -42,7 +42,7 @@ void ThrowKeywordMissingCheck::check(con
const auto *TemporaryExpr =
Result.Nodes.getNodeAs<Expr>("temporary-exception-not-thrown");
- diag(TemporaryExpr->getLocStart(), "suspicious exception object created but "
+ diag(TemporaryExpr->getBeginLoc(), "suspicious exception object created but "
"not thrown; did you mean 'throw %0'?")
<< TemporaryExpr->getType().getBaseTypeIdentifier()->getName();
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.cpp Thu Aug 9 15:42:26 2018
@@ -52,7 +52,7 @@ void UndefinedMemoryManipulationCheck::c
QualType DestType = Call->getArg(0)->IgnoreImplicit()->getType();
if (!DestType->getPointeeType().isNull())
DestType = DestType->getPointeeType();
- diag(Call->getLocStart(), "undefined behavior, destination object type %0 "
+ diag(Call->getBeginLoc(), "undefined behavior, destination object type %0 "
"is not TriviallyCopyable")
<< DestType;
}
@@ -60,7 +60,7 @@ void UndefinedMemoryManipulationCheck::c
QualType SourceType = Call->getArg(1)->IgnoreImplicit()->getType();
if (!SourceType->getPointeeType().isNull())
SourceType = SourceType->getPointeeType();
- diag(Call->getLocStart(),
+ diag(Call->getBeginLoc(),
"undefined behavior, source object type %0 is not TriviallyCopyable")
<< SourceType;
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/UndelegatedConstructorCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/UndelegatedConstructorCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/UndelegatedConstructorCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/UndelegatedConstructorCheck.cpp Thu Aug 9 15:42:26 2018
@@ -75,7 +75,7 @@ void UndelegatedConstructorCheck::regist
void UndelegatedConstructorCheck::check(
const MatchFinder::MatchResult &Result) {
const auto *E = Result.Nodes.getNodeAs<CXXConstructExpr>("construct");
- diag(E->getLocStart(), "did you intend to call a delegated constructor? "
+ diag(E->getBeginLoc(), "did you intend to call a delegated constructor? "
"A temporary object is created here instead");
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp Thu Aug 9 15:42:26 2018
@@ -52,7 +52,7 @@ void UnusedRaiiCheck::check(const MatchF
// We ignore code expanded from macros to reduce the number of false
// positives.
- if (E->getLocStart().isMacroID())
+ if (E->getBeginLoc().isMacroID())
return;
// Don't emit a warning for the last statement in the surrounding compund
@@ -62,7 +62,7 @@ void UnusedRaiiCheck::check(const MatchF
return;
// Emit a warning.
- auto D = diag(E->getLocStart(), "object destroyed immediately after "
+ auto D = diag(E->getBeginLoc(), "object destroyed immediately after "
"creation; did you mean to name the object?");
const char *Replacement = " give_me_a_name";
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/UnusedReturnValueCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/UnusedReturnValueCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/UnusedReturnValueCheck.cpp Thu Aug 9 15:42:26 2018
@@ -86,10 +86,10 @@ void UnusedReturnValueCheck::registerMat
void UnusedReturnValueCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *Matched = Result.Nodes.getNodeAs<CallExpr>("match")) {
- diag(Matched->getLocStart(),
+ diag(Matched->getBeginLoc(),
"the value returned by this function should be used")
<< Matched->getSourceRange();
- diag(Matched->getLocStart(),
+ diag(Matched->getBeginLoc(),
"cast the expression to void to silence this warning",
DiagnosticIDs::Note);
}
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/VirtualNearMissCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/VirtualNearMissCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/VirtualNearMissCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/VirtualNearMissCheck.cpp Thu Aug 9 15:42:26 2018
@@ -257,7 +257,7 @@ void VirtualNearMissCheck::check(const M
bool ApplyFix = !BaseMD->isTemplateInstantiation() &&
!DerivedMD->isTemplateInstantiation();
auto Diag =
- diag(DerivedMD->getLocStart(),
+ diag(DerivedMD->getBeginLoc(),
"method '%0' has a similar name and the same signature as "
"virtual method '%1'; did you mean to override it?")
<< DerivedMD->getQualifiedNameAsString()
Modified: clang-tools-extra/trunk/clang-tidy/cert/LimitedRandomnessCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cert/LimitedRandomnessCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/cert/LimitedRandomnessCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/cert/LimitedRandomnessCheck.cpp Thu Aug 9 15:42:26 2018
@@ -30,7 +30,7 @@ void LimitedRandomnessCheck::check(const
msg = "; use C++11 random library instead";
const auto *MatchedDecl = Result.Nodes.getNodeAs<CallExpr>("randomGenerator");
- diag(MatchedDecl->getLocStart(), "rand() has limited randomness" + msg);
+ diag(MatchedDecl->getBeginLoc(), "rand() has limited randomness" + msg);
}
} // namespace cert
Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp Thu Aug 9 15:42:26 2018
@@ -19,7 +19,7 @@ namespace cppcoreguidelines {
namespace {
AST_MATCHER(GotoStmt, isForwardJumping) {
- return Node.getLocStart() < Node.getLabel()->getLocStart();
+ return Node.getBeginLoc() < Node.getLabel()->getBeginLoc();
}
} // namespace
@@ -49,7 +49,7 @@ void AvoidGotoCheck::check(const MatchFi
diag(Goto->getGotoLoc(), "avoid using 'goto' for flow control")
<< Goto->getSourceRange();
- diag(Goto->getLabel()->getLocStart(), "label defined here",
+ diag(Goto->getLabel()->getBeginLoc(), "label defined here",
DiagnosticIDs::Note);
}
} // namespace cppcoreguidelines
Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp Thu Aug 9 15:42:26 2018
@@ -52,14 +52,14 @@ void NarrowingConversionsCheck::register
void NarrowingConversionsCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *Op = Result.Nodes.getNodeAs<BinaryOperator>("op")) {
- if (Op->getLocStart().isMacroID())
+ if (Op->getBeginLoc().isMacroID())
return;
diag(Op->getOperatorLoc(), "narrowing conversion from %0 to %1")
<< Op->getRHS()->getType() << Op->getLHS()->getType();
return;
}
const auto *Cast = Result.Nodes.getNodeAs<ImplicitCastExpr>("cast");
- if (Cast->getLocStart().isMacroID())
+ if (Cast->getBeginLoc().isMacroID())
return;
diag(Cast->getExprLoc(), "narrowing conversion from %0 to %1")
<< Cast->getSubExpr()->getType() << Cast->getType();
Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp Thu Aug 9 15:42:26 2018
@@ -73,8 +73,8 @@ void NoMallocCheck::check(const MatchFin
assert(Call && "Unhandled binding in the Matcher");
- diag(Call->getLocStart(), "do not manage memory manually; %0")
- << Recommendation << SourceRange(Call->getLocStart(), Call->getLocEnd());
+ diag(Call->getBeginLoc(), "do not manage memory manually; %0")
+ << Recommendation << SourceRange(Call->getBeginLoc(), Call->getLocEnd());
}
} // namespace cppcoreguidelines
Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp Thu Aug 9 15:42:26 2018
@@ -203,7 +203,7 @@ bool OwningMemoryCheck::handleDeletion(c
// Deletion of non-owners, with `delete variable;`
if (DeleteStmt) {
- diag(DeleteStmt->getLocStart(),
+ diag(DeleteStmt->getBeginLoc(),
"deleting a pointer through a type that is "
"not marked 'gsl::owner<>'; consider using a "
"smart pointer instead")
@@ -212,7 +212,7 @@ bool OwningMemoryCheck::handleDeletion(c
// FIXME: The declaration of the variable that was deleted can be
// rewritten.
const ValueDecl *Decl = DeletedVariable->getDecl();
- diag(Decl->getLocStart(), "variable declared here", DiagnosticIDs::Note)
+ diag(Decl->getBeginLoc(), "variable declared here", DiagnosticIDs::Note)
<< Decl->getSourceRange();
return true;
@@ -228,7 +228,7 @@ bool OwningMemoryCheck::handleLegacyCons
// as a pointer, which should not be an owner. The argument that is an owner
// is known and the false positive coming from the filename can be avoided.
if (LegacyConsumer) {
- diag(LegacyConsumer->getLocStart(),
+ diag(LegacyConsumer->getBeginLoc(),
"calling legacy resource function without passing a 'gsl::owner<>'")
<< LegacyConsumer->getSourceRange();
return true;
@@ -242,7 +242,7 @@ bool OwningMemoryCheck::handleExpectedOw
// Expected function argument to be owner.
if (ExpectedOwner) {
- diag(ExpectedOwner->getLocStart(),
+ diag(ExpectedOwner->getBeginLoc(),
"expected argument of type 'gsl::owner<>'; got %0")
<< ExpectedOwner->getType() << ExpectedOwner->getSourceRange();
return true;
@@ -261,7 +261,7 @@ bool OwningMemoryCheck::handleAssignment
// Assignments to owners.
if (OwnerAssignment) {
- diag(OwnerAssignment->getLocStart(),
+ diag(OwnerAssignment->getBeginLoc(),
"expected assignment source to be of type 'gsl::owner<>'; got %0")
<< OwnerAssignment->getRHS()->getType()
<< OwnerAssignment->getSourceRange();
@@ -270,7 +270,7 @@ bool OwningMemoryCheck::handleAssignment
// Initialization of owners.
if (OwnerInitialization) {
- diag(OwnerInitialization->getLocStart(),
+ diag(OwnerInitialization->getBeginLoc(),
"expected initialization with value of type 'gsl::owner<>'; got %0")
<< OwnerInitialization->getAnyInitializer()->getType()
<< OwnerInitialization->getSourceRange();
@@ -306,7 +306,7 @@ bool OwningMemoryCheck::handleAssignment
// Bad assignments to non-owners, where the RHS is a newly created owner.
if (BadOwnerAssignment) {
- diag(BadOwnerAssignment->getLocStart(),
+ diag(BadOwnerAssignment->getBeginLoc(),
"assigning newly created 'gsl::owner<>' to non-owner %0")
<< BadOwnerAssignment->getLHS()->getType()
<< BadOwnerAssignment->getSourceRange();
@@ -315,7 +315,7 @@ bool OwningMemoryCheck::handleAssignment
// Bad initialization of non-owners, where the RHS is a newly created owner.
if (BadOwnerInitialization) {
- diag(BadOwnerInitialization->getLocStart(),
+ diag(BadOwnerInitialization->getBeginLoc(),
"initializing non-owner %0 with a newly created 'gsl::owner<>'")
<< BadOwnerInitialization->getType()
<< BadOwnerInitialization->getSourceRange();
@@ -326,7 +326,7 @@ bool OwningMemoryCheck::handleAssignment
// If the type of the variable was deduced, the wrapping owner typedef is
// eliminated, therefore the check emits a special note for that case.
if (Nodes.getNodeAs<AutoType>("deduced_type")) {
- diag(BadOwnerInitialization->getLocStart(),
+ diag(BadOwnerInitialization->getBeginLoc(),
"type deduction did not result in an owner", DiagnosticIDs::Note);
}
return true;
@@ -337,7 +337,7 @@ bool OwningMemoryCheck::handleAssignment
if (BadOwnerArgument) {
assert(BadOwnerParameter &&
"parameter for the problematic argument not found");
- diag(BadOwnerArgument->getLocStart(), "initializing non-owner argument of "
+ diag(BadOwnerArgument->getBeginLoc(), "initializing non-owner argument of "
"type %0 with a newly created "
"'gsl::owner<>'")
<< BadOwnerParameter->getType() << BadOwnerArgument->getSourceRange();
@@ -356,7 +356,7 @@ bool OwningMemoryCheck::handleReturnValu
if (BadReturnType) {
// The returned value is a resource or variable that was not annotated with
// owner<> and the function return type is not owner<>.
- diag(BadReturnType->getLocStart(),
+ diag(BadReturnType->getBeginLoc(),
"returning a newly created resource of "
"type %0 or 'gsl::owner<>' from a "
"function whose return type is not 'gsl::owner<>'")
@@ -380,7 +380,7 @@ bool OwningMemoryCheck::handleOwnerMembe
assert(DeclaredOwnerMember &&
"match on class with bad destructor but without a declared owner");
- diag(DeclaredOwnerMember->getLocStart(),
+ diag(DeclaredOwnerMember->getBeginLoc(),
"member variable of type 'gsl::owner<>' requires the class %0 to "
"implement a destructor to release the owned resource")
<< BadClass;
Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp Thu Aug 9 15:42:26 2018
@@ -46,7 +46,7 @@ void ProTypeCstyleCastCheck::check(const
MatchedCast->getCastKind() == CK_IntegralToPointer ||
MatchedCast->getCastKind() == CK_PointerToIntegral ||
MatchedCast->getCastKind() == CK_ReinterpretMemberPointer) {
- diag(MatchedCast->getLocStart(),
+ diag(MatchedCast->getBeginLoc(),
"do not use C-style cast to convert between unrelated types");
return;
}
@@ -71,7 +71,7 @@ void ProTypeCstyleCastCheck::check(const
*Result.SourceManager, getLangOpts());
auto diag_builder = diag(
- MatchedCast->getLocStart(),
+ MatchedCast->getBeginLoc(),
"do not use C-style cast to downcast from a base to a derived class; "
"use dynamic_cast instead");
@@ -90,7 +90,7 @@ void ProTypeCstyleCastCheck::check(const
diag_builder << FixItHint::CreateReplacement(ParenRange, CastText);
} else {
diag(
- MatchedCast->getLocStart(),
+ MatchedCast->getBeginLoc(),
"do not use C-style cast to downcast from a base to a derived class");
}
return;
@@ -98,7 +98,7 @@ void ProTypeCstyleCastCheck::check(const
if (MatchedCast->getCastKind() == CK_NoOp &&
needsConstCast(SourceType, MatchedCast->getType())) {
- diag(MatchedCast->getLocStart(),
+ diag(MatchedCast->getBeginLoc(),
"do not use C-style cast to cast away constness");
}
}
Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp Thu Aug 9 15:42:26 2018
@@ -120,7 +120,7 @@ struct IntializerInsertion {
switch (Placement) {
case InitializerPlacement::New:
Location = utils::lexer::getPreviousToken(
- Context, Constructor.getBody()->getLocStart())
+ Context, Constructor.getBody()->getBeginLoc())
.getLocation();
break;
case InitializerPlacement::Before:
@@ -230,7 +230,7 @@ void fixInitializerList(const ASTContext
const CXXConstructorDecl *Ctor,
const SmallPtrSetImpl<const T *> &DeclsToInit) {
// Do not propose fixes in macros since we cannot place them correctly.
- if (Ctor->getLocStart().isMacroID())
+ if (Ctor->getBeginLoc().isMacroID())
return;
SmallVector<const NamedDecl *, 16> OrderedDecls;
@@ -384,7 +384,7 @@ void ProTypeMemberInitCheck::checkMissin
return;
DiagnosticBuilder Diag =
- diag(Ctor ? Ctor->getLocStart() : ClassDecl.getLocation(),
+ diag(Ctor ? Ctor->getBeginLoc() : ClassDecl.getLocation(),
IsUnion
? "union constructor should initialize one of these fields: %0"
: "constructor does not initialize these fields: %0")
@@ -392,7 +392,7 @@ void ProTypeMemberInitCheck::checkMissin
// Do not propose fixes for constructors in macros since we cannot place them
// correctly.
- if (Ctor && Ctor->getLocStart().isMacroID())
+ if (Ctor && Ctor->getBeginLoc().isMacroID())
return;
// Collect all fields but only suggest a fix for the first member of unions,
@@ -462,7 +462,7 @@ void ProTypeMemberInitCheck::checkMissin
return;
DiagnosticBuilder Diag =
- diag(Ctor ? Ctor->getLocStart() : ClassDecl.getLocation(),
+ diag(Ctor ? Ctor->getBeginLoc() : ClassDecl.getLocation(),
"constructor does not initialize these bases: %0")
<< toCommaSeparatedString(AllBases, BasesToInit);
@@ -473,7 +473,7 @@ void ProTypeMemberInitCheck::checkMissin
void ProTypeMemberInitCheck::checkUninitializedTrivialType(
const ASTContext &Context, const VarDecl *Var) {
DiagnosticBuilder Diag =
- diag(Var->getLocStart(), "uninitialized record type: %0") << Var;
+ diag(Var->getBeginLoc(), "uninitialized record type: %0") << Var;
Diag << FixItHint::CreateInsertion(
getLocationForEndOfToken(Context, Var->getSourceRange().getEnd()),
Modified: clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp Thu Aug 9 15:42:26 2018
@@ -27,8 +27,7 @@ void DefaultArgumentsCheck::check(const
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
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
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);
}
}
}
Modified: clang-tools-extra/trunk/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp Thu Aug 9 15:42:26 2018
@@ -120,9 +120,8 @@ void MultipleInheritanceCheck::check(con
}
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");
}
}
}
Modified: clang-tools-extra/trunk/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp Thu Aug 9 15:42:26 2018
@@ -34,8 +34,8 @@ void OverloadedOperatorCheck::registerMa
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;
}
Modified: clang-tools-extra/trunk/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp Thu Aug 9 15:42:26 2018
@@ -51,7 +51,7 @@ void StaticallyConstructedObjectsCheck::
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");
}
Modified: clang-tools-extra/trunk/clang-tidy/fuchsia/TrailingReturnCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/fuchsia/TrailingReturnCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/fuchsia/TrailingReturnCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/fuchsia/TrailingReturnCheck.cpp Thu Aug 9 15:42:26 2018
@@ -43,7 +43,7 @@ void TrailingReturnCheck::registerMatche
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");
}
Modified: clang-tools-extra/trunk/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp Thu Aug 9 15:42:26 2018
@@ -35,7 +35,7 @@ void VirtualInheritanceCheck::registerMa
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
Modified: clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp Thu Aug 9 15:42:26 2018
@@ -82,7 +82,7 @@ void AvoidCStyleCastsCheck::check(const
const QualType DestType = DestTypeAsWritten.getCanonicalType();
auto ReplaceRange = CharSourceRange::getCharRange(
- CastExpr->getLParenLoc(), CastExpr->getSubExprAsWritten()->getLocStart());
+ CastExpr->getLParenLoc(), CastExpr->getSubExprAsWritten()->getBeginLoc());
bool FnToFnCast =
isFunction(SourceTypeAsWritten) && isFunction(DestTypeAsWritten);
@@ -93,7 +93,7 @@ void AvoidCStyleCastsCheck::check(const
// in this case. Don't emit "redundant cast" warnings for function
// pointer/reference types.
if (SourceTypeAsWritten == DestTypeAsWritten) {
- diag(CastExpr->getLocStart(), "redundant cast to the same type")
+ diag(CastExpr->getBeginLoc(), "redundant cast to the same type")
<< FixItHint::CreateRemoval(ReplaceRange);
return;
}
@@ -116,7 +116,7 @@ void AvoidCStyleCastsCheck::check(const
// Ignore code in .c files #included in other files (which shouldn't be done,
// but people still do this for test and other purposes).
- if (SM.getFilename(SM.getSpellingLoc(CastExpr->getLocStart())).endswith(".c"))
+ if (SM.getFilename(SM.getSpellingLoc(CastExpr->getBeginLoc())).endswith(".c"))
return;
// Leave type spelling exactly as it was (unlike
@@ -128,7 +128,7 @@ void AvoidCStyleCastsCheck::check(const
SM, getLangOpts());
auto Diag =
- diag(CastExpr->getLocStart(), "C-style casts are discouraged; use %0");
+ diag(CastExpr->getBeginLoc(), "C-style casts are discouraged; use %0");
auto ReplaceWithCast = [&](std::string CastText) {
const Expr *SubExpr = CastExpr->getSubExprAsWritten()->IgnoreImpCasts();
Modified: clang-tools-extra/trunk/clang-tidy/google/ExplicitMakePairCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/ExplicitMakePairCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/ExplicitMakePairCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/google/ExplicitMakePairCheck.cpp Thu Aug 9 15:42:26 2018
@@ -60,12 +60,12 @@ void ExplicitMakePairCheck::check(const
// make_pair.
if (Arg0->getType() != Call->getArg(0)->getType() ||
Arg1->getType() != Call->getArg(1)->getType()) {
- diag(Call->getLocStart(), "for C++11-compatibility, use pair directly")
+ diag(Call->getBeginLoc(), "for C++11-compatibility, use pair directly")
<< FixItHint::CreateReplacement(
- SourceRange(DeclRef->getLocStart(), DeclRef->getLAngleLoc()),
+ SourceRange(DeclRef->getBeginLoc(), DeclRef->getLAngleLoc()),
"std::pair<");
} else {
- diag(Call->getLocStart(),
+ diag(Call->getBeginLoc(),
"for C++11-compatibility, omit template arguments from make_pair")
<< FixItHint::CreateRemoval(
SourceRange(DeclRef->getLAngleLoc(), DeclRef->getRAngleLoc()));
Modified: clang-tools-extra/trunk/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/GlobalNamesInHeadersCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/GlobalNamesInHeadersCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/google/GlobalNamesInHeadersCheck.cpp Thu Aug 9 15:42:26 2018
@@ -48,15 +48,15 @@ void GlobalNamesInHeadersCheck::register
void GlobalNamesInHeadersCheck::check(const MatchFinder::MatchResult &Result) {
const auto *D = Result.Nodes.getNodeAs<Decl>("using_decl");
// If it comes from a macro, we'll assume it is fine.
- if (D->getLocStart().isMacroID())
+ if (D->getBeginLoc().isMacroID())
return;
// Ignore if it comes from the "main" file ...
if (Result.SourceManager->isInMainFile(
- Result.SourceManager->getExpansionLoc(D->getLocStart()))) {
+ Result.SourceManager->getExpansionLoc(D->getBeginLoc()))) {
// unless that file is a header.
if (!utils::isSpellingLocInHeaderFile(
- D->getLocStart(), *Result.SourceManager, HeaderFileExtensions))
+ D->getBeginLoc(), *Result.SourceManager, HeaderFileExtensions))
return;
}
@@ -70,7 +70,7 @@ void GlobalNamesInHeadersCheck::check(co
}
}
- diag(D->getLocStart(),
+ diag(D->getBeginLoc(),
"using declarations in the global namespace in headers are prohibited");
}
Modified: clang-tools-extra/trunk/clang-tidy/google/IntegerTypesCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/IntegerTypesCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/IntegerTypesCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/google/IntegerTypesCheck.cpp Thu Aug 9 15:42:26 2018
@@ -72,7 +72,7 @@ void IntegerTypesCheck::registerMatchers
void IntegerTypesCheck::check(const MatchFinder::MatchResult &Result) {
auto TL = *Result.Nodes.getNodeAs<TypeLoc>("tl");
- SourceLocation Loc = TL.getLocStart();
+ SourceLocation Loc = TL.getBeginLoc();
if (Loc.isInvalid() || Loc.isMacroID())
return;
Modified: clang-tools-extra/trunk/clang-tidy/google/OverloadedUnaryAndCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/OverloadedUnaryAndCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/OverloadedUnaryAndCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/google/OverloadedUnaryAndCheck.cpp Thu Aug 9 15:42:26 2018
@@ -43,7 +43,7 @@ void OverloadedUnaryAndCheck::registerMa
void OverloadedUnaryAndCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Decl = Result.Nodes.getNodeAs<FunctionDecl>("overload");
- diag(Decl->getLocStart(),
+ diag(Decl->getBeginLoc(),
"do not overload unary operator&, it is dangerous.");
}
Modified: clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp Thu Aug 9 15:42:26 2018
@@ -48,7 +48,7 @@ void UnnamedNamespaceInHeaderCheck::regi
void UnnamedNamespaceInHeaderCheck::check(
const MatchFinder::MatchResult &Result) {
const auto *N = Result.Nodes.getNodeAs<NamespaceDecl>("anonymousNamespace");
- SourceLocation Loc = N->getLocStart();
+ SourceLocation Loc = N->getBeginLoc();
if (!Loc.isValid())
return;
Modified: clang-tools-extra/trunk/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp Thu Aug 9 15:42:26 2018
@@ -30,7 +30,7 @@ void UsingNamespaceDirectiveCheck::regis
void UsingNamespaceDirectiveCheck::check(
const MatchFinder::MatchResult &Result) {
const auto *U = Result.Nodes.getNodeAs<UsingDirectiveDecl>("usingNamespace");
- SourceLocation Loc = U->getLocStart();
+ SourceLocation Loc = U->getBeginLoc();
if (U->isImplicit() || !Loc.isValid())
return;
Modified: clang-tools-extra/trunk/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp Thu Aug 9 15:42:26 2018
@@ -35,14 +35,14 @@ void ExceptionBaseclassCheck::registerMa
void ExceptionBaseclassCheck::check(const MatchFinder::MatchResult &Result) {
const auto *BadThrow = Result.Nodes.getNodeAs<CXXThrowExpr>("bad_throw");
- diag(BadThrow->getSubExpr()->getLocStart(), "throwing an exception whose "
+ diag(BadThrow->getSubExpr()->getBeginLoc(), "throwing an exception whose "
"type %0 is not derived from "
"'std::exception'")
<< BadThrow->getSubExpr()->getType() << BadThrow->getSourceRange();
const auto *TypeDecl = Result.Nodes.getNodeAs<NamedDecl>("decl");
if (TypeDecl != nullptr)
- diag(TypeDecl->getLocStart(), "type defined here", DiagnosticIDs::Note);
+ diag(TypeDecl->getBeginLoc(), "type defined here", DiagnosticIDs::Note);
}
} // namespace hicpp
Modified: clang-tools-extra/trunk/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp Thu Aug 9 15:42:26 2018
@@ -94,7 +94,7 @@ static std::size_t getNumberOfPossibleVa
void MultiwayPathsCoveredCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *ElseIfWithoutElse =
Result.Nodes.getNodeAs<IfStmt>("else-if")) {
- diag(ElseIfWithoutElse->getLocStart(),
+ diag(ElseIfWithoutElse->getBeginLoc(),
"potentially uncovered codepath; add an ending else statement");
return;
}
@@ -120,7 +120,7 @@ void MultiwayPathsCoveredCheck::check(co
// FIXME: Evaluate, if emitting a fix-it to simplify that statement is
// reasonable.
if (!SwitchHasDefault && SwitchCaseCount == 0) {
- diag(Switch->getLocStart(),
+ diag(Switch->getBeginLoc(),
"switch statement without labels has no effect");
return;
}
@@ -132,7 +132,7 @@ void MultiwayPathsCoveredCheck::handleSw
assert(CaseCount > 0 && "Switch statement with supposedly one default "
"branch did not contain any case labels");
if (CaseCount == 1 || CaseCount == 2)
- diag(Switch->getLocStart(),
+ diag(Switch->getBeginLoc(),
CaseCount == 1
? "degenerated switch with default label only"
: "switch could be better written as an if/else statement");
@@ -172,7 +172,7 @@ void MultiwayPathsCoveredCheck::handleSw
// FIXME: Transform the 'switch' into an 'if' for CaseCount == 1.
if (CaseCount < MaxPathsPossible)
- diag(Switch->getLocStart(),
+ diag(Switch->getBeginLoc(),
CaseCount == 1 ? "switch with only one case; use an if statement"
: "potential uncovered code path; add a default label");
}
Modified: clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp Thu Aug 9 15:42:26 2018
@@ -75,14 +75,14 @@ void SignedBitwiseCheck::check(const Mat
if (const auto *UnaryOp = N.getNodeAs<UnaryOperator>("unary-signed")) {
IsUnary = true;
- Location = UnaryOp->getLocStart();
+ Location = UnaryOp->getBeginLoc();
} else {
if (const auto *BinaryOp =
N.getNodeAs<BinaryOperator>("binary-no-sign-interference"))
- Location = BinaryOp->getLocStart();
+ Location = BinaryOp->getBeginLoc();
else if (const auto *BinaryOp =
N.getNodeAs<BinaryOperator>("binary-sign-interference"))
- Location = BinaryOp->getLocStart();
+ Location = BinaryOp->getBeginLoc();
else
llvm_unreachable("unexpected matcher result");
}
Modified: clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp Thu Aug 9 15:42:26 2018
@@ -50,7 +50,7 @@ void TwineLocalCheck::check(const MatchF
SourceLocation EndLoc = Lexer::getLocForEndOfToken(
VD->getInit()->getLocEnd(), 0, *Result.SourceManager, getLangOpts());
Diag << FixItHint::CreateReplacement(TypeRange, "std::string")
- << FixItHint::CreateInsertion(VD->getInit()->getLocStart(), "(")
+ << FixItHint::CreateInsertion(VD->getInit()->getBeginLoc(), "(")
<< FixItHint::CreateInsertion(EndLoc, ").str()");
} else {
// Just an implicit conversion. Insert the real type.
Modified: clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp Thu Aug 9 15:42:26 2018
@@ -22,7 +22,7 @@ namespace {
AST_MATCHER_P(NamedDecl, usesHeaderFileExtension,
utils::HeaderFileExtensionsSet, HeaderFileExtensions) {
return utils::isExpansionLocInHeaderFile(
- Node.getLocStart(), Finder->getASTContext().getSourceManager(),
+ Node.getBeginLoc(), Finder->getASTContext().getSourceManager(),
HeaderFileExtensions);
}
Modified: clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp Thu Aug 9 15:42:26 2018
@@ -884,7 +884,7 @@ void RedundantExpressionCheck::checkBitw
if (exprEvaluatesToZero(Opcode, Value)) {
diag(Loc, "expression always evaluates to 0");
} else if (exprEvaluatesToBitwiseNegatedZero(Opcode, Value)) {
- SourceRange ConstExprRange(ConstExpr->getLocStart(),
+ SourceRange ConstExprRange(ConstExpr->getBeginLoc(),
ConstExpr->getLocEnd());
StringRef ConstExprText = Lexer::getSourceText(
CharSourceRange::getTokenRange(ConstExprRange), *Result.SourceManager,
@@ -893,7 +893,7 @@ void RedundantExpressionCheck::checkBitw
diag(Loc, "expression always evaluates to '%0'") << ConstExprText;
} else if (exprEvaluatesToSymbolic(Opcode, Value)) {
- SourceRange SymExprRange(Sym->getLocStart(), Sym->getLocEnd());
+ SourceRange SymExprRange(Sym->getBeginLoc(), Sym->getLocEnd());
StringRef ExprText = Lexer::getSourceText(
CharSourceRange::getTokenRange(SymExprRange), *Result.SourceManager,
Modified: clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp Thu Aug 9 15:42:26 2018
@@ -88,7 +88,7 @@ void StaticAssertCheck::check(const Matc
const auto *AssertExprRoot =
Result.Nodes.getNodeAs<BinaryOperator>("assertExprRoot");
const auto *CastExpr = Result.Nodes.getNodeAs<CStyleCastExpr>("castExpr");
- SourceLocation AssertExpansionLoc = CondStmt->getLocStart();
+ SourceLocation AssertExpansionLoc = CondStmt->getBeginLoc();
if (!AssertExpansionLoc.isValid() || !AssertExpansionLoc.isMacroID())
return;
@@ -129,7 +129,7 @@ void StaticAssertCheck::check(const Matc
FixItHints.push_back(FixItHint::CreateRemoval(
SourceRange(AssertExprRoot->getOperatorLoc())));
FixItHints.push_back(FixItHint::CreateRemoval(
- SourceRange(AssertMSG->getLocStart(), AssertMSG->getLocEnd())));
+ SourceRange(AssertMSG->getBeginLoc(), AssertMSG->getLocEnd())));
StaticAssertMSG = (Twine(", \"") + AssertMSG->getString() + "\"").str();
}
Modified: clang-tools-extra/trunk/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp Thu Aug 9 15:42:26 2018
@@ -81,7 +81,7 @@ void ThrowByValueCatchByReferenceCheck::
if (declRef && isCatchVariable(declRef)) {
return;
}
- diag(subExpr->getLocStart(), "throw expression throws a pointer; it should "
+ diag(subExpr->getBeginLoc(), "throw expression throws a pointer; it should "
"throw a non-pointer value instead");
}
// If the throw statement does not throw by pointer then it throws by value
@@ -124,7 +124,7 @@ void ThrowByValueCatchByReferenceCheck::
}
}
if (emit)
- diag(subExpr->getLocStart(),
+ diag(subExpr->getBeginLoc(),
"throw expression should throw anonymous temporary values instead");
}
}
@@ -144,7 +144,7 @@ void ThrowByValueCatchByReferenceCheck::
// We do not diagnose when catching pointer to strings since we also allow
// throwing string literals.
if (!PT->getPointeeType()->isAnyCharacterType())
- diag(varDecl->getLocStart(), diagMsgCatchReference);
+ diag(varDecl->getBeginLoc(), diagMsgCatchReference);
} else if (!caughtType->isReferenceType()) {
const char *diagMsgCatchReference = "catch handler catches by value; "
"should catch by reference instead";
@@ -152,7 +152,7 @@ void ThrowByValueCatchByReferenceCheck::
// value". In this case we should emit a diagnosis message unless the type
// is trivial.
if (!caughtType.isTrivialType(context))
- diag(varDecl->getLocStart(), diagMsgCatchReference);
+ diag(varDecl->getBeginLoc(), diagMsgCatchReference);
}
}
Modified: clang-tools-extra/trunk/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp Thu Aug 9 15:42:26 2018
@@ -72,7 +72,7 @@ void UnconventionalAssignOperatorCheck::
void UnconventionalAssignOperatorCheck::check(
const MatchFinder::MatchResult &Result) {
if (const auto *RetStmt = Result.Nodes.getNodeAs<ReturnStmt>("returnStmt")) {
- diag(RetStmt->getLocStart(), "operator=() should always return '*this'");
+ diag(RetStmt->getBeginLoc(), "operator=() should always return '*this'");
} else {
static const char *const Messages[][2] = {
{"ReturnType", "operator=() should return '%0&'"},
@@ -82,7 +82,7 @@ void UnconventionalAssignOperatorCheck::
const auto *Method = Result.Nodes.getNodeAs<CXXMethodDecl>("method");
for (const auto &Message : Messages) {
if (Result.Nodes.getNodeAs<Decl>(Message[0]))
- diag(Method->getLocStart(), Message[1])
+ diag(Method->getBeginLoc(), Message[1])
<< Method->getParent()->getName()
<< (Method->isConst() ? "const" : "virtual");
}
Modified: clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp Thu Aug 9 15:42:26 2018
@@ -34,7 +34,7 @@ void UnusedAliasDeclsCheck::registerMatc
void UnusedAliasDeclsCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *AliasDecl = Result.Nodes.getNodeAs<NamedDecl>("alias")) {
FoundDecls[AliasDecl] = CharSourceRange::getCharRange(
- AliasDecl->getLocStart(),
+ AliasDecl->getBeginLoc(),
Lexer::findLocationAfterToken(
AliasDecl->getLocEnd(), tok::semi, *Result.SourceManager,
getLangOpts(),
Modified: clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp Thu Aug 9 15:42:26 2018
@@ -41,8 +41,8 @@ static CharSourceRange removeNode(const
const T *PrevNode, const T *Node,
const T *NextNode) {
if (NextNode)
- return CharSourceRange::getCharRange(Node->getLocStart(),
- NextNode->getLocStart());
+ return CharSourceRange::getCharRange(Node->getBeginLoc(),
+ NextNode->getBeginLoc());
if (PrevNode)
return CharSourceRange::getTokenRange(
Modified: clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp Thu Aug 9 15:42:26 2018
@@ -68,7 +68,7 @@ void UnusedUsingDeclsCheck::check(const
UsingDeclContext Context(Using);
Context.UsingDeclRange = CharSourceRange::getCharRange(
- Using->getLocStart(),
+ Using->getBeginLoc(),
Lexer::findLocationAfterToken(
Using->getLocEnd(), tok::semi, *Result.SourceManager, getLangOpts(),
/*SkipTrailingWhitespaceAndNewLine=*/true));
Modified: clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp Thu Aug 9 15:42:26 2018
@@ -59,7 +59,7 @@ buildBindArguments(const MatchFinder::Ma
}
B.Tokens = Lexer::getSourceText(
- CharSourceRange::getTokenRange(E->getLocStart(), E->getLocEnd()),
+ CharSourceRange::getTokenRange(E->getBeginLoc(), E->getLocEnd()),
*Result.SourceManager, Result.Context->getLangOpts());
SmallVector<StringRef, 2> Matches;
@@ -131,7 +131,7 @@ void AvoidBindCheck::registerMatchers(Ma
void AvoidBindCheck::check(const MatchFinder::MatchResult &Result) {
const auto *MatchedDecl = Result.Nodes.getNodeAs<CallExpr>("bind");
- auto Diag = diag(MatchedDecl->getLocStart(), "prefer a lambda to std::bind");
+ auto Diag = diag(MatchedDecl->getBeginLoc(), "prefer a lambda to std::bind");
const auto Args = buildBindArguments(Result, MatchedDecl);
Modified: clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp Thu Aug 9 15:42:26 2018
@@ -199,7 +199,7 @@ void MakeSmartPtrCheck::checkReset(Sourc
const auto *Expr = cast<MemberExpr>(Reset->getCallee());
SourceLocation OperatorLoc = Expr->getOperatorLoc();
SourceLocation ResetCallStart = Reset->getExprLoc();
- SourceLocation ExprStart = Expr->getLocStart();
+ SourceLocation ExprStart = Expr->getBeginLoc();
SourceLocation ExprEnd =
Lexer::getLocForEndOfToken(Expr->getLocEnd(), 0, SM, getLangOpts());
@@ -353,7 +353,7 @@ bool MakeSmartPtrCheck::replaceNew(Diagn
// Has to be replaced with:
// smart_ptr<Pair>(Pair{first, second});
InitRange = SourceRange(
- New->getAllocatedTypeSourceInfo()->getTypeLoc().getLocStart(),
+ New->getAllocatedTypeSourceInfo()->getTypeLoc().getBeginLoc(),
New->getInitializer()->getSourceRange().getEnd());
}
Diag << FixItHint::CreateRemoval(
Modified: clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp Thu Aug 9 15:42:26 2018
@@ -194,7 +194,7 @@ void PassByValueCheck::check(const Match
*Result.Context))
return;
- auto Diag = diag(ParamDecl->getLocStart(), "pass by value and use std::move");
+ auto Diag = diag(ParamDecl->getBeginLoc(), "pass by value and use std::move");
// Iterate over all declarations of the constructor.
for (const ParmVarDecl *ParmDecl : collectParamDecls(Ctor, ParamDecl)) {
@@ -206,7 +206,7 @@ void PassByValueCheck::check(const Match
continue;
TypeLoc ValueTL = RefTL.getPointeeLoc();
- auto TypeRange = CharSourceRange::getTokenRange(ParmDecl->getLocStart(),
+ auto TypeRange = CharSourceRange::getTokenRange(ParmDecl->getBeginLoc(),
ParamTL.getLocEnd());
std::string ValueStr = Lexer::getSourceText(CharSourceRange::getTokenRange(
ValueTL.getSourceRange()),
Modified: clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp Thu Aug 9 15:42:26 2018
@@ -129,14 +129,14 @@ void RawStringLiteralCheck::registerMatc
void RawStringLiteralCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Literal = Result.Nodes.getNodeAs<StringLiteral>("lit");
- if (Literal->getLocStart().isMacroID())
+ if (Literal->getBeginLoc().isMacroID())
return;
if (containsEscapedCharacters(Result, Literal, DisallowedChars)) {
std::string Replacement = asRawStringLiteral(Literal, DelimiterStem);
if (ReplaceShorterLiterals ||
Replacement.length() <=
- Lexer::MeasureTokenLength(Literal->getLocStart(),
+ Lexer::MeasureTokenLength(Literal->getBeginLoc(),
*Result.SourceManager, getLangOpts()))
replaceWithRawStringLiteral(Result, Literal, Replacement);
}
@@ -148,7 +148,7 @@ void RawStringLiteralCheck::replaceWithR
CharSourceRange CharRange = Lexer::makeFileCharRange(
CharSourceRange::getTokenRange(Literal->getSourceRange()),
*Result.SourceManager, getLangOpts());
- diag(Literal->getLocStart(),
+ diag(Literal->getBeginLoc(),
"escaped string literal can be written as a raw string literal")
<< FixItHint::CreateReplacement(CharRange, Replacement);
}
Modified: clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp Thu Aug 9 15:42:26 2018
@@ -103,9 +103,9 @@ void RedundantVoidArgCheck::processFunct
const MatchFinder::MatchResult &Result, const FunctionDecl *Function) {
if (Function->isThisDeclarationADefinition()) {
const Stmt *Body = Function->getBody();
- SourceLocation Start = Function->getLocStart();
+ SourceLocation Start = Function->getBeginLoc();
SourceLocation End =
- Body ? Body->getLocStart().getLocWithOffset(-1) : Function->getLocEnd();
+ Body ? Body->getBeginLoc().getLocWithOffset(-1) : Function->getLocEnd();
removeVoidArgumentTokens(Result, SourceRange(Start, End),
"function definition");
} else {
@@ -198,10 +198,10 @@ void RedundantVoidArgCheck::processField
void RedundantVoidArgCheck::processVarDecl(
const MatchFinder::MatchResult &Result, const VarDecl *Var) {
if (protoTypeHasNoParms(Var->getType())) {
- SourceLocation Begin = Var->getLocStart();
+ SourceLocation Begin = Var->getBeginLoc();
if (Var->hasInit()) {
SourceLocation InitStart =
- Result.SourceManager->getExpansionLoc(Var->getInit()->getLocStart())
+ Result.SourceManager->getExpansionLoc(Var->getInit()->getBeginLoc())
.getLocWithOffset(-1);
removeVoidArgumentTokens(Result, SourceRange(Begin, InitStart),
"variable declaration with initializer");
@@ -237,7 +237,7 @@ void RedundantVoidArgCheck::processLambd
Lambda->hasExplicitParameters()) {
SourceLocation Begin =
Lambda->getIntroducerRange().getEnd().getLocWithOffset(1);
- SourceLocation End = Lambda->getBody()->getLocStart().getLocWithOffset(-1);
+ SourceLocation End = Lambda->getBody()->getBeginLoc().getLocWithOffset(-1);
removeVoidArgumentTokens(Result, SourceRange(Begin, End),
"lambda expression");
}
Modified: clang-tools-extra/trunk/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp Thu Aug 9 15:42:26 2018
@@ -62,13 +62,13 @@ void ReplaceRandomShuffleCheck::check(co
const auto *MatchedArgumentThree = Result.Nodes.getNodeAs<Expr>("randomFunc");
const auto *MatchedCallExpr = Result.Nodes.getNodeAs<CallExpr>("match");
- if (MatchedCallExpr->getLocStart().isMacroID())
+ if (MatchedCallExpr->getBeginLoc().isMacroID())
return;
auto Diag = [&] {
if (MatchedCallExpr->getNumArgs() == 3) {
auto DiagL =
- diag(MatchedCallExpr->getLocStart(),
+ diag(MatchedCallExpr->getBeginLoc(),
"'std::random_shuffle' has been removed in C++17; use "
"'std::shuffle' and an alternative random mechanism instead");
DiagL << FixItHint::CreateReplacement(
@@ -76,7 +76,7 @@ void ReplaceRandomShuffleCheck::check(co
"std::mt19937(std::random_device()())");
return DiagL;
} else {
- auto DiagL = diag(MatchedCallExpr->getLocStart(),
+ auto DiagL = diag(MatchedCallExpr->getBeginLoc(),
"'std::random_shuffle' has been removed in C++17; use "
"'std::shuffle' instead");
DiagL << FixItHint::CreateInsertion(
@@ -94,12 +94,12 @@ void ReplaceRandomShuffleCheck::check(co
NewName = "std::" + NewName;
Diag << FixItHint::CreateRemoval(MatchedDecl->getSourceRange());
- Diag << FixItHint::CreateInsertion(MatchedDecl->getLocStart(), NewName);
+ Diag << FixItHint::CreateInsertion(MatchedDecl->getBeginLoc(), NewName);
if (Optional<FixItHint> IncludeFixit =
IncludeInserter->CreateIncludeInsertion(
Result.Context->getSourceManager().getFileID(
- MatchedCallExpr->getLocStart()),
+ MatchedCallExpr->getBeginLoc()),
"random", /*IsAngled=*/true))
Diag << IncludeFixit.getValue();
}
Modified: clang-tools-extra/trunk/clang-tidy/modernize/ShrinkToFitCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/ShrinkToFitCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/ShrinkToFitCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/ShrinkToFitCheck.cpp Thu Aug 9 15:42:26 2018
@@ -59,7 +59,7 @@ void ShrinkToFitCheck::check(const Match
const auto *Container = Result.Nodes.getNodeAs<Expr>("ContainerToShrink");
FixItHint Hint;
- if (!MemberCall->getLocStart().isMacroID()) {
+ if (!MemberCall->getBeginLoc().isMacroID()) {
const LangOptions &Opts = getLangOpts();
std::string ReplacementText;
if (const auto *UnaryOp = llvm::dyn_cast<UnaryOperator>(Container)) {
@@ -79,7 +79,7 @@ void ShrinkToFitCheck::check(const Match
ReplacementText);
}
- diag(MemberCall->getLocStart(), "the shrink_to_fit method should be used "
+ diag(MemberCall->getBeginLoc(), "the shrink_to_fit method should be used "
"to reduce the capacity of a shrinkable "
"container")
<< Hint;
Modified: clang-tools-extra/trunk/clang-tidy/modernize/UnaryStaticAssertCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UnaryStaticAssertCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/UnaryStaticAssertCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/UnaryStaticAssertCheck.cpp Thu Aug 9 15:42:26 2018
@@ -32,7 +32,7 @@ void UnaryStaticAssertCheck::check(const
SourceLocation Loc = MatchedDecl->getLocation();
if (!AssertMessage || AssertMessage->getLength() ||
- AssertMessage->getLocStart().isMacroID() || Loc.isMacroID())
+ AssertMessage->getBeginLoc().isMacroID() || Loc.isMacroID())
return;
diag(Loc,
Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseBoolLiteralsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseBoolLiteralsCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/UseBoolLiteralsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/UseBoolLiteralsCheck.cpp Thu Aug 9 15:42:26 2018
@@ -57,7 +57,7 @@ void UseBoolLiteralsCheck::check(const M
const Expr *Expression = Cast ? Cast : Literal;
- bool InMacro = Expression->getLocStart().isMacroID();
+ bool InMacro = Expression->getBeginLoc().isMacroID();
if (InMacro && IgnoreMacros)
return;
Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp Thu Aug 9 15:42:26 2018
@@ -202,7 +202,7 @@ void UseDefaultMemberInitCheck::checkDef
const MatchFinder::MatchResult &Result, const CXXCtorInitializer *Init) {
const FieldDecl *Field = Init->getAnyMember();
- SourceLocation StartLoc = Field->getLocStart();
+ SourceLocation StartLoc = Field->getBeginLoc();
if (StartLoc.isMacroID() && IgnoreMacros)
return;
Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDefaultCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDefaultCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDefaultCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDefaultCheck.cpp Thu Aug 9 15:42:26 2018
@@ -298,7 +298,7 @@ void UseEqualsDefaultCheck::check(const
// expansion locations are reported.
SourceLocation Location = SpecialFunctionDecl->getLocation();
if (Location.isMacroID())
- Location = Body->getLocStart();
+ Location = Body->getBeginLoc();
auto Diag = diag(Location, "use '= default' to define a trivial " +
SpecialFunctionName);
Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp Thu Aug 9 15:42:26 2018
@@ -125,7 +125,7 @@ public:
}
bool VisitStmt(Stmt *S) {
- if (SM.getFileLoc(S->getLocStart()) != CastLoc)
+ if (SM.getFileLoc(S->getBeginLoc()) != CastLoc)
return true;
Visited = true;
@@ -214,7 +214,7 @@ public:
return true;
}
- SourceLocation StartLoc = FirstSubExpr->getLocStart();
+ SourceLocation StartLoc = FirstSubExpr->getBeginLoc();
SourceLocation EndLoc = FirstSubExpr->getLocEnd();
// If the location comes from a macro arg expansion, *all* uses of that
@@ -269,7 +269,7 @@ private:
/// \brief Tests that all expansions of a macro arg, one of which expands to
/// result in \p CE, yield NullTo(Member)Pointer casts.
bool allArgUsesValid(const CastExpr *CE) {
- SourceLocation CastLoc = CE->getLocStart();
+ SourceLocation CastLoc = CE->getBeginLoc();
// Step 1: Get location of macro arg and location of the macro the arg was
// provided to.
@@ -437,9 +437,9 @@ private:
SourceLocation Loc;
if (const auto *D = Parent.get<Decl>())
- Loc = D->getLocStart();
+ Loc = D->getBeginLoc();
else if (const auto *S = Parent.get<Stmt>())
- Loc = S->getLocStart();
+ Loc = S->getBeginLoc();
// TypeLoc and NestedNameSpecifierLoc are members of the parent map. Skip
// them and keep going up.
Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseTransparentFunctorsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseTransparentFunctorsCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/UseTransparentFunctorsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/UseTransparentFunctorsCheck.cpp Thu Aug 9 15:42:26 2018
@@ -85,8 +85,8 @@ void UseTransparentFunctorsCheck::check(
Result.Nodes.getNodeAs<ClassTemplateSpecializationDecl>("FunctorClass");
if (const auto *FuncInst =
Result.Nodes.getNodeAs<CXXConstructExpr>("FuncInst")) {
- diag(FuncInst->getLocStart(), Message)
- << (FuncClass->getName() + "<>").str();
+ diag(FuncInst->getBeginLoc(), Message)
+ << (FuncClass->getName() + "<>").str();
return;
}
Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp Thu Aug 9 15:42:26 2018
@@ -57,14 +57,14 @@ void UseUncaughtExceptionsCheck::check(c
bool WarnOnly = false;
if (C) {
- BeginLoc = C->getLocStart();
+ BeginLoc = C->getBeginLoc();
EndLoc = C->getLocEnd();
} else if (const auto *E = Result.Nodes.getNodeAs<CallExpr>("call_expr")) {
- BeginLoc = E->getLocStart();
+ BeginLoc = E->getBeginLoc();
EndLoc = E->getLocEnd();
} else if (const auto *D =
Result.Nodes.getNodeAs<DeclRefExpr>("decl_ref_expr")) {
- BeginLoc = D->getLocStart();
+ BeginLoc = D->getBeginLoc();
EndLoc = D->getLocEnd();
WarnOnly = true;
} else {
Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseUsingCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseUsingCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/UseUsingCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/UseUsingCheck.cpp Thu Aug 9 15:42:26 2018
@@ -83,7 +83,7 @@ void UseUsingCheck::check(const MatchFin
auto &Context = *Result.Context;
auto &SM = *Result.SourceManager;
- SourceLocation StartLoc = MatchedDecl->getLocStart();
+ SourceLocation StartLoc = MatchedDecl->getBeginLoc();
if (StartLoc.isMacroID() && IgnoreMacros)
return;
Modified: clang-tools-extra/trunk/clang-tidy/objc/AvoidNSErrorInitCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/objc/AvoidNSErrorInitCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/objc/AvoidNSErrorInitCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/objc/AvoidNSErrorInitCheck.cpp Thu Aug 9 15:42:26 2018
@@ -31,7 +31,7 @@ void AvoidNSErrorInitCheck::registerMatc
void AvoidNSErrorInitCheck::check(const MatchFinder::MatchResult &Result) {
const auto *MatchedExpr =
Result.Nodes.getNodeAs<ObjCMessageExpr>("nserrorInit");
- diag(MatchedExpr->getLocStart(),
+ diag(MatchedExpr->getBeginLoc(),
"use errorWithDomain:code:userInfo: or initWithDomain:code:userInfo: to "
"create a new NSError");
}
Modified: clang-tools-extra/trunk/clang-tidy/objc/AvoidSpinlockCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/objc/AvoidSpinlockCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/objc/AvoidSpinlockCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/objc/AvoidSpinlockCheck.cpp Thu Aug 9 15:42:26 2018
@@ -27,7 +27,7 @@ void AvoidSpinlockCheck::registerMatcher
void AvoidSpinlockCheck::check(const MatchFinder::MatchResult &Result) {
const auto *MatchedExpr = Result.Nodes.getNodeAs<CallExpr>("spinlock");
- diag(MatchedExpr->getLocStart(),
+ diag(MatchedExpr->getBeginLoc(),
"use os_unfair_lock_lock() or dispatch queue APIs instead of the "
"deprecated OSSpinLock");
}
Modified: clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp Thu Aug 9 15:42:26 2018
@@ -90,13 +90,14 @@ void FasterStringFindCheck::check(const
if (!Replacement)
return;
- diag(Literal->getLocStart(), "%0 called with a string literal consisting of "
+ diag(Literal->getBeginLoc(), "%0 called with a string literal consisting of "
"a single character; consider using the more "
"effective overload accepting a character")
- << FindFunc << FixItHint::CreateReplacement(
- CharSourceRange::getTokenRange(Literal->getLocStart(),
- Literal->getLocEnd()),
- *Replacement);
+ << FindFunc
+ << FixItHint::CreateReplacement(
+ CharSourceRange::getTokenRange(Literal->getBeginLoc(),
+ Literal->getLocEnd()),
+ *Replacement);
}
} // namespace performance
Modified: clang-tools-extra/trunk/clang-tidy/performance/ForRangeCopyCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/performance/ForRangeCopyCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/performance/ForRangeCopyCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/performance/ForRangeCopyCheck.cpp Thu Aug 9 15:42:26 2018
@@ -41,7 +41,7 @@ void ForRangeCopyCheck::registerMatchers
void ForRangeCopyCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Var = Result.Nodes.getNodeAs<VarDecl>("loopVar");
// Ignore code in macros since we can't place the fixes correctly.
- if (Var->getLocStart().isMacroID())
+ if (Var->getBeginLoc().isMacroID())
return;
if (handleConstValueCopy(*Var, *Result.Context))
return;
Modified: clang-tools-extra/trunk/clang-tidy/performance/ImplicitConversionInLoopCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/performance/ImplicitConversionInLoopCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/performance/ImplicitConversionInLoopCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/performance/ImplicitConversionInLoopCheck.cpp Thu Aug 9 15:42:26 2018
@@ -96,7 +96,7 @@ void ImplicitConversionInLoopCheck::Repo
"change the type to the matching one (%1 but 'const auto&' is always a "
"valid option) or remove the reference to make it explicit that you are "
"creating a new value";
- diag(VD->getLocStart(), Message) << VD << ConstRefType;
+ diag(VD->getBeginLoc(), Message) << VD << ConstRefType;
}
} // namespace performance
Modified: clang-tools-extra/trunk/clang-tidy/performance/InefficientAlgorithmCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/performance/InefficientAlgorithmCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/performance/InefficientAlgorithmCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/performance/InefficientAlgorithmCheck.cpp Thu Aug 9 15:42:26 2018
@@ -99,7 +99,7 @@ void InefficientAlgorithmCheck::check(co
.getUnqualifiedType()
.getCanonicalType();
if (AlgCmp != ContainerCmp) {
- diag(Arg->getLocStart(),
+ diag(Arg->getBeginLoc(),
"different comparers used in the algorithm and the container");
return;
}
@@ -153,7 +153,7 @@ void InefficientAlgorithmCheck::check(co
Hint = FixItHint::CreateReplacement(CallRange, ReplacementText);
}
- diag(AlgCall->getLocStart(),
+ diag(AlgCall->getBeginLoc(),
"this STL algorithm call should be replaced with a container method")
<< Hint;
}
Modified: clang-tools-extra/trunk/clang-tidy/performance/InefficientVectorOperationCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/performance/InefficientVectorOperationCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/performance/InefficientVectorOperationCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/performance/InefficientVectorOperationCheck.cpp Thu Aug 9 15:42:26 2018
@@ -168,7 +168,7 @@ void InefficientVectorOperationCheck::ch
// FIXME: make it more intelligent to identify the pre-allocating operations
// before the for loop.
if (SM.isBeforeInTranslationUnit(Ref->getLocation(),
- LoopStmt->getLocStart())) {
+ LoopStmt->getBeginLoc())) {
return;
}
}
@@ -200,13 +200,13 @@ void InefficientVectorOperationCheck::ch
}
auto Diag =
- diag(VectorAppendCall->getLocStart(),
+ diag(VectorAppendCall->getBeginLoc(),
"%0 is called inside a loop; "
"consider pre-allocating the vector capacity before the loop")
<< VectorAppendCall->getMethodDecl()->getDeclName();
if (!ReserveStmt.empty())
- Diag << FixItHint::CreateInsertion(LoopStmt->getLocStart(), ReserveStmt);
+ Diag << FixItHint::CreateInsertion(LoopStmt->getBeginLoc(), ReserveStmt);
}
} // namespace performance
Modified: clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp Thu Aug 9 15:42:26 2018
@@ -23,7 +23,7 @@ static void ReplaceCallWithArg(const Cal
const Expr *Arg = Call->getArg(0);
CharSourceRange BeforeArgumentsRange = Lexer::makeFileCharRange(
- CharSourceRange::getCharRange(Call->getLocStart(), Arg->getLocStart()),
+ CharSourceRange::getCharRange(Call->getBeginLoc(), Arg->getBeginLoc()),
SM, LangOpts);
CharSourceRange AfterArgumentsRange = Lexer::makeFileCharRange(
CharSourceRange::getCharRange(Call->getLocEnd(),
Modified: clang-tools-extra/trunk/clang-tidy/performance/TypePromotionInMathFnCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/performance/TypePromotionInMathFnCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/performance/TypePromotionInMathFnCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/performance/TypePromotionInMathFnCheck.cpp Thu Aug 9 15:42:26 2018
@@ -195,7 +195,7 @@ void TypePromotionInMathFnCheck::check(c
// declared in <math.h>.
if (FnInCmath)
if (auto IncludeFixit = IncludeInserter->CreateIncludeInsertion(
- Result.Context->getSourceManager().getFileID(Call->getLocStart()),
+ Result.Context->getSourceManager().getFileID(Call->getBeginLoc()),
"cmath", /*IsAngled=*/true))
Diag << *IncludeFixit;
}
Modified: clang-tools-extra/trunk/clang-tidy/performance/UnnecessaryValueParamCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/performance/UnnecessaryValueParamCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/performance/UnnecessaryValueParamCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/performance/UnnecessaryValueParamCheck.cpp Thu Aug 9 15:42:26 2018
@@ -156,7 +156,7 @@ void UnnecessaryValueParamCheck::check(c
// compilation unit as the signature change could introduce build errors.
// 4. the function is an explicit template specialization.
const auto *Method = llvm::dyn_cast<CXXMethodDecl>(Function);
- if (Param->getLocStart().isMacroID() || (Method && Method->isVirtual()) ||
+ if (Param->getBeginLoc().isMacroID() || (Method && Method->isVirtual()) ||
isReferencedOutsideOfCallExpr(*Function, *Result.Context) ||
isExplicitTemplateSpecialization(*Function))
return;
@@ -189,20 +189,20 @@ void UnnecessaryValueParamCheck::storeOp
void UnnecessaryValueParamCheck::handleMoveFix(const ParmVarDecl &Var,
const DeclRefExpr &CopyArgument,
const ASTContext &Context) {
- auto Diag = diag(CopyArgument.getLocStart(),
+ auto Diag = diag(CopyArgument.getBeginLoc(),
"parameter %0 is passed by value and only copied once; "
"consider moving it to avoid unnecessary copies")
<< &Var;
// Do not propose fixes in macros since we cannot place them correctly.
- if (CopyArgument.getLocStart().isMacroID())
+ if (CopyArgument.getBeginLoc().isMacroID())
return;
const auto &SM = Context.getSourceManager();
auto EndLoc = Lexer::getLocForEndOfToken(CopyArgument.getLocation(), 0, SM,
Context.getLangOpts());
- Diag << FixItHint::CreateInsertion(CopyArgument.getLocStart(), "std::move(")
+ Diag << FixItHint::CreateInsertion(CopyArgument.getBeginLoc(), "std::move(")
<< FixItHint::CreateInsertion(EndLoc, ")");
if (auto IncludeFixit = Inserter->CreateIncludeInsertion(
- SM.getFileID(CopyArgument.getLocStart()), "utility",
+ SM.getFileID(CopyArgument.getBeginLoc()), "utility",
/*IsAngled=*/true))
Diag << *IncludeFixit;
}
Modified: clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp Thu Aug 9 15:42:26 2018
@@ -22,7 +22,7 @@ namespace {
SourceRange getTypeRange(const ParmVarDecl &Param) {
if (Param.getIdentifier() != nullptr)
- return SourceRange(Param.getLocStart(),
+ return SourceRange(Param.getBeginLoc(),
Param.getLocEnd().getLocWithOffset(-1));
return Param.getSourceRange();
}
@@ -82,7 +82,7 @@ void AvoidConstParamsInDecls::check(cons
if (!Param->getType().isLocalConstQualified())
return;
- auto Diag = diag(Param->getLocStart(),
+ auto Diag = diag(Param->getBeginLoc(),
"parameter %0 is const-qualified in the function "
"declaration; const-qualification of parameters only has an "
"effect in function definitions");
@@ -97,7 +97,7 @@ void AvoidConstParamsInDecls::check(cons
Diag << Param;
}
- if (Param->getLocStart().isMacroID() != Param->getLocEnd().isMacroID()) {
+ if (Param->getBeginLoc().isMacroID() != Param->getLocEnd().isMacroID()) {
// Do not offer a suggestion if the part of the variable declaration comes
// from a macro.
return;
Modified: clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp Thu Aug 9 15:42:26 2018
@@ -174,7 +174,7 @@ BracesAroundStatementsCheck::findRParenL
const SourceManager &SM,
const ASTContext *Context) {
// Skip macros.
- if (S->getLocStart().isMacroID())
+ if (S->getBeginLoc().isMacroID())
return SourceLocation();
SourceLocation CondEndLoc = S->getCond()->getLocEnd();
@@ -232,7 +232,7 @@ bool BracesAroundStatementsCheck::checkS
// level as the start of the statement. We also need file locations for
// Lexer::getLocForEndOfToken working properly.
InitialLoc = Lexer::makeFileCharRange(
- CharSourceRange::getCharRange(InitialLoc, S->getLocStart()),
+ CharSourceRange::getCharRange(InitialLoc, S->getBeginLoc()),
SM, Context->getLangOpts())
.getBegin();
if (InitialLoc.isInvalid())
Modified: clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp Thu Aug 9 15:42:26 2018
@@ -201,12 +201,12 @@ void ContainerSizeEmptyCheck::check(cons
}
if (MemberCall) {
- diag(MemberCall->getLocStart(),
+ diag(MemberCall->getBeginLoc(),
"the 'empty' method should be used to check "
"for emptiness instead of 'size'")
<< Hint;
} else {
- diag(BinCmp->getLocStart(),
+ diag(BinCmp->getBeginLoc(),
"the 'empty' method should be used to check "
"for emptiness instead of comparing to an empty object")
<< Hint;
Modified: clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp Thu Aug 9 15:42:26 2018
@@ -55,14 +55,14 @@ void DeleteNullPointerCheck::check(const
const auto *Compound = Result.Nodes.getNodeAs<CompoundStmt>("compound");
auto Diag = diag(
- IfWithDelete->getLocStart(),
+ IfWithDelete->getBeginLoc(),
"'if' statement is unnecessary; deleting null pointer has no effect");
if (IfWithDelete->getElse())
return;
// FIXME: generate fixit for this case.
Diag << FixItHint::CreateRemoval(CharSourceRange::getTokenRange(
- IfWithDelete->getLocStart(),
+ IfWithDelete->getBeginLoc(),
Lexer::getLocForEndOfToken(IfWithDelete->getCond()->getLocEnd(), 0,
*Result.SourceManager,
Result.Context->getLangOpts())));
Modified: clang-tools-extra/trunk/clang-tidy/readability/DeletedDefaultCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/DeletedDefaultCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/DeletedDefaultCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/DeletedDefaultCheck.cpp Thu Aug 9 15:42:26 2018
@@ -41,7 +41,7 @@ void DeletedDefaultCheck::check(const Ma
"either be removed or explicitly deleted";
if (const auto *Constructor =
Result.Nodes.getNodeAs<CXXConstructorDecl>("constructor")) {
- auto Diag = diag(Constructor->getLocStart(), Message);
+ auto Diag = diag(Constructor->getBeginLoc(), Message);
if (Constructor->isDefaultConstructor()) {
Diag << "default constructor"
<< "a non-static data member or a base class is lacking a default "
@@ -56,7 +56,7 @@ void DeletedDefaultCheck::check(const Ma
}
} else if (const auto *Assignment =
Result.Nodes.getNodeAs<CXXMethodDecl>("method-decl")) {
- diag(Assignment->getLocStart(), Message)
+ diag(Assignment->getBeginLoc(), Message)
<< (Assignment->isCopyAssignmentOperator() ? "copy assignment operator"
: "move assignment operator")
<< "a base class or a non-static data member is not assignable, e.g. "
Modified: clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp Thu Aug 9 15:42:26 2018
@@ -73,7 +73,7 @@ public:
// is already nested NestingThreshold levels deep, record the start location
// of this new compound statement.
if (CurrentNestingLevel == Info.NestingThreshold)
- Info.NestingThresholders.push_back(Node->getLocStart());
+ Info.NestingThresholders.push_back(Node->getBeginLoc());
++CurrentNestingLevel;
Base::TraverseCompoundStmt(Node);
@@ -162,9 +162,9 @@ void FunctionSizeCheck::check(const Matc
// Count the lines including whitespace and comments. Really simple.
if (const Stmt *Body = Func->getBody()) {
SourceManager *SM = Result.SourceManager;
- if (SM->isWrittenInSameFile(Body->getLocStart(), Body->getLocEnd())) {
+ if (SM->isWrittenInSameFile(Body->getBeginLoc(), Body->getLocEnd())) {
FI.Lines = SM->getSpellingLineNumber(Body->getLocEnd()) -
- SM->getSpellingLineNumber(Body->getLocStart());
+ SM->getSpellingLineNumber(Body->getBeginLoc());
}
}
Modified: clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp Thu Aug 9 15:42:26 2018
@@ -841,7 +841,7 @@ void IdentifierNamingCheck::check(const
if (StringRef(Fixup).equals(Name)) {
if (!IgnoreFailedSplit) {
LLVM_DEBUG(llvm::dbgs()
- << Decl->getLocStart().printToString(*Result.SourceManager)
+ << Decl->getBeginLoc().printToString(*Result.SourceManager)
<< llvm::format(": unable to split words for %s '%s'\n",
KindName.c_str(), Name.str().c_str()));
}
Modified: clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp Thu Aug 9 15:42:26 2018
@@ -24,14 +24,14 @@ namespace {
AST_MATCHER(Stmt, isMacroExpansion) {
SourceManager &SM = Finder->getASTContext().getSourceManager();
- SourceLocation Loc = Node.getLocStart();
+ SourceLocation Loc = Node.getBeginLoc();
return SM.isMacroBodyExpansion(Loc) || SM.isMacroArgExpansion(Loc);
}
bool isNULLMacroExpansion(const Stmt *Statement, ASTContext &Context) {
SourceManager &SM = Context.getSourceManager();
const LangOptions &LO = Context.getLangOpts();
- SourceLocation Loc = Statement->getLocStart();
+ SourceLocation Loc = Statement->getBeginLoc();
return SM.isMacroBodyExpansion(Loc) &&
Lexer::getImmediateMacroName(Loc, SM, LO) == "NULL";
}
@@ -97,9 +97,9 @@ void fixGenericExprCastToBool(Diagnostic
bool InvertComparison =
Parent != nullptr && isUnaryLogicalNotOperator(Parent);
if (InvertComparison) {
- SourceLocation ParentStartLoc = Parent->getLocStart();
+ SourceLocation ParentStartLoc = Parent->getBeginLoc();
SourceLocation ParentEndLoc =
- cast<UnaryOperator>(Parent)->getSubExpr()->getLocStart();
+ cast<UnaryOperator>(Parent)->getSubExpr()->getBeginLoc();
Diag << FixItHint::CreateRemoval(
CharSourceRange::getCharRange(ParentStartLoc, ParentEndLoc));
@@ -122,7 +122,7 @@ void fixGenericExprCastToBool(Diagnostic
}
if (!StartLocInsertion.empty()) {
- Diag << FixItHint::CreateInsertion(Cast->getLocStart(), StartLocInsertion);
+ Diag << FixItHint::CreateInsertion(Cast->getBeginLoc(), StartLocInsertion);
}
std::string EndLocInsertion;
@@ -183,7 +183,7 @@ void fixGenericExprCastFromBool(Diagnost
bool NeedParens = !isa<ParenExpr>(SubExpr);
Diag << FixItHint::CreateInsertion(
- Cast->getLocStart(),
+ Cast->getBeginLoc(),
(Twine("static_cast<") + OtherType + ">" + (NeedParens ? "(" : ""))
.str());
@@ -354,7 +354,7 @@ void ImplicitBoolConversionCheck::handle
return;
}
- auto Diag = diag(Cast->getLocStart(), "implicit conversion %0 -> bool")
+ auto Diag = diag(Cast->getBeginLoc(), "implicit conversion %0 -> bool")
<< Cast->getSubExpr()->getType();
StringRef EquivalentLiteral =
@@ -371,7 +371,7 @@ void ImplicitBoolConversionCheck::handle
ASTContext &Context) {
QualType DestType =
NextImplicitCast ? NextImplicitCast->getType() : Cast->getType();
- auto Diag = diag(Cast->getLocStart(), "implicit conversion bool -> %0")
+ auto Diag = diag(Cast->getBeginLoc(), "implicit conversion bool -> %0")
<< DestType;
if (const auto *BoolLiteral =
Modified: clang-tools-extra/trunk/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp Thu Aug 9 15:42:26 2018
@@ -324,7 +324,7 @@ void InconsistentDeclarationParameterNam
return;
}
- SourceLocation StartLoc = OriginalDeclaration->getLocStart();
+ SourceLocation StartLoc = OriginalDeclaration->getBeginLoc();
if (StartLoc.isMacroID() && IgnoreMacros) {
markRedeclarationsAsVisited(OriginalDeclaration);
return;
Modified: clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp Thu Aug 9 15:42:26 2018
@@ -79,15 +79,15 @@ void MisleadingIndentationCheck::missing
if (isa<CompoundStmt>(Inner))
continue;
- SourceLocation InnerLoc = Inner->getLocStart();
- SourceLocation OuterLoc = CurrentStmt->getLocStart();
+ SourceLocation InnerLoc = Inner->getBeginLoc();
+ SourceLocation OuterLoc = CurrentStmt->getBeginLoc();
if (SM.getExpansionLineNumber(InnerLoc) ==
SM.getExpansionLineNumber(OuterLoc))
continue;
const Stmt *NextStmt = CStmt->body_begin()[i + 1];
- SourceLocation NextLoc = NextStmt->getLocStart();
+ SourceLocation NextLoc = NextStmt->getBeginLoc();
if (InnerLoc.isMacroID() || OuterLoc.isMacroID() || NextLoc.isMacroID())
continue;
Modified: clang-tools-extra/trunk/clang-tidy/readability/MisplacedArrayIndexCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/MisplacedArrayIndexCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/MisplacedArrayIndexCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/MisplacedArrayIndexCheck.cpp Thu Aug 9 15:42:26 2018
@@ -30,7 +30,7 @@ void MisplacedArrayIndexCheck::check(con
const auto *ArraySubscriptE =
Result.Nodes.getNodeAs<ArraySubscriptExpr>("expr");
- auto Diag = diag(ArraySubscriptE->getLocStart(), "confusing array subscript "
+ auto Diag = diag(ArraySubscriptE->getBeginLoc(), "confusing array subscript "
"expression, usually the "
"index is inside the []");
Modified: clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.cpp Thu Aug 9 15:42:26 2018
@@ -59,7 +59,7 @@ void NamedParameterCheck::check(const Ma
// Sanity check the source locations.
if (!Parm->getLocation().isValid() || Parm->getLocation().isMacroID() ||
- !SM.isWrittenInSameFile(Parm->getLocStart(), Parm->getLocation()))
+ !SM.isWrittenInSameFile(Parm->getBeginLoc(), Parm->getLocation()))
continue;
// Skip gmock testing::Unused parameters.
@@ -73,7 +73,7 @@ void NamedParameterCheck::check(const Ma
// Look for comments. We explicitly want to allow idioms like
// void foo(int /*unused*/)
- const char *Begin = SM.getCharacterData(Parm->getLocStart());
+ const char *Begin = SM.getCharacterData(Parm->getBeginLoc());
const char *End = SM.getCharacterData(Parm->getLocation());
StringRef Data(Begin, End - Begin);
if (Data.find("/*") != StringRef::npos)
Modified: clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp Thu Aug 9 15:42:26 2018
@@ -69,12 +69,12 @@ void NamespaceCommentCheck::check(const
const auto *ND = Result.Nodes.getNodeAs<NamespaceDecl>("namespace");
const SourceManager &Sources = *Result.SourceManager;
- if (!locationsInSameFile(Sources, ND->getLocStart(), ND->getRBraceLoc()))
+ if (!locationsInSameFile(Sources, ND->getBeginLoc(), ND->getRBraceLoc()))
return;
// Don't require closing comments for namespaces spanning less than certain
// number of lines.
- unsigned StartLine = Sources.getSpellingLineNumber(ND->getLocStart());
+ unsigned StartLine = Sources.getSpellingLineNumber(ND->getBeginLoc());
unsigned EndLine = Sources.getSpellingLineNumber(ND->getRBraceLoc());
if (EndLine - StartLine + 1 <= ShortNamespaceLines)
return;
Modified: clang-tools-extra/trunk/clang-tidy/readability/NonConstParameterCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/NonConstParameterCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/NonConstParameterCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/NonConstParameterCheck.cpp Thu Aug 9 15:42:26 2018
@@ -146,7 +146,7 @@ void NonConstParameterCheck::diagnoseNon
unsigned Index = Par->getFunctionScopeIndex();
for (FunctionDecl *FnDecl : Function->redecls())
Fixes.push_back(FixItHint::CreateInsertion(
- FnDecl->getParamDecl(Index)->getLocStart(), "const "));
+ FnDecl->getParamDecl(Index)->getBeginLoc(), "const "));
diag(Par->getLocation(), "pointer parameter '%0' can be pointer to const")
<< Par->getName() << Fixes;
Modified: clang-tools-extra/trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp Thu Aug 9 15:42:26 2018
@@ -59,7 +59,7 @@ void RedundantDeclarationCheck::check(co
if (const auto *VD = dyn_cast<VarDecl>(D)) {
// Is this a multivariable declaration?
for (const auto Other : VD->getDeclContext()->decls()) {
- if (Other != D && Other->getLocStart() == VD->getLocStart()) {
+ if (Other != D && Other->getBeginLoc() == VD->getBeginLoc()) {
MultiVar = true;
break;
}
Modified: clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp Thu Aug 9 15:42:26 2018
@@ -138,7 +138,7 @@ void RedundantSmartptrGetCheck::check(co
*Result.SourceManager, getLangOpts());
// Replace foo->get() with *foo, and foo.get() with foo.
std::string Replacement = Twine(IsPtrToPtr ? "*" : "", SmartptrText).str();
- diag(GetCall->getLocStart(), "redundant get() call on smart pointer")
+ diag(GetCall->getBeginLoc(), "redundant get() call on smart pointer")
<< FixItHint::CreateReplacement(GetCall->getSourceRange(), Replacement);
}
Modified: clang-tools-extra/trunk/clang-tidy/readability/RedundantStringCStrCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/RedundantStringCStrCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/RedundantStringCStrCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/RedundantStringCStrCheck.cpp Thu Aug 9 15:42:26 2018
@@ -189,7 +189,7 @@ void RedundantStringCStrCheck::check(con
if (ArgText.empty())
return;
- diag(Call->getLocStart(), "redundant call to %0")
+ diag(Call->getBeginLoc(), "redundant call to %0")
<< Member->getMemberDecl()
<< FixItHint::CreateReplacement(Call->getSourceRange(), ArgText);
}
Modified: clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp Thu Aug 9 15:42:26 2018
@@ -62,7 +62,7 @@ const char SimplifyConditionalReturnDiag
const CXXBoolLiteralExpr *getBoolLiteral(const MatchFinder::MatchResult &Result,
StringRef Id) {
const auto *Literal = Result.Nodes.getNodeAs<CXXBoolLiteralExpr>(Id);
- return (Literal && Literal->getLocStart().isMacroID()) ? nullptr : Literal;
+ return (Literal && Literal->getBeginLoc().isMacroID()) ? nullptr : Literal;
}
internal::Matcher<Stmt> returnsBool(bool Value, StringRef Id = "ignored") {
@@ -372,7 +372,7 @@ void SimplifyBooleanExprCheck::reportBin
else
return;
- if (Bool->getLocStart().isMacroID())
+ if (Bool->getBeginLoc().isMacroID())
return;
// FIXME: why do we need this?
@@ -385,8 +385,8 @@ void SimplifyBooleanExprCheck::reportBin
const Expr *ReplaceWith, bool Negated) {
std::string Replacement =
replacementExpression(Result, Negated, ReplaceWith);
- SourceRange Range(LHS->getLocStart(), RHS->getLocEnd());
- issueDiag(Result, Bool->getLocStart(), SimplifyOperatorDiagnostic, Range,
+ SourceRange Range(LHS->getBeginLoc(), RHS->getLocEnd());
+ issueDiag(Result, Bool->getBeginLoc(), SimplifyOperatorDiagnostic, Range,
Replacement);
};
@@ -577,7 +577,7 @@ void SimplifyBooleanExprCheck::replaceWi
const MatchFinder::MatchResult &Result,
const CXXBoolLiteralExpr *TrueConditionRemoved) {
const auto *IfStatement = Result.Nodes.getNodeAs<IfStmt>(IfStmtId);
- issueDiag(Result, TrueConditionRemoved->getLocStart(),
+ issueDiag(Result, TrueConditionRemoved->getBeginLoc(),
SimplifyConditionDiagnostic, IfStatement->getSourceRange(),
getText(Result, *IfStatement->getThen()));
}
@@ -587,7 +587,7 @@ void SimplifyBooleanExprCheck::replaceWi
const CXXBoolLiteralExpr *FalseConditionRemoved) {
const auto *IfStatement = Result.Nodes.getNodeAs<IfStmt>(IfStmtId);
const Stmt *ElseStatement = IfStatement->getElse();
- issueDiag(Result, FalseConditionRemoved->getLocStart(),
+ issueDiag(Result, FalseConditionRemoved->getBeginLoc(),
SimplifyConditionDiagnostic, IfStatement->getSourceRange(),
ElseStatement ? getText(Result, *ElseStatement) : "");
}
@@ -597,7 +597,7 @@ void SimplifyBooleanExprCheck::replaceWi
bool Negated) {
std::string Replacement =
replacementExpression(Result, Negated, Ternary->getCond());
- issueDiag(Result, Ternary->getTrueExpr()->getLocStart(),
+ issueDiag(Result, Ternary->getTrueExpr()->getBeginLoc(),
"redundant boolean literal in ternary expression result",
Ternary->getSourceRange(), Replacement);
}
@@ -608,7 +608,7 @@ void SimplifyBooleanExprCheck::replaceWi
std::string Condition = replacementExpression(Result, Negated, If->getCond());
std::string Replacement = ("return " + Condition + Terminator).str();
SourceLocation Start =
- Result.Nodes.getNodeAs<CXXBoolLiteralExpr>(ThenLiteralId)->getLocStart();
+ Result.Nodes.getNodeAs<CXXBoolLiteralExpr>(ThenLiteralId)->getBeginLoc();
issueDiag(Result, Start, SimplifyConditionalReturnDiagnostic,
If->getSourceRange(), Replacement);
}
@@ -640,8 +640,8 @@ void SimplifyBooleanExprCheck::replaceCo
std::string Replacement =
"return " + replacementExpression(Result, Negated, Condition);
issueDiag(
- Result, Lit->getLocStart(), SimplifyConditionalReturnDiagnostic,
- SourceRange(If->getLocStart(), Ret->getLocEnd()), Replacement);
+ Result, Lit->getBeginLoc(), SimplifyConditionalReturnDiagnostic,
+ SourceRange(If->getBeginLoc(), Ret->getLocEnd()), Replacement);
return;
}
@@ -665,7 +665,7 @@ void SimplifyBooleanExprCheck::replaceWi
std::string Replacement =
(VariableName + " = " + Condition + Terminator).str();
SourceLocation Location =
- Result.Nodes.getNodeAs<CXXBoolLiteralExpr>(IfAssignLocId)->getLocStart();
+ Result.Nodes.getNodeAs<CXXBoolLiteralExpr>(IfAssignLocId)->getBeginLoc();
issueDiag(Result, Location,
"redundant boolean literal in conditional assignment", Range,
Replacement);
Modified: clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp Thu Aug 9 15:42:26 2018
@@ -60,7 +60,7 @@ void SimplifySubscriptExprCheck::check(c
"accessing an element of the container does not require a call to "
"'data()'; did you mean to use 'operator[]'?");
if (Member->isArrow())
- DiagBuilder << FixItHint::CreateInsertion(Member->getLocStart(), "(*")
+ DiagBuilder << FixItHint::CreateInsertion(Member->getBeginLoc(), "(*")
<< FixItHint::CreateInsertion(Member->getOperatorLoc(), ")");
DiagBuilder << FixItHint::CreateRemoval(
{Member->getOperatorLoc(), Call->getLocEnd()});
Modified: clang-tools-extra/trunk/clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp Thu Aug 9 15:42:26 2018
@@ -51,7 +51,7 @@ void StaticAccessedThroughInstanceCheck:
const auto *MemberExpression =
Result.Nodes.getNodeAs<MemberExpr>("memberExpression");
- if (MemberExpression->getLocStart().isMacroID())
+ if (MemberExpression->getBeginLoc().isMacroID())
return;
const Expr *BaseExpr = MemberExpression->getBase();
@@ -71,7 +71,7 @@ void StaticAccessedThroughInstanceCheck:
std::string BaseTypeName =
BaseType.getAsString(PrintingPolicyWithSupressedTag);
- SourceLocation MemberExprStartLoc = MemberExpression->getLocStart();
+ SourceLocation MemberExprStartLoc = MemberExpression->getBeginLoc();
auto Diag =
diag(MemberExprStartLoc, "static member accessed through instance");
Modified: clang-tools-extra/trunk/clang-tidy/readability/StringCompareCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/StringCompareCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/StringCompareCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/StringCompareCheck.cpp Thu Aug 9 15:42:26 2018
@@ -51,7 +51,7 @@ void StringCompareCheck::registerMatcher
void StringCompareCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *Matched = Result.Nodes.getNodeAs<Stmt>("match1")) {
- diag(Matched->getLocStart(), CompareMessage);
+ diag(Matched->getBeginLoc(), CompareMessage);
return;
}
@@ -63,10 +63,10 @@ void StringCompareCheck::check(const Mat
const auto *Str2 = Result.Nodes.getNodeAs<Stmt>("str2");
const auto *Compare = Result.Nodes.getNodeAs<Stmt>("compare");
- auto Diag = diag(Matched->getLocStart(), CompareMessage);
+ auto Diag = diag(Matched->getBeginLoc(), CompareMessage);
if (Str1->isArrow())
- Diag << FixItHint::CreateInsertion(Str1->getLocStart(), "*");
+ Diag << FixItHint::CreateInsertion(Str1->getBeginLoc(), "*");
Diag << tooling::fixit::createReplacement(*Zero, *Str2, Ctx)
<< tooling::fixit::createReplacement(*Compare, *Str1->getBase(),
Modified: clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp Thu Aug 9 15:42:26 2018
@@ -42,7 +42,7 @@ void UniqueptrDeleteReleaseCheck::check(
const auto *PtrExpr = Result.Nodes.getNodeAs<Expr>("uptr");
const auto *DeleteExpr = Result.Nodes.getNodeAs<Expr>("delete");
- if (PtrExpr->getLocStart().isMacroID())
+ if (PtrExpr->getBeginLoc().isMacroID())
return;
// Ignore dependent types.
@@ -54,11 +54,11 @@ void UniqueptrDeleteReleaseCheck::check(
SourceLocation AfterPtr = Lexer::getLocForEndOfToken(
PtrExpr->getLocEnd(), 0, *Result.SourceManager, getLangOpts());
- diag(DeleteExpr->getLocStart(),
+ diag(DeleteExpr->getBeginLoc(),
"prefer '= nullptr' to 'delete x.release()' to reset unique_ptr<> "
"objects")
<< FixItHint::CreateRemoval(CharSourceRange::getCharRange(
- DeleteExpr->getLocStart(), PtrExpr->getLocStart()))
+ DeleteExpr->getBeginLoc(), PtrExpr->getBeginLoc()))
<< FixItHint::CreateReplacement(
CharSourceRange::getTokenRange(AfterPtr, DeleteExpr->getLocEnd()),
" = nullptr");
Modified: clang-tools-extra/trunk/clang-tidy/utils/ASTUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/utils/ASTUtils.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/utils/ASTUtils.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/utils/ASTUtils.cpp Thu Aug 9 15:42:26 2018
@@ -45,8 +45,8 @@ bool exprHasBitFlagWithSpelling(const Ex
StringRef FlagName) {
// If the Flag is an integer constant, check it.
if (isa<IntegerLiteral>(Flags)) {
- if (!SM.isMacroBodyExpansion(Flags->getLocStart()) &&
- !SM.isMacroArgExpansion(Flags->getLocStart()))
+ if (!SM.isMacroBodyExpansion(Flags->getBeginLoc()) &&
+ !SM.isMacroArgExpansion(Flags->getBeginLoc()))
return false;
// Get the macro name.
Modified: clang-tools-extra/trunk/clang-tidy/utils/NamespaceAliaser.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/utils/NamespaceAliaser.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/utils/NamespaceAliaser.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/utils/NamespaceAliaser.cpp Thu Aug 9 15:42:26 2018
@@ -70,7 +70,7 @@ NamespaceAliaser::createAlias(ASTContext
(llvm::Twine("\nnamespace ") + Abbreviation + " = " + Namespace + ";")
.str();
SourceLocation Loc =
- Lexer::getLocForEndOfToken(Function->getBody()->getLocStart(), 0,
+ Lexer::getLocForEndOfToken(Function->getBody()->getBeginLoc(), 0,
SourceMgr, Context.getLangOpts());
AddedAliases[Function][Namespace.str()] = Abbreviation;
return FixItHint::CreateInsertion(Loc, Declaration);
Modified: clang-tools-extra/trunk/clang-tidy/utils/UsingInserter.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/utils/UsingInserter.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/utils/UsingInserter.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/utils/UsingInserter.cpp Thu Aug 9 15:42:26 2018
@@ -41,7 +41,7 @@ Optional<FixItHint> UsingInserter::creat
return None;
SourceLocation InsertLoc = Lexer::getLocForEndOfToken(
- Function->getBody()->getLocStart(), 0, SourceMgr, Context.getLangOpts());
+ Function->getBody()->getBeginLoc(), 0, SourceMgr, Context.getLangOpts());
// Only use using declarations in the main file, not in includes.
if (SourceMgr.getFileID(InsertLoc) != SourceMgr.getMainFileID())
Modified: clang-tools-extra/trunk/clangd/CodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/CodeComplete.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/CodeComplete.cpp (original)
+++ clang-tools-extra/trunk/clangd/CodeComplete.cpp Thu Aug 9 15:42:26 2018
@@ -235,7 +235,7 @@ struct CompletionCandidate {
// file e.g. the symbol is forward declared.
auto &SM = SemaResult->Declaration->getASTContext().getSourceManager();
for (const Decl *RD : SemaResult->Declaration->redecls())
- if (SM.isInMainFile(SM.getExpansionLoc(RD->getLocStart())))
+ if (SM.isInMainFile(SM.getExpansionLoc(RD->getBeginLoc())))
return llvm::None;
}
return IndexResult->Detail->IncludeHeader;
Modified: clang-tools-extra/trunk/clangd/CodeCompletionStrings.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/CodeCompletionStrings.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/CodeCompletionStrings.cpp (original)
+++ clang-tools-extra/trunk/clangd/CodeCompletionStrings.cpp Thu Aug 9 15:42:26 2018
@@ -65,7 +65,7 @@ std::string getDocComment(const ASTConte
// Sanity check that the comment does not come from the PCH. We choose to not
// write them into PCH, because they are racy and slow to load.
- assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getLocStart()));
+ assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));
std::string Doc = RC->getFormattedText(Ctx.getSourceManager(), Ctx.getDiagnostics());
if (!looksLikeDocComment(Doc))
return "";
@@ -84,7 +84,7 @@ getParameterDocComment(const ASTContext
return "";
// Sanity check that the comment does not come from the PCH. We choose to not
// write them into PCH, because they are racy and slow to load.
- assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getLocStart()));
+ assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));
std::string Doc = RC->getFormattedText(Ctx.getSourceManager(), Ctx.getDiagnostics());
if (!looksLikeDocComment(Doc))
return "";
Modified: clang-tools-extra/trunk/clangd/XRefs.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/XRefs.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/XRefs.cpp (original)
+++ clang-tools-extra/trunk/clangd/XRefs.cpp Thu Aug 9 15:42:26 2018
@@ -540,7 +540,7 @@ public:
//- auto& i = 1;
bool VisitDeclaratorDecl(DeclaratorDecl *D) {
if (!D->getTypeSourceInfo() ||
- D->getTypeSourceInfo()->getTypeLoc().getLocStart() != SearchedLocation)
+ D->getTypeSourceInfo()->getTypeLoc().getBeginLoc() != SearchedLocation)
return true;
auto DeclT = D->getType();
Modified: clang-tools-extra/trunk/tool-template/ToolTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/tool-template/ToolTemplate.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/tool-template/ToolTemplate.cpp (original)
+++ clang-tools-extra/trunk/tool-template/ToolTemplate.cpp Thu Aug 9 15:42:26 2018
@@ -66,8 +66,8 @@ public:
auto *D = Result.Nodes.getNodeAs<NamedDecl>("decl");
assert(D);
// Use AtomicChange to get a key.
- if (D->getLocStart().isValid()) {
- AtomicChange Change(*Result.SourceManager, D->getLocStart());
+ if (D->getBeginLoc().isValid()) {
+ AtomicChange Change(*Result.SourceManager, D->getBeginLoc());
Context.reportResult(Change.getKey(), D->getQualifiedNameAsString());
}
}
Modified: clang-tools-extra/trunk/unittests/clang-tidy/IncludeInserterTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/IncludeInserterTest.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-tidy/IncludeInserterTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-tidy/IncludeInserterTest.cpp Thu Aug 9 15:42:26 2018
@@ -45,7 +45,7 @@ public:
}
void check(const ast_matchers::MatchFinder::MatchResult &Result) override {
- auto Diag = diag(Result.Nodes.getNodeAs<DeclStmt>("stmt")->getLocStart(),
+ auto Diag = diag(Result.Nodes.getNodeAs<DeclStmt>("stmt")->getBeginLoc(),
"foo, bar");
for (StringRef header : HeadersToInclude()) {
auto Fixit = Inserter->CreateIncludeInsertion(
Modified: clang-tools-extra/trunk/unittests/clang-tidy/NamespaceAliaserTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/NamespaceAliaserTest.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-tidy/NamespaceAliaserTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-tidy/NamespaceAliaserTest.cpp Thu Aug 9 15:42:26 2018
@@ -36,13 +36,11 @@ public:
auto Hint = Aliaser->createAlias(*Result.Context, *Call, "::foo::bar",
{"b", "some_alias"});
if (Hint.hasValue())
- diag(Call->getLocStart(), "Fix for testing") << Hint.getValue();
+ diag(Call->getBeginLoc(), "Fix for testing") << Hint.getValue();
- diag(Call->getLocStart(), "insert call")
- << FixItHint::CreateInsertion(
- Call->getLocStart(),
- Aliaser->getNamespaceName(*Result.Context, *Call, "::foo::bar") +
- "::");
+ diag(Call->getBeginLoc(), "insert call") << FixItHint::CreateInsertion(
+ Call->getBeginLoc(),
+ Aliaser->getNamespaceName(*Result.Context, *Call, "::foo::bar") + "::");
}
private:
Modified: clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp Thu Aug 9 15:42:26 2018
@@ -33,8 +33,8 @@ public:
}
void check(const ast_matchers::MatchFinder::MatchResult &Result) override {
auto *VD = Result.Nodes.getNodeAs<VarDecl>(BoundDecl);
- diag(VD->getLocStart(), "use char") << FixItHint::CreateReplacement(
- CharSourceRange::getTokenRange(VD->getLocStart(), VD->getLocStart()),
+ diag(VD->getBeginLoc(), "use char") << FixItHint::CreateReplacement(
+ CharSourceRange::getTokenRange(VD->getBeginLoc(), VD->getBeginLoc()),
"char");
}
};
@@ -52,7 +52,7 @@ public:
auto *Cond = If->getCond();
SourceRange Range = Cond->getSourceRange();
if (auto *D = If->getConditionVariable()) {
- Range = SourceRange(D->getLocStart(), D->getLocEnd());
+ Range = SourceRange(D->getBeginLoc(), D->getLocEnd());
}
diag(Range.getBegin(), "the cake is a lie") << FixItHint::CreateReplacement(
CharSourceRange::getTokenRange(Range), "false");
Modified: clang-tools-extra/trunk/unittests/clang-tidy/UsingInserterTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/UsingInserterTest.cpp?rev=339400&r1=339399&r2=339400&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-tidy/UsingInserterTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-tidy/UsingInserterTest.cpp Thu Aug 9 15:42:26 2018
@@ -39,9 +39,9 @@ public:
Inserter->createUsingDeclaration(*Result.Context, *Call, "::foo::func");
if (Hint.hasValue())
- diag(Call->getLocStart(), "Fix for testing") << Hint.getValue();
+ diag(Call->getBeginLoc(), "Fix for testing") << Hint.getValue();
- diag(Call->getLocStart(), "insert call")
+ diag(Call->getBeginLoc(), "insert call")
<< clang::FixItHint::CreateReplacement(
Call->getCallee()->getSourceRange(),
Inserter->getShortName(*Result.Context, *Call, "::foo::func"));
More information about the cfe-commits
mailing list