clang 20.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
18#include "llvm/ADT/Any.h"
19#include <ostream>
20
21namespace clang {
22namespace dataflow {
23
24/// Trivial lattice for dataflow analysis with exactly one element.
25///
26/// Useful for analyses that only need the Environment and nothing more.
28public:
29 bool operator==(const NoopLattice &Other) const { return true; }
30
33 }
34};
35
36inline std::ostream &operator<<(std::ostream &OS, const NoopLattice &) {
37 return OS << "noop";
38}
39
40} // namespace dataflow
41} // namespace clang
42
43namespace llvm {
44// This needs to be exported for ClangAnalysisFlowSensitiveTests so any_cast
45// uses the correct address of Any::TypeId from the clang shared library instead
46// of creating one in the test executable. when building with
47// CLANG_LINK_CLANG_DYLIB
48extern template struct CLANG_TEMPLATE_ABI
49 Any::TypeId<clang::dataflow::NoopLattice>;
50} // namespace llvm
51
52#endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_NOOP_LATTICE_H
Trivial lattice for dataflow analysis with exactly one element.
Definition: NoopLattice.h:27
LatticeJoinEffect join(const NoopLattice &Other)
Definition: NoopLattice.h:31
bool operator==(const NoopLattice &Other) const
Definition: NoopLattice.h:29
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, Atom A)
Definition: Formula.h:125
LatticeEffect
Effect indicating whether a lattice operation resulted in a new value.
The JSON file list parser is used to communicate input to InstallAPI.
@ Other
Other implicit parameter.
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30