File indexing completed on 2026-05-10 08:37:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_CLANG_STATICANALYZER_CORE_BUGREPORTER_SUPPRESSION_H
0015 #define LLVM_CLANG_STATICANALYZER_CORE_BUGREPORTER_SUPPRESSION_H
0016
0017 #include "clang/Basic/SourceLocation.h"
0018 #include "llvm/ADT/DenseMap.h"
0019 #include "llvm/ADT/SmallVector.h"
0020
0021 namespace clang {
0022 class ASTContext;
0023 class Decl;
0024
0025 namespace ento {
0026 class BugReport;
0027 class PathDiagnosticLocation;
0028
0029 class BugSuppression {
0030 public:
0031 explicit BugSuppression(const ASTContext &ACtx) : ACtx(ACtx) {}
0032
0033 using DiagnosticIdentifierList = llvm::ArrayRef<llvm::StringRef>;
0034
0035
0036 bool isSuppressed(const BugReport &);
0037
0038
0039
0040 bool isSuppressed(const PathDiagnosticLocation &Location,
0041 const Decl *DeclWithIssue,
0042 DiagnosticIdentifierList DiagnosticIdentification);
0043
0044 private:
0045
0046 static constexpr unsigned EXPECTED_NUMBER_OF_SUPPRESSIONS = 8;
0047 using CachedRanges =
0048 llvm::SmallVector<SourceRange, EXPECTED_NUMBER_OF_SUPPRESSIONS>;
0049
0050 llvm::DenseMap<const Decl *, CachedRanges> CachedSuppressionLocations;
0051
0052 const ASTContext &ACtx;
0053 };
0054
0055 }
0056 }
0057
0058 #endif