clang  14.0.0git
Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
clang::detail::DeclarationNameExtra Class Reference

DeclarationNameExtra is used as a base of various uncommon special names. More...

#include "clang/Basic/IdentifierTable.h"

Inheritance diagram for clang::detail::DeclarationNameExtra:
Inheritance graph
Collaboration diagram for clang::detail::DeclarationNameExtra:
Collaboration graph

Protected Types

enum  ExtraKind { CXXDeductionGuideName, CXXLiteralOperatorName, CXXUsingDirective, ObjCMultiArgSelector }
 The kind of "extra" information stored in the DeclarationName. More...

Protected Member Functions

 DeclarationNameExtra (ExtraKind Kind)
 DeclarationNameExtra (unsigned NumArgs)
ExtraKind getKind () const
 Return the corresponding ExtraKind. More...
unsigned getNumArgs () const
 Return the number of arguments in an ObjC selector. More...

Protected Attributes

unsigned ExtraKindOrNumArgs
 ExtraKindOrNumArgs has one of the following meaning: More...


class clang::DeclarationName
class clang::DeclarationNameTable

Detailed Description

DeclarationNameExtra is used as a base of various uncommon special names.

This class is needed since DeclarationName has not enough space to store the kind of every possible names. Therefore the kind of common names is stored directly in DeclarationName, and the kind of uncommon names is stored in DeclarationNameExtra. It is aligned to 8 bytes because DeclarationName needs the lower 3 bits to store the kind of common names. DeclarationNameExtra is tightly coupled to DeclarationName and any change here is very likely to require changes in DeclarationName(Table).

Definition at line 948 of file IdentifierTable.h.

Member Enumeration Documentation

◆ ExtraKind

The kind of "extra" information stored in the DeclarationName.

See ExtraKindOrNumArgs for an explanation of how these enumerator values are used. Note that DeclarationName depends on the numerical values of the enumerators in this enum. See DeclarationName::StoredNameKind for more info.


Definition at line 958 of file IdentifierTable.h.

Constructor & Destructor Documentation

◆ DeclarationNameExtra() [1/2]

clang::detail::DeclarationNameExtra::DeclarationNameExtra ( ExtraKind  Kind)

Definition at line 977 of file IdentifierTable.h.

◆ DeclarationNameExtra() [2/2]

clang::detail::DeclarationNameExtra::DeclarationNameExtra ( unsigned  NumArgs)

Definition at line 978 of file IdentifierTable.h.

Member Function Documentation

◆ getKind()

ExtraKind clang::detail::DeclarationNameExtra::getKind ( ) const

Return the corresponding ExtraKind.

Definition at line 982 of file IdentifierTable.h.

◆ getNumArgs()

unsigned clang::detail::DeclarationNameExtra::getNumArgs ( ) const

Return the number of arguments in an ObjC selector.

Only valid when this is indeed an ObjCMultiArgSelector.

Definition at line 991 of file IdentifierTable.h.

Referenced by clang::Selector::getNumArgs().

Friends And Related Function Documentation

◆ clang::DeclarationName

friend class clang::DeclarationName

Definition at line 949 of file IdentifierTable.h.

◆ clang::DeclarationNameTable

friend class clang::DeclarationNameTable

Definition at line 950 of file IdentifierTable.h.

Member Data Documentation

◆ ExtraKindOrNumArgs

unsigned clang::detail::DeclarationNameExtra::ExtraKindOrNumArgs

ExtraKindOrNumArgs has one of the following meaning:

Definition at line 975 of file IdentifierTable.h.

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