clang 19.0.0git
Public Member Functions | Friends | List of all members
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 >:
Inheritance graph
[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! This function exists only when that is not available, for example, when only syntactic check is done on a piece of code.
 

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.

◆ 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.

◆ ~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

◆ CallDescriptionMap() [4/4]

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

Member Function Documentation

◆ lookup()

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

Definition at line 222 of file CallDescription.h.

References clang::Call.

◆ lookupAsWritten()

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

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 candicade 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.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Friends And Related Function Documentation

◆ CallDescriptionSet

template<typename T >
friend class CallDescriptionSet
friend

Definition at line 195 of file CallDescription.h.


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