clang 22.0.0git
LifetimeSafety.cpp File Reference
#include "clang/Analysis/Analyses/LifetimeSafety.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/AST/Type.h"
#include "clang/Analysis/Analyses/LifetimeAnnotations.h"
#include "clang/Analysis/Analyses/PostOrderCFGView.h"
#include "clang/Analysis/AnalysisDeclContext.h"
#include "clang/Analysis/CFG.h"
#include "clang/Analysis/FlowSensitive/DataflowWorklist.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/ImmutableMap.h"
#include "llvm/ADT/ImmutableSet.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/TimeProfiler.h"
#include <cstdint>
#include <memory>

Go to the source code of this file.

Classes

struct  clang::lifetimes::internal::AccessPath
 Represents the storage location being borrowed, e.g., a specific stack variable. More...
struct  clang::lifetimes::internal::Loan
 Information about a single borrow, or "Loan". More...
struct  clang::lifetimes::internal::Origin
 An Origin is a symbolic identifier that represents the set of possible loans a pointer-like object could hold at any given time. More...
class  clang::lifetimes::internal::LoanManager
 Manages the creation, storage and retrieval of loans. More...
class  clang::lifetimes::internal::OriginManager
 Manages the creation, storage, and retrieval of origins for pointer-like variables and expressions. More...
class  clang::lifetimes::internal::Fact
 An abstract base class for a single, atomic lifetime-relevant event. More...
class  clang::lifetimes::internal::IssueFact
class  clang::lifetimes::internal::ExpireFact
class  clang::lifetimes::internal::OriginFlowFact
class  clang::lifetimes::internal::ReturnOfOriginFact
class  clang::lifetimes::internal::UseFact
class  clang::lifetimes::internal::TestPointFact
 A dummy-fact used to mark a specific point in the code for testing. More...
class  clang::lifetimes::internal::FactManager
class  clang::lifetimes::internal::FactGenerator
class  clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >
 A generic, policy-based driver for dataflow analyses. More...
struct  clang::lifetimes::internal::LifetimeFactory
 An object to hold the factories for immutable collections, ensuring that all created states share the same underlying memory management. More...
struct  clang::lifetimes::internal::LoanPropagationLattice
 Represents the dataflow lattice for loan propagation. More...
class  clang::lifetimes::internal::LoanPropagationAnalysis
 The analysis that tracks which loans belong to which origins. More...
struct  clang::lifetimes::internal::ExpiredLattice
 The dataflow lattice for tracking the set of expired loans. More...
class  clang::lifetimes::internal::ExpiredLoansAnalysis
 The analysis that tracks which loans have expired. More...
struct  clang::lifetimes::internal::PendingWarning
 Struct to store the complete context for a potential lifetime violation. More...
class  clang::lifetimes::internal::LifetimeChecker

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.
namespace  clang::lifetimes
namespace  clang::lifetimes::internal
namespace  clang::lifetimes::internal::utils

Typedefs

using clang::lifetimes::internal::OriginLoanMap = llvm::ImmutableMap<OriginID, LoanSet>
using clang::lifetimes::internal::ExpiredLoanMap = llvm::ImmutableMap<LoanID, const ExpireFact *>

Enumerations

enum class  clang::lifetimes::internal::Direction { clang::lifetimes::internal::Forward , clang::lifetimes::internal::Backward }

Functions

template<typename T>
static llvm::ImmutableSet< Tclang::lifetimes::internal::utils::join (llvm::ImmutableSet< T > A, llvm::ImmutableSet< T > B, typename llvm::ImmutableSet< T >::Factory &F)
 Computes the union of two ImmutableSets.
template<typename T>
static bool clang::lifetimes::internal::utils::isSubsetOf (const llvm::ImmutableSet< T > &A, const llvm::ImmutableSet< T > &B)
 Checks if set A is a subset of set B.
template<typename K, typename V, typename Joiner>
static llvm::ImmutableMap< K, Vclang::lifetimes::internal::utils::join (llvm::ImmutableMap< K, V > A, llvm::ImmutableMap< K, V > B, typename llvm::ImmutableMap< K, V >::Factory &F, Joiner JoinValues)
 Computes the key-wise union of two ImmutableMaps.
void clang::lifetimes::runLifetimeSafetyAnalysis (AnalysisDeclContext &AC, LifetimeSafetyReporter *Reporter)
 The main entry point for the analysis.