[PATCH] D116085: [clang-tidy] Performance improvements for NOLINTBEGIN/END blocks
Salman Javed via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 23 02:42:35 PST 2022
salman-javed-nz marked an inline comment as done.
salman-javed-nz added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:448
+/// this line.
+static std::pair<size_t, size_t> getLineStartAndEnd(StringRef S, size_t From) {
+ size_t StartPos = S.find_last_of('\n', From) + 1;
----------------
carlosgalvezp wrote:
> Don't we usually use `SourceLocation` objects for this?
> Don't we usually use `SourceLocation` objects for this?
Considering that we're working with a string buffer of the file contents, I think using buffer indices of type size_t is appropriate.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116085/new/
https://reviews.llvm.org/D116085
More information about the cfe-commits
mailing list