clang 22.0.0git
clang::ento::CallDescriptionMap< T > Class Template Reference

An immutable map from CallDescriptions to arbitrary data. More...

#include "clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h"

Inheritance diagram for clang::ento::CallDescriptionMap< T >:
[legend]

Public Member Functions

 CallDescriptionMap (std::initializer_list< std::pair< CallDescription, T > > &&List)
template<typename InputIt>
 CallDescriptionMap (InputIt First, InputIt Last)
 ~CallDescriptionMap ()=default
 CallDescriptionMap (const CallDescriptionMap &)=delete
CallDescriptionMapoperator= (const CallDescription &)=delete
 CallDescriptionMap (CallDescriptionMap &&)=default
CallDescriptionMapoperator= (CallDescriptionMap &&)=default
const Tlookup (const CallEvent &Call) const
const TlookupAsWritten (const CallExpr &Call) const
 When available, always prefer lookup with a CallEvent!

Friends

class CallDescriptionSet

Detailed Description

template<typename T>
class clang::ento::CallDescriptionMap< T >

An immutable map from CallDescriptions to arbitrary data.

Provides a unified way for checkers to react on function calls.

Definition at line 194 of file CallDescription.h.

Constructor & Destructor Documentation

◆ CallDescriptionMap() [1/4]

template<typename T>
clang::ento::CallDescriptionMap< T >::CallDescriptionMap ( std::initializer_list< std::pair< CallDescription, T > > && List)
inline

Definition at line 205 of file CallDescription.h.

Referenced by CallDescriptionMap(), CallDescriptionMap(), operator=(), and operator=().

◆ CallDescriptionMap() [2/4]

template<typename T>
template<typename InputIt>
clang::ento::CallDescriptionMap< T >::CallDescriptionMap ( InputIt First,
InputIt Last )
inline

Definition at line 210 of file CallDescription.h.

References clang::First, and clang::Last.

◆ ~CallDescriptionMap()

template<typename T>
clang::ento::CallDescriptionMap< T >::~CallDescriptionMap ( )
default

◆ CallDescriptionMap() [3/4]

template<typename T>
clang::ento::CallDescriptionMap< T >::CallDescriptionMap ( const CallDescriptionMap< T > & )
delete

References CallDescriptionMap().

◆ CallDescriptionMap() [4/4]

template<typename T>
clang::ento::CallDescriptionMap< T >::CallDescriptionMap ( CallDescriptionMap< T > && )
default

References CallDescriptionMap().

Member Function Documentation

◆ lookup()

template<typename T>
const T * clang::ento::CallDescriptionMap< T >::lookup ( const CallEvent & Call) const
inlinenodiscard

Definition at line 222 of file CallDescription.h.

References clang::Call, and clang::T.

◆ lookupAsWritten()

template<typename T>
const T * clang::ento::CallDescriptionMap< T >::lookupAsWritten ( const CallExpr & Call) const
inlinenodiscard

When available, always prefer lookup with a CallEvent!

This function exists only when that is not available, for example, when only syntactic check is done on a piece of code.

Also, StdLibraryFunctionsChecker::Signature is likely a better candidate for syntactic only matching if you are writing a new checker. This is handy if a CallDescriptionMap is already there.

The function is imprecise because CallEvent may know path sensitive information, such as the precise argument count (see comments for CallEvent::getNumArgs), the called function if it was called through a function pointer, and other information not available syntactically.

Definition at line 244 of file CallDescription.h.

References clang::Call, and clang::T.

◆ operator=() [1/2]

template<typename T>
CallDescriptionMap & clang::ento::CallDescriptionMap< T >::operator= ( CallDescriptionMap< T > && )
default

References CallDescriptionMap().

◆ operator=() [2/2]

template<typename T>
CallDescriptionMap & clang::ento::CallDescriptionMap< T >::operator= ( const CallDescription & )
delete

References CallDescriptionMap().

◆ CallDescriptionSet

template<typename T>
friend class CallDescriptionSet
friend

Definition at line 195 of file CallDescription.h.

References CallDescriptionSet.

Referenced by CallDescriptionSet.


The documentation for this class was generated from the following file: