[clang-tidy] Cache the locations of NOLINTBEGIN/END blocks
Support for NOLINT(BEGIN/END) blocks (implemented in D108560) is currently costly. This patch aims to improve the performance with the following changes: - The use of tokenized NOLINTs instead of a series of repetitive ad-hoc string operations (`find()`, `split()`, `slice()`, regex matching etc). - The caching of NOLINT(BEGIN/END) block locations. Determining these locations each time a new diagnostic is raised is wasteful as it requires reading and parsing the entire source file. Move NOLINT-specific code from `ClangTidyDiagnosticConsumer` to new purpose-built class `NoLintDirectiveHandler`. Differential Revision: https://reviews.llvm.org/D116085
Loading
Please sign in to comment