clang-tools 20.0.0git
NoLintDirectiveHandler.h
Go to the documentation of this file.
1//===-- clang-tools-extra/clang-tidy/NoLintDirectiveHandler.h ----*- C++ *-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_NOLINTDIRECTIVEHANDLER_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_NOLINTDIRECTIVEHANDLER_H
11
12#include "clang/Basic/Diagnostic.h"
13#include "llvm/ADT/StringRef.h"
14#include <memory>
15
16namespace clang::tooling {
17struct Diagnostic;
18} // namespace clang::tooling
19
20namespace llvm {
21template <typename T> class SmallVectorImpl;
22} // namespace llvm
23
24namespace clang::tidy {
25
26/// This class is used to locate NOLINT comments in the file being analyzed, to
27/// decide whether a diagnostic should be suppressed.
28/// This class keeps a cache of every NOLINT comment found so that files do not
29/// have to be repeatedly parsed each time a new diagnostic is raised.
31public:
34
35 bool shouldSuppress(DiagnosticsEngine::Level DiagLevel,
36 const Diagnostic &Diag, llvm::StringRef DiagName,
38 bool AllowIO, bool EnableNoLintBlocks);
39
40private:
41 class Impl;
42 std::unique_ptr<Impl> PImpl;
43};
44
45} // namespace clang::tidy
46
47#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_NOLINTDIRECTIVEHANDLER_H
DiagnosticCallback Diagnostic
This class is used to locate NOLINT comments in the file being analyzed, to decide whether a diagnost...
bool shouldSuppress(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Diag, llvm::StringRef DiagName, llvm::SmallVectorImpl< tooling::Diagnostic > &NoLintErrors, bool AllowIO, bool EnableNoLintBlocks)
Some operations such as code completion produce a set of candidates.