clang 20.0.0git
Public Member Functions | List of all members
clang::ento::CallDescriptionSet Class Reference

An immutable set of CallDescriptions. More...

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

Public Member Functions

 CallDescriptionSet (std::initializer_list< CallDescription > &&List)
 
 CallDescriptionSet (const CallDescriptionSet &)=delete
 
CallDescriptionSetoperator= (const CallDescription &)=delete
 
bool contains (const CallEvent &Call) const
 
bool containsAsWritten (const CallExpr &CE) 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.
 

Detailed Description

An immutable set of CallDescriptions.

Checkers can efficiently decide if a given CallEvent matches any CallDescription in the set.

Definition at line 262 of file CallDescription.h.

Constructor & Destructor Documentation

◆ CallDescriptionSet() [1/2]

ento::CallDescriptionSet::CallDescriptionSet ( std::initializer_list< CallDescription > &&  List)

Definition at line 156 of file CallDescription.cpp.

◆ CallDescriptionSet() [2/2]

clang::ento::CallDescriptionSet::CallDescriptionSet ( const CallDescriptionSet )
delete

Member Function Documentation

◆ contains()

bool ento::CallDescriptionSet::contains ( const CallEvent Call) const

Definition at line 163 of file CallDescription.cpp.

References clang::Call.

◆ containsAsWritten()

bool ento::CallDescriptionSet::containsAsWritten ( const CallExpr CE) 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.

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 167 of file CallDescription.cpp.

◆ operator=()

CallDescriptionSet & clang::ento::CallDescriptionSet::operator= ( const CallDescription )
delete

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