xref: /freebsd/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h (revision 0eae32dcef82f6f06de6419a0d623d7def0cc8f6)
1 //===-- DataflowEnvironment.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 an Environment class that is used by dataflow analyses
10 //  that run over Control-Flow Graphs (CFGs) to keep track of the state of the
11 //  program at given program points.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_DATAFLOWENVIRONMENT_H
16 #define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_DATAFLOWENVIRONMENT_H
17 
18 #include "clang/Analysis/FlowSensitive/DataflowLattice.h"
19 
20 namespace clang {
21 namespace dataflow {
22 
23 /// Holds the state of the program (store and heap) at a given program point.
24 class Environment {
25 public:
26   bool operator==(const Environment &) const { return true; }
27 
28   LatticeJoinEffect join(const Environment &) {
29     return LatticeJoinEffect::Unchanged;
30   }
31 };
32 
33 } // namespace dataflow
34 } // namespace clang
35 
36 #endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_DATAFLOWENVIRONMENT_H
37