clang 23.0.0git
PointerFlowAnalysis.h
Go to the documentation of this file.
1//===- PointerFlowAnalysis.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// Defines
10// - PointerFlowAnalysisResult
11// - the plain PointerFlow info collected from the whole program.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_POINTERFLOW_POINTERFLOWANALYSIS_H
16#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_POINTERFLOW_POINTERFLOWANALYSIS_H
17
22#include "llvm/ADT/StringRef.h"
23#include <map>
24
25namespace clang::ssaf {
26
27constexpr llvm::StringLiteral PointerFlowAnalysisResultName =
28 "PointerFlowAnalysisResult";
29
30/// A PointerFlowAnalysisResult is a set of pointer-flow edges, i.e.,
31/// a pointer-flow graph. A directed edge src -> dest corresponds to an
32/// assignment (of any of various kinds, e.g., assignment operator or
33/// argument-passing) of pointer dest to pointer src in the source code.
34/// The edge's direction is the opposite of how pointer values flow. This
35/// is because PointerFlowAnalysisResult is used for analyzing property
36/// propagation between pointers. For an assignment `src = dest`, the
37/// propagation works such that if `src` has a property, `dest` must also
38/// have that property; otherwise, the property would not be preserved
39/// across the assignment.
44
45 std::map<EntityId, EdgeSet> Edges;
46};
47
48} // namespace clang::ssaf
49
50#endif // LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_POINTERFLOW_POINTERFLOWANALYSIS_H
Uniquely identifies a whole-program analysis and the AnalysisResult it produces.
Base class for whole-program analysis results.
constexpr llvm::StringLiteral PointerFlowAnalysisResultName
A PointerFlowAnalysisResult is a set of pointer-flow edges, i.e., a pointer-flow graph.
std::map< EntityId, EdgeSet > Edges