clang 23.0.0git
PointerFlow.h
Go to the documentation of this file.
1//===- PointerFlow.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 analysis that builds directed graphs where nodes
10// are pointers and edges are assignment operations, each of which bridges two
11// nodes.
12//
13//===----------------------------------------------------------------------===//
14#ifndef LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_POINTERFLOW_POINTERFLOW_H
15#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_POINTERFLOW_POINTERFLOW_H
16
19
20namespace clang::ssaf {
21
22/// Maps each source node to its destination nodes:
23using EdgeSet = std::map<EntityPointerLevel, EntityPointerLevelSet>;
24
25class PointerFlowEntitySummary final : public EntitySummary {
26 EdgeSet Edges;
27
28 friend PointerFlowEntitySummary buildPointerFlowEntitySummary(EdgeSet Edges);
29 friend llvm::iterator_range<EdgeSet::const_iterator>
30 getEdges(const PointerFlowEntitySummary &);
31
32 explicit PointerFlowEntitySummary(EdgeSet Edges) : Edges(std::move(Edges)) {}
33
34public:
35 static constexpr llvm::StringLiteral Name = "PointerFlow";
36
37 SummaryName getSummaryName() const override { return summaryName(); }
38
39 bool operator==(const EdgeSet &Other) const { return Edges == Other; }
40
41 bool operator==(const PointerFlowEntitySummary &Other) const {
42 return Edges == Other.Edges;
43 }
44
45 bool empty() const { return Edges.empty(); }
46
47 static SummaryName summaryName() { return SummaryName{Name.str()}; }
48};
49} // namespace clang::ssaf
50
51#endif // LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_POINTERFLOW_POINTERFLOW_H
Base class for analysis-specific summary data.
bool operator==(const PointerFlowEntitySummary &Other) const
Definition PointerFlow.h:41
friend llvm::iterator_range< EdgeSet::const_iterator > getEdges(const PointerFlowEntitySummary &)
SummaryName getSummaryName() const override
Definition PointerFlow.h:37
static constexpr llvm::StringLiteral Name
Definition PointerFlow.h:35
friend PointerFlowEntitySummary buildPointerFlowEntitySummary(EdgeSet Edges)
bool operator==(const EdgeSet &Other) const
Definition PointerFlow.h:39
Uniquely identifies an analysis summary.
Definition SummaryName.h:22
std::map< EntityPointerLevel, EntityPointerLevelSet > EdgeSet
Maps each source node to its destination nodes:
Definition PointerFlow.h:23
@ Other
Other implicit parameter.
Definition Decl.h:1763