diff options
| author | Jonas Toth <jonas.toth@gmail.com> | 2018-10-05 14:15:19 +0000 |
|---|---|---|
| committer | Jonas Toth <jonas.toth@gmail.com> | 2018-10-05 14:15:19 +0000 |
| commit | a78c249af6bed83854d28449c4763ad1fd22806e (patch) | |
| tree | fae17e5712cadc974836eda0c0a04af8dc49f151 /clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp | |
| parent | 5fb9746c49d60a51c95a3ffcb183531a64c2ffb8 (diff) | |
| download | bcm5719-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.cpp | 5 |
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(); |

