clang API Documentation
#include <IdentifierTable.h>
Public Member Functions | |
| Selector () | |
| Selector (uintptr_t V) | |
| bool | operator== (Selector RHS) const |
| operator==/!= - Indicate whether the specified selectors are identical. | |
| bool | operator!= (Selector RHS) const |
| void * | getAsOpaquePtr () const |
| bool | isNull () const |
| Determine whether this is the empty selector. | |
| bool | isKeywordSelector () const |
| bool | isUnarySelector () const |
| unsigned | getNumArgs () const |
| IdentifierInfo * | getIdentifierInfoForSlot (unsigned argIndex) const |
| Retrieve the identifier at a given position in the selector. | |
| StringRef | getNameForSlot (unsigned argIndex) const |
| Retrieve the name at a given position in the selector. | |
| std::string | getAsString () const |
| ObjCMethodFamily | getMethodFamily () const |
| getMethodFamily - Derive the conventional family of this method. | |
Static Public Member Functions | |
| static Selector | getEmptyMarker () |
| static Selector | getTombstoneMarker () |
Friends | |
| class | Diagnostic |
| class | SelectorTable |
| class | DeclarationName |
Selector - This smart pointer class efficiently represents Objective-C method names. This class will either point to an IdentifierInfo or a MultiKeywordSelector (which is private). This enables us to optimize selectors that take no arguments and selectors that take 1 argument, which accounts for 78% of all selectors in Cocoa.h.
Definition at line 573 of file IdentifierTable.h.
| clang::Selector::Selector | ( | ) | [inline] |
The default ctor should only be used when creating data structures that will contain selectors.
Definition at line 618 of file IdentifierTable.h.
Referenced by getEmptyMarker(), and getTombstoneMarker().
| clang::Selector::Selector | ( | uintptr_t | V | ) | [inline] |
Definition at line 619 of file IdentifierTable.h.
| void* clang::Selector::getAsOpaquePtr | ( | ) | const [inline] |
Definition at line 628 of file IdentifierTable.h.
Referenced by llvm::PointerLikeTypeTraits< clang::Selector >::getAsVoidPointer(), llvm::DenseMapInfo< clang::Selector >::getHashValue(), clang::serialization::reader::ASTDeclContextNameLookupTrait::GetInternalKey(), clang::ASTWriter::getSelectorRef(), and clang::ObjCMessageExpr::setSelector().
| std::string Selector::getAsString | ( | ) | const |
getAsString - Derive the full selector name (e.g. "foo:bar:") and return it as an std::string.
Definition at line 374 of file IdentifierTable.cpp.
References clang::IdentifierInfo::getName(), clang::MultiKeywordSelector::getName(), and getNumArgs().
Referenced by BuildUniqueMethodName(), CompareReturnTypes(), clang::ASTContext::getObjCEncodingForPropertyDecl(), clang::MangleContext::mangleObjCMethodName(), and SymbolNameForMethod().
| static Selector clang::Selector::getEmptyMarker | ( | ) | [inline, static] |
Definition at line 680 of file IdentifierTable.h.
References Selector().
Referenced by llvm::DenseMapInfo< clang::Selector >::getEmptyKey().
| IdentifierInfo * Selector::getIdentifierInfoForSlot | ( | unsigned | argIndex | ) | const |
Retrieve the identifier at a given position in the selector.
Note that the identifier pointer returned may be NULL. Clients that only care about the text of the identifier string, and not the specific, uniqued identifier pointer, should use getNameForSlot(), which returns an empty string when the identifier pointer would be NULL.
| argIndex | The index for which we want to retrieve the identifier. This index shall be less than getNumArgs() unless this is a keyword selector, in which case 0 is the only permissible value. |
Definition at line 347 of file IdentifierTable.cpp.
References clang::MultiKeywordSelector::getIdentifierInfoForSlot().
Referenced by AddObjCExpressionResults(), clang::serialization::ComputeHash(), clang::CodeCompletionResult::CreateCodeCompletionString(), getNameForSlot(), getOrderedName(), getStandardSelLoc(), clang::ASTImporter::Import(), clang::Expr::isUnusedResultAWarning(), and clang::CodeGen::CodeGenFunction::StartObjCMethod().
| ObjCMethodFamily clang::Selector::getMethodFamily | ( | ) | const [inline] |
getMethodFamily - Derive the conventional family of this method.
Definition at line 676 of file IdentifierTable.h.
Referenced by clang::Sema::ActOnSuperMessage(), clang::Sema::BuildInstanceMessage(), clang::ObjCMethodDecl::getMethodFamily(), and clang::Sema::ParseObjCSelectorExpression().
| StringRef Selector::getNameForSlot | ( | unsigned | argIndex | ) | const |
Retrieve the name at a given position in the selector.
| argIndex | The index for which we want to retrieve the name. This index shall be less than getNumArgs() unless this is a keyword selector, in which case 0 is the only permissible value. |
Definition at line 357 of file IdentifierTable.cpp.
References getIdentifierInfoForSlot(), and clang::IdentifierInfo::getName().
Referenced by AddObjCExpressionResults(), clang::DeclarationName::compare(), clang::CodeCompletionResult::CreateCodeCompletionString(), clang::Sema::DiagnoseAssignmentAsCondition(), isAcceptableMethodMismatch(), isMultiArgSelector(), and isSetterLikeSelector().
| unsigned Selector::getNumArgs | ( | ) | const |
Definition at line 336 of file IdentifierTable.cpp.
References clang::MultiKeywordSelector::getNumArgs().
Referenced by clang::Sema::ActOnMethodDeclaration(), AddObjCExpressionResults(), clang::Sema::CheckMessageArgumentTypes(), clang::DeclarationName::compare(), clang::serialization::ComputeHash(), getAsString(), clang::ObjCMethodDecl::getNumSelectorLocs(), clang::ObjCMessageExpr::getNumSelectorLocs(), getStandardSelLoc(), clang::ASTImporter::Import(), isSetterLikeSelector(), and clang::ObjCMethodDecl::sel_param_end().
| static Selector clang::Selector::getTombstoneMarker | ( | ) | [inline, static] |
Definition at line 683 of file IdentifierTable.h.
References Selector().
Referenced by llvm::DenseMapInfo< clang::Selector >::getTombstoneKey().
| bool clang::Selector::isKeywordSelector | ( | ) | const [inline] |
Definition at line 636 of file IdentifierTable.h.
| bool clang::Selector::isNull | ( | ) | const [inline] |
Determine whether this is the empty selector.
Definition at line 633 of file IdentifierTable.h.
Referenced by AddObjCExpressionResults(), and clang::ASTImporter::Import().
| bool clang::Selector::isUnarySelector | ( | ) | const [inline] |
Definition at line 639 of file IdentifierTable.h.
Referenced by AddObjCExpressionResults(), clang::CodeCompletionResult::CreateCodeCompletionString(), clang::Sema::DiagnoseAssignmentAsCondition(), clang::ObjCMethodDecl::getNumSelectorLocs(), clang::ObjCMessageExpr::getNumSelectorLocs(), isAcceptableMethodMismatch(), isSetterLikeSelector(), and clang::CodeGen::CodeGenFunction::StartObjCMethod().
| bool clang::Selector::operator!= | ( | Selector | RHS | ) | const [inline] |
Definition at line 625 of file IdentifierTable.h.
| bool clang::Selector::operator== | ( | Selector | RHS | ) | const [inline] |
operator==/!= - Indicate whether the specified selectors are identical.
Definition at line 622 of file IdentifierTable.h.
friend class DeclarationName [friend] |
Definition at line 614 of file IdentifierTable.h.
friend class Diagnostic [friend] |
Definition at line 574 of file IdentifierTable.h.
friend class SelectorTable [friend] |
Definition at line 613 of file IdentifierTable.h.