clang  19.0.0git
ChromiumCheckModel.h
Go to the documentation of this file.
1 //===-- ChromiumCheckModel.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 // This file defines a dataflow model for Chromium's family of CHECK functions.
10 //
11 //===----------------------------------------------------------------------===//
12 #ifndef CLANG_ANALYSIS_FLOWSENSITIVE_MODELS_CHROMIUMCHECKMODEL_H
13 #define CLANG_ANALYSIS_FLOWSENSITIVE_MODELS_CHROMIUMCHECKMODEL_H
14 
15 #include "clang/AST/DeclCXX.h"
18 #include "llvm/ADT/DenseSet.h"
19 
20 namespace clang {
21 namespace dataflow {
22 
23 /// Models the behavior of Chromium's CHECK, DCHECK, etc. macros, so that code
24 /// after a call to `*CHECK` can rely on the condition being true.
26 public:
27  ChromiumCheckModel() = default;
28  bool transfer(const CFGElement &Element, Environment &Env) override;
29 
30 private:
31  /// Declarations for `::logging::CheckError::.*Check`, lazily initialized.
32  llvm::SmallDenseSet<const CXXMethodDecl *> CheckDecls;
33 };
34 
35 } // namespace dataflow
36 } // namespace clang
37 
38 #endif // CLANG_ANALYSIS_FLOWSENSITIVE_MODELS_CHROMIUMCHECKMODEL_H
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
const Environment & Env
Definition: HTMLLogger.cpp:148
Represents a top-level expression in a basic block.
Definition: CFG.h:55
Models the behavior of Chromium's CHECK, DCHECK, etc.
bool transfer(const CFGElement &Element, Environment &Env) override
Return value indicates whether the model processed the Element.
Abstract base class for dataflow "models": reusable analysis components that model a particular aspec...
Holds the state of the program (store and heap) at a given program point.
The JSON file list parser is used to communicate input to InstallAPI.