19 const auto &SourceManager = Context.getSourceManager();
21 Token.setKind(tok::unknown);
22 Location = Location.getLocWithOffset(-1);
24 SourceManager.getLocForStartOfFile(SourceManager.getFileID(Location));
25 while (Location != StartOfFile) {
26 Location = Lexer::GetBeginningOfToken(Location, SourceManager,
27 Context.getLangOpts());
28 if (!Lexer::getRawToken(Location, Token, SourceManager,
29 Context.getLangOpts()) &&
30 !Token.is(tok::comment)) {
33 Location = Location.getLocWithOffset(-1);
ClangTidyContext & Context
Token getPreviousNonCommentToken(const ASTContext &Context, SourceLocation Location)
Returns previous non-comment token skipping over any comment text or tok::unknown if not found...