summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
diff options
context:
space:
mode:
authorJonas Toth <jonas.toth@gmail.com>2018-10-05 14:15:19 +0000
committerJonas Toth <jonas.toth@gmail.com>2018-10-05 14:15:19 +0000
commita78c249af6bed83854d28449c4763ad1fd22806e (patch)
treefae17e5712cadc974836eda0c0a04af8dc49f151 /clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
parent5fb9746c49d60a51c95a3ffcb183531a64c2ffb8 (diff)
downloadbcm5719-llvm-a78c249af6bed83854d28449c4763ad1fd22806e.tar.gz
bcm5719-llvm-a78c249af6bed83854d28449c4763ad1fd22806e.zip
[clang-tidy] NFC refactor lexer-utils to be usable without ASTContext
Summary: This patch is a small refactoring necessary for 'readability-isolate-declaration' and does not introduce functional changes. It allows to use the utility functions without a full `ASTContext` and requires only the `SourceManager` and the `LangOpts`. Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52684 llvm-svn: 343850
Diffstat (limited to 'clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
index 068f2c57d03..62f30f79b31 100644
--- a/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
@@ -91,8 +91,9 @@ static std::vector<std::pair<SourceLocation, StringRef>>
getCommentsBeforeLoc(ASTContext *Ctx, SourceLocation Loc) {
std::vector<std::pair<SourceLocation, StringRef>> Comments;
while (Loc.isValid()) {
- clang::Token Tok =
- utils::lexer::getPreviousToken(*Ctx, Loc, /*SkipComments=*/false);
+ clang::Token Tok = utils::lexer::getPreviousToken(
+ Loc, Ctx->getSourceManager(), Ctx->getLangOpts(),
+ /*SkipComments=*/false);
if (Tok.isNot(tok::comment))
break;
Loc = Tok.getLocation();
OpenPOWER on IntegriCloud