9#ifndef CLANG_INCLUDE_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_ENTRYPOINTSTATS_H
10#define CLANG_INCLUDE_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_ENTRYPOINTSTATS_H
13#include "llvm/ADT/Statistic.h"
14#include "llvm/ADT/StringRef.h"
27 llvm::StringLiteral
name()
const {
return Name; }
43 llvm::StringLiteral Name;
53 unsigned value()
const {
return Value; }
78 unsigned value()
const {
return Value; }
85 std::optional<unsigned> Value = {};
89 std::optional<unsigned>
value()
const {
return Value; }
92 assert(!Value.has_value());
99 llvm::TrackingStatistic S;
103 llvm::StringLiteral Name,
104 llvm::StringLiteral Desc)
105 : M(Name), S(DebugType, Name.data(), Desc.data()) {}
126 llvm::TrackingStatistic S;
130 llvm::StringLiteral Name,
131 llvm::StringLiteral Desc)
132 : M(Name), S(DebugType, Name.data(), Desc.data()) {}
134 M.updateMax(
static_cast<unsigned>(
Value));
139#define STAT_COUNTER(VARNAME, DESC) \
140 static clang::ento::CounterEntryPointTranslationUnitStat VARNAME = { \
141 DEBUG_TYPE, #VARNAME, DESC}
143#define STAT_MAX(VARNAME, DESC) \
144 static clang::ento::UnsignedMaxEntryPointTranslationUnitStatistic VARNAME = \
145 {DEBUG_TYPE, #VARNAME, DESC}
Defines the clang::ASTContext interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Decl - This represents one declaration (or definition), e.g.
CounterEPStat & operator++()
CounterEPStat & operator++(int)
CounterEPStat & operator+=(unsigned Inc)
CounterEPStat(llvm::StringLiteral Name)
CounterEntryPointTranslationUnitStat & operator++(int)
CounterEntryPointTranslationUnitStat & operator+=(unsigned Inc)
CounterEntryPointTranslationUnitStat & operator++()
CounterEntryPointTranslationUnitStat(const char *DebugType, llvm::StringLiteral Name, llvm::StringLiteral Desc)
static void dumpStatsAsCSV(llvm::raw_ostream &OS)
static void lockRegistry(llvm::StringRef CPPFileName, ASTContext &Ctx)
EntryPointStat & operator=(EntryPointStat &)=delete
EntryPointStat & operator=(EntryPointStat &&)=delete
static void takeSnapshot(const Decl *EntryPoint)
llvm::StringLiteral name() const
EntryPointStat(llvm::StringLiteral Name)
EntryPointStat(const EntryPointStat &)=delete
EntryPointStat(EntryPointStat &&)=delete
UnsignedEPStat(llvm::StringLiteral Name)
std::optional< unsigned > value() const
void updateMax(unsigned X)
UnsignedMaxEPStat(llvm::StringLiteral Name)
void updateMax(uint64_t Value)
UnsignedMaxEntryPointTranslationUnitStatistic(const char *DebugType, llvm::StringLiteral Name, llvm::StringLiteral Desc)
@ OS
Indicates that the tracking object is a descendant of a referenced-counted OSObject,...
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.