clang  14.0.0git
Public Member Functions | List of all members
clang::ento::CallDescription Class Reference

This class represents a description of a function call using the number of arguments and the name of the function. More...

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

Public Member Functions

 CallDescription (int Flags, ArrayRef< const char * > QualifiedName, Optional< unsigned > RequiredArgs=None, Optional< size_t > RequiredParams=None)
 Constructs a CallDescription object. More...
 
 CallDescription (ArrayRef< const char * > QualifiedName, Optional< unsigned > RequiredArgs=None, Optional< size_t > RequiredParams=None)
 Construct a CallDescription with default flags. More...
 
StringRef getFunctionName () const
 Get the name of the function that this object matches. More...
 
auto begin_qualified_name_parts () const
 Get the qualified name parts in reversed order. More...
 
auto end_qualified_name_parts () const
 
bool hasQualifiedNameParts () const
 It's false, if and only if we expect a single identifier, such as getenv. More...
 

Detailed Description

This class represents a description of a function call using the number of arguments and the name of the function.

Definition at line 1238 of file CallEvent.h.

Constructor & Destructor Documentation

◆ CallDescription() [1/2]

clang::ento::CallDescription::CallDescription ( int  Flags,
ArrayRef< const char * >  QualifiedName,
Optional< unsigned RequiredArgs = None,
Optional< size_t RequiredParams = None 
)
inline

Constructs a CallDescription object.

Parameters
QualifiedNameThe list of the name qualifiers of the function that will be matched. The user is allowed to skip any of the qualifiers. For example, {"std", "basic_string", "c_str"} would match both std::basic_string<...>::c_str() and std::__1::basic_string<...>::c_str().
RequiredArgsThe number of arguments that is expected to match a call. Omit this parameter to match every occurrence of call with a given name regardless the number of arguments.

Definition at line 1269 of file CallEvent.h.

◆ CallDescription() [2/2]

clang::ento::CallDescription::CallDescription ( ArrayRef< const char * >  QualifiedName,
Optional< unsigned RequiredArgs = None,
Optional< size_t RequiredParams = None 
)
inline

Construct a CallDescription with default flags.

Definition at line 1279 of file CallEvent.h.

Member Function Documentation

◆ begin_qualified_name_parts()

auto clang::ento::CallDescription::begin_qualified_name_parts ( ) const
inline

Get the qualified name parts in reversed order.

E.g. { "std", "vector", "data" } -> "vector", "std"

Definition at line 1289 of file CallEvent.h.

◆ end_qualified_name_parts()

auto clang::ento::CallDescription::end_qualified_name_parts ( ) const
inline

Definition at line 1292 of file CallEvent.h.

◆ getFunctionName()

StringRef clang::ento::CallDescription::getFunctionName ( ) const
inline

Get the name of the function that this object matches.

Definition at line 1285 of file CallEvent.h.

Referenced by clang::ento::CallEvent::isCalled().

◆ hasQualifiedNameParts()

bool clang::ento::CallDescription::hasQualifiedNameParts ( ) const
inline

It's false, if and only if we expect a single identifier, such as getenv.

It's true for std::swap, or my::detail::container::data.

Definition at line 1296 of file CallEvent.h.


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