clang-tools  16.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 
16 namespace clang {
17 namespace tooling {
18 struct Diagnostic;
19 } // namespace tooling
20 } // namespace clang
21 
22 namespace llvm {
23 template <typename T> class SmallVectorImpl;
24 } // namespace llvm
25 
26 namespace clang {
27 namespace tidy {
28 
29 /// This class is used to locate NOLINT comments in the file being analyzed, to
30 /// decide whether a diagnostic should be suppressed.
31 /// This class keeps a cache of every NOLINT comment found so that files do not
32 /// have to be repeatedly parsed each time a new diagnostic is raised.
34 public:
37 
38  bool shouldSuppress(DiagnosticsEngine::Level DiagLevel,
39  const Diagnostic &Diag, llvm::StringRef DiagName,
41  bool AllowIO, bool EnableNoLintBlocks);
42 
43 private:
44  class Impl;
45  std::unique_ptr<Impl> PImpl;
46 };
47 
48 } // namespace tidy
49 } // namespace clang
50 
51 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_NOLINTDIRECTIVEHANDLER_H
clang::tidy::NoLintDirectiveHandler::Impl
Definition: NoLintDirectiveHandler.cpp:219
llvm
Some operations such as code completion produce a set of candidates.
Definition: YAMLGenerator.cpp:31
clang::tidy::NoLintDirectiveHandler::~NoLintDirectiveHandler
~NoLintDirectiveHandler()
clang::tidy::NoLintDirectiveHandler::shouldSuppress
bool shouldSuppress(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Diag, llvm::StringRef DiagName, llvm::SmallVectorImpl< tooling::Diagnostic > &NoLintErrors, bool AllowIO, bool EnableNoLintBlocks)
Definition: NoLintDirectiveHandler.cpp:406
Diagnostic
DiagnosticCallback Diagnostic
Definition: ConfigCompile.cpp:100
clang::tidy::NoLintDirectiveHandler
This class is used to locate NOLINT comments in the file being analyzed, to decide whether a diagnost...
Definition: NoLintDirectiveHandler.h:33
clang::tidy::NoLintDirectiveHandler::NoLintDirectiveHandler
NoLintDirectiveHandler()
Definition: NoLintDirectiveHandler.cpp:401
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ApplyReplacements.h:27
llvm::SmallVectorImpl
Definition: NoLintDirectiveHandler.h:23