clang 22.0.0git
LifetimeStats.h
Go to the documentation of this file.
1//===- LifetimeStats.h - Lifetime Safety Statistics -------------*- 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 declares the data structures and utility function for collection of
10// statistics related to Lifetime Safety analysis.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_LIFETIMESTATS_H
15#define LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_LIFETIMESTATS_H
16
17#include "clang/AST/TypeBase.h"
18#include "llvm/ADT/DenseMap.h"
19#include "llvm/ADT/StringMap.h"
20
21namespace clang::lifetimes {
22/// A structure to hold the statistics related to LifetimeAnalysis.
23/// These are accumulated across all analyzed functions and printed
24/// when -print-stats is enabled.
26 /// A map from `StmtClassName` to their missing origin counts.
27 llvm::StringMap<unsigned> ExprStmtClassToMissingOriginCount;
28 /// A map from `QualType` to their missing origin counts.
29 llvm::DenseMap<const clang::Type *, unsigned> ExprTypeToMissingOriginCount;
30};
31
32/// Utility function to print missing origin stats.
33void printStats(const LifetimeSafetyStats &Stats);
34} // namespace clang::lifetimes
35
36#endif // LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_LIFETIMESTATS_H
C Language Family Type Representation.
void printStats(const LifetimeSafetyStats &Stats)
Utility function to print missing origin stats.
A structure to hold the statistics related to LifetimeAnalysis.
llvm::StringMap< unsigned > ExprStmtClassToMissingOriginCount
A map from StmtClassName to their missing origin counts.
llvm::DenseMap< const clang::Type *, unsigned > ExprTypeToMissingOriginCount
A map from QualType to their missing origin counts.