|
clang 24.0.0git
|
A single parameter index whose accessors require each use to make explicit the parameter index encoding needed. More...
#include "clang/AST/Attr.h"
Public Types | |
| typedef uint32_t | SerialType |
A type into which ParamIdx can be serialized. | |
Public Member Functions | |
| ParamIdx () | |
Construct an invalid parameter index (isValid returns false and accessors fail an assert). | |
| ParamIdx (unsigned Idx, const Decl *D) | |
| SerialType | serialize () const |
Produce a representation that can later be passed to deserialize to construct an equivalent ParamIdx. | |
| bool | isValid () const |
| Is this parameter index valid? | |
| unsigned | getSourceIndex () const |
| Get the parameter index as it would normally be encoded for attributes at the source level of representation: one-origin including any C++ implicit this parameter. | |
| unsigned | getASTIndex () const |
| Get the parameter index as it would normally be encoded at the AST level of representation: zero-origin not including any C++ implicit this parameter. | |
| unsigned | getLLVMIndex () const |
| Get the parameter index as it would normally be encoded at the LLVM level of representation: zero-origin including any C++ implicit this parameter. | |
| bool | operator== (const ParamIdx &I) const |
| bool | operator!= (const ParamIdx &I) const |
| bool | operator< (const ParamIdx &I) const |
| bool | operator> (const ParamIdx &I) const |
| bool | operator<= (const ParamIdx &I) const |
| bool | operator>= (const ParamIdx &I) const |
Static Public Member Functions | |
| static ParamIdx | deserialize (SerialType S) |
Construct from a result from serialize. | |
Static Public Attributes | |
| static constexpr unsigned | IdxBitWidth = 30 |
A single parameter index whose accessors require each use to make explicit the parameter index encoding needed.
| typedef uint32_t clang::ParamIdx::SerialType |
|
inline |
Construct an invalid parameter index (isValid returns false and accessors fail an assert).
Definition at line 306 of file Attr.h.
References false.
Referenced by deserialize(), operator!=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().
| Idx | is the parameter index as it is normally specified in attributes in the source: one-origin including any C++ implicit this parameter. |
| D | is the declaration containing the parameters. It is used to determine if there is a C++ implicit this parameter. |
|
inlinestatic |
Construct from a result from serialize.
Definition at line 334 of file Attr.h.
References ParamIdx().
|
inline |
Get the parameter index as it would normally be encoded at the AST level of representation: zero-origin not including any C++ implicit this parameter.
This is the encoding primarily used in Sema. However, in diagnostics, Sema uses getSourceIndex instead.
Definition at line 363 of file Attr.h.
References isValid().
Referenced by clang::Sema::AddAllocAlignAttr(), checkParamIsIntegerType(), handleArgumentWithTypeTagAttr(), clang::SemaSwift::handleAsyncAttr(), handleFormatArgAttr(), handleNonNullAttr(), handleOwnershipAttr(), handleRestrictAttr(), and isSafeTwoParamContainerConstruct().
|
inline |
|
inline |
Get the parameter index as it would normally be encoded for attributes at the source level of representation: one-origin including any C++ implicit this parameter.
This encoding thus makes sense for diagnostics, pretty printing, and constructing new attributes from a source-like specification.
Definition at line 352 of file Attr.h.
References isValid().
Referenced by handleOwnershipAttr(), handleRestrictAttr(), and handleXRayLogArgsAttr().
|
inline |
Is this parameter index valid?
Definition at line 344 of file Attr.h.
Referenced by getASTIndex(), getLLVMIndex(), getSourceIndex(), handleRestrictAttr(), and isSafeTwoParamContainerConstruct().
Definition at line 384 of file Attr.h.
References ParamIdx().
Definition at line 388 of file Attr.h.
References ParamIdx().
Definition at line 396 of file Attr.h.
References ParamIdx().
Definition at line 380 of file Attr.h.
References ParamIdx().
Definition at line 392 of file Attr.h.
References ParamIdx().
Definition at line 400 of file Attr.h.
References ParamIdx().
|
inline |
|
staticconstexpr |
Definition at line 282 of file Attr.h.
Referenced by clang::Sema::checkFunctionOrMethodParameterIndex().