clang  10.0.0svn
Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::ParamIdx Class Reference

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

Public Member Functions

 ParamIdx ()
 Construct an invalid parameter index (isValid returns false and accessors fail an assert). More...
 
 ParamIdx (unsigned Idx, const Decl *D)
 
SerialType serialize () const
 Produce a representation that can later be passed to deserialize to construct an equivalent ParamIdx. More...
 
bool isValid () const
 Is this parameter index valid? More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

A single parameter index whose accessors require each use to make explicit the parameter index encoding needed.

Definition at line 212 of file Attr.h.

Member Typedef Documentation

◆ SerialType

typedef uint32_t clang::ParamIdx::SerialType

A type into which ParamIdx can be serialized.

A static assertion that it's of the correct size follows the ParamIdx class definition.

Definition at line 251 of file Attr.h.

Constructor & Destructor Documentation

◆ ParamIdx() [1/2]

clang::ParamIdx::ParamIdx ( )
inline

Construct an invalid parameter index (isValid returns false and accessors fail an assert).

Definition at line 232 of file Attr.h.

◆ ParamIdx() [2/2]

clang::ParamIdx::ParamIdx ( unsigned  Idx,
const Decl D 
)
inline
Parameters
Idxis the parameter index as it is normally specified in attributes in the source: one-origin including any C++ implicit this parameter.
Dis the declaration containing the parameters. It is used to determine if there is a C++ implicit this parameter.

Definition at line 240 of file Attr.h.

Member Function Documentation

◆ deserialize()

static ParamIdx clang::ParamIdx::deserialize ( SerialType  S)
inlinestatic

Construct from a result from serialize.

Definition at line 260 of file Attr.h.

◆ getASTIndex()

unsigned clang::ParamIdx::getASTIndex ( ) const
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 286 of file Attr.h.

◆ getLLVMIndex()

unsigned clang::ParamIdx::getLLVMIndex ( ) const
inline

Get the parameter index as it would normally be encoded at the LLVM level of representation: zero-origin including any C++ implicit this parameter.

This is the encoding primarily used in CodeGen.

Definition at line 297 of file Attr.h.

◆ getSourceIndex()

unsigned clang::ParamIdx::getSourceIndex ( ) const
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 275 of file Attr.h.

◆ isValid()

bool clang::ParamIdx::isValid ( ) const
inline

Is this parameter index valid?

Definition at line 267 of file Attr.h.

◆ operator!=()

bool clang::ParamIdx::operator!= ( const ParamIdx I) const
inline

Definition at line 307 of file Attr.h.

◆ operator<()

bool clang::ParamIdx::operator< ( const ParamIdx I) const
inline

Definition at line 311 of file Attr.h.

◆ operator<=()

bool clang::ParamIdx::operator<= ( const ParamIdx I) const
inline

Definition at line 319 of file Attr.h.

◆ operator==()

bool clang::ParamIdx::operator== ( const ParamIdx I) const
inline

Definition at line 303 of file Attr.h.

◆ operator>()

bool clang::ParamIdx::operator> ( const ParamIdx I) const
inline

Definition at line 315 of file Attr.h.

◆ operator>=()

bool clang::ParamIdx::operator>= ( const ParamIdx I) const
inline

Definition at line 323 of file Attr.h.

◆ serialize()

SerialType clang::ParamIdx::serialize ( ) const
inline

Produce a representation that can later be passed to deserialize to construct an equivalent ParamIdx.

Definition at line 255 of file Attr.h.


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