clang  16.0.0git
NoopLattice.h
Go to the documentation of this file.
1 //===-- NoopLattice.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 the lattice with exactly one element.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_NOOP_LATTICE_H
14 #define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_NOOP_LATTICE_H
15 
17 #include <ostream>
18 
19 namespace clang {
20 namespace dataflow {
21 
22 /// Trivial lattice for dataflow analysis with exactly one element.
23 ///
24 /// Useful for analyses that only need the Environment and nothing more.
25 class NoopLattice {
26 public:
27  bool operator==(const NoopLattice &Other) const { return true; }
28 
31  }
32 };
33 
34 inline std::ostream &operator<<(std::ostream &OS, const NoopLattice &) {
35  return OS << "noop";
36 }
37 
38 } // namespace dataflow
39 } // namespace clang
40 
41 #endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_NOOP_LATTICE_H
clang::dataflow::NoopLattice::join
LatticeJoinEffect join(const NoopLattice &Other)
Definition: NoopLattice.h:29
clang::dataflow::operator<<
std::ostream & operator<<(std::ostream &Os, const clang::dataflow::MapLattice< Key, ElementLattice > &M)
Definition: MapLattice.h:116
clang::dataflow::LatticeJoinEffect
LatticeJoinEffect
Effect indicating whether a lattice join operation resulted in a new value.
Definition: DataflowLattice.h:23
clang::dataflow::NoopLattice::operator==
bool operator==(const NoopLattice &Other) const
Definition: NoopLattice.h:27
DataflowLattice.h
clang::dataflow::NoopLattice
Trivial lattice for dataflow analysis with exactly one element.
Definition: NoopLattice.h:25
clang
Definition: CalledOnceCheck.h:17
clang::dataflow::LatticeJoinEffect::Unchanged
@ Unchanged