clang 23.0.0git
UnsafeBufferUsageAnalysis.h
Go to the documentation of this file.
1//===- UnsafeBufferUsageAnalysis.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// - UnsafeBufferUsageAnalysisResult
11// - the whole-program analysis result
12// type for UnsafeBufferUsageAnalysis. It collects unsafe buffer usages
13// throughout the whole program.
14//
15// - UnsafeBufferReachableAnalysisResult
16// - the whole-program analysis result
17// type for UnsafeBufferReachableAnalysis. It propagates unsafe buffer
18// usages through the pointer flow graph, starting from the initial set
19// collected by UnsafeBufferUsageAnalysis.
20//
21//===----------------------------------------------------------------------===//
22
23#ifndef LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_UNSAFEBUFFERUSAGE_UNSAFEBUFFERUSAGEANALYSIS_H
24#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_UNSAFEBUFFERUSAGE_UNSAFEBUFFERUSAGEANALYSIS_H
25
30#include "llvm/ADT/StringRef.h"
31#include <map>
32
33namespace clang::ssaf {
34
35constexpr llvm::StringLiteral UnsafeBufferUsageAnalysisResultName =
36 "UnsafeBufferUsageAnalysisResult";
37constexpr llvm::StringLiteral UnsafeBufferReachableAnalysisResultName =
38 "UnsafeBufferReachableAnalysisResult";
39
44
45 /// Whole-program set of unsafe buffer pointers:
46 std::map<EntityId, EntityPointerLevelSet> UnsafeBuffers;
47
48 auto begin() const { return UnsafeBuffers.begin(); }
49 auto end() const { return UnsafeBuffers.end(); }
50};
51
56
57 std::map<EntityId, EntityPointerLevelSet> Reachables;
58};
59
60} // namespace clang::ssaf
61
62#endif // LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_UNSAFEBUFFERUSAGE_UNSAFEBUFFERUSAGEANALYSIS_H
Uniquely identifies a whole-program analysis and the AnalysisResult it produces.
Base class for whole-program analysis results.
constexpr llvm::StringLiteral UnsafeBufferUsageAnalysisResultName
constexpr llvm::StringLiteral UnsafeBufferReachableAnalysisResultName
std::map< EntityId, EntityPointerLevelSet > Reachables
std::map< EntityId, EntityPointerLevelSet > UnsafeBuffers
Whole-program set of unsafe buffer pointers: