clang API Documentation
An array of decls optimized for the common case of only containing one entry. More...
#include <DeclContextInternals.h>
Public Types | |
typedef SmallVector< NamedDecl *, 4 > | DeclsTy |
When in vector form, this is what the Data pointer points to. | |
typedef llvm::PointerIntPair < DeclsTy *, 1, bool > | DeclsAndHasExternalTy |
A collection of declarations, with a flag to indicate if we have further external declarations. | |
Public Member Functions | |
StoredDeclsList () | |
StoredDeclsList (StoredDeclsList &&RHS) | |
~StoredDeclsList () | |
StoredDeclsList & | operator= (StoredDeclsList &&RHS) |
bool | isNull () const |
NamedDecl * | getAsDecl () const |
DeclsAndHasExternalTy | getAsVectorAndHasExternal () const |
DeclsTy * | getAsVector () const |
bool | hasExternalDecls () const |
void | setHasExternalDecls () |
void | setOnlyValue (NamedDecl *ND) |
void | remove (NamedDecl *D) |
void | removeExternalDecls () |
Remove any declarations which were imported from an external AST source. | |
DeclContext::lookup_result | getLookupResult () |
bool | HandleRedeclaration (NamedDecl *D) |
void | AddSubsequentDecl (NamedDecl *D) |
Public Attributes | |
llvm::PointerUnion< NamedDecl *, DeclsAndHasExternalTy > | Data |
The stored data, which will be either a pointer to a NamedDecl, or a pointer to a vector with a flag to indicate if there are further external declarations. |
An array of decls optimized for the common case of only containing one entry.
Definition at line 32 of file DeclContextInternals.h.
typedef llvm::PointerIntPair<DeclsTy *, 1, bool> clang::StoredDeclsList::DeclsAndHasExternalTy |
A collection of declarations, with a flag to indicate if we have further external declarations.
Definition at line 39 of file DeclContextInternals.h.
typedef SmallVector<NamedDecl *, 4> clang::StoredDeclsList::DeclsTy |
When in vector form, this is what the Data pointer points to.
Definition at line 35 of file DeclContextInternals.h.
clang::StoredDeclsList::StoredDeclsList | ( | ) | [inline] |
Definition at line 47 of file DeclContextInternals.h.
Referenced by removeExternalDecls().
clang::StoredDeclsList::StoredDeclsList | ( | StoredDeclsList && | RHS | ) | [inline] |
Definition at line 49 of file DeclContextInternals.h.
clang::StoredDeclsList::~StoredDeclsList | ( | ) | [inline] |
Definition at line 53 of file DeclContextInternals.h.
References getAsVector().
void clang::StoredDeclsList::AddSubsequentDecl | ( | NamedDecl * | D | ) | [inline] |
AddSubsequentDecl - This is called on the second and later decl when it is not a redeclaration to merge it into the appropriate place in our list.
Definition at line 192 of file DeclContextInternals.h.
References Data, getAsDecl(), getAsVector(), clang::Decl::getIdentifierNamespace(), clang::Decl::hasTagIdentifierNamespace(), clang::Decl::IDNS_Using, and isNull().
Referenced by clang::ExternalASTSource::SetExternalVisibleDeclsForName().
NamedDecl* clang::StoredDeclsList::getAsDecl | ( | ) | const [inline] |
Definition at line 69 of file DeclContextInternals.h.
References Data.
Referenced by AddSubsequentDecl(), getLookupResult(), HandleRedeclaration(), remove(), removeExternalDecls(), and setHasExternalDecls().
DeclsTy* clang::StoredDeclsList::getAsVector | ( | ) | const [inline] |
Definition at line 77 of file DeclContextInternals.h.
References getAsVectorAndHasExternal().
Referenced by AddSubsequentDecl(), getLookupResult(), HandleRedeclaration(), operator=(), remove(), removeExternalDecls(), setHasExternalDecls(), setOnlyValue(), and ~StoredDeclsList().
DeclsAndHasExternalTy clang::StoredDeclsList::getAsVectorAndHasExternal | ( | ) | const [inline] |
Definition at line 73 of file DeclContextInternals.h.
References Data.
Referenced by getAsVector(), and hasExternalDecls().
getLookupResult - Return an array of all the decls that this list represents.
Definition at line 143 of file DeclContextInternals.h.
References Data, getAsDecl(), getAsVector(), and isNull().
Referenced by clang::ExternalASTSource::SetExternalVisibleDeclsForName().
bool clang::StoredDeclsList::HandleRedeclaration | ( | NamedDecl * | D | ) | [inline] |
HandleRedeclaration - If this is a redeclaration of an existing decl, replace the old one with D and return true. Otherwise return false.
Definition at line 166 of file DeclContextInternals.h.
References clang::NamedDecl::declarationReplaces(), getAsDecl(), getAsVector(), and setOnlyValue().
Referenced by clang::ExternalASTSource::SetExternalVisibleDeclsForName().
bool clang::StoredDeclsList::hasExternalDecls | ( | ) | const [inline] |
Definition at line 81 of file DeclContextInternals.h.
References getAsVectorAndHasExternal().
bool clang::StoredDeclsList::isNull | ( | ) | const [inline] |
Definition at line 67 of file DeclContextInternals.h.
References Data.
Referenced by AddSubsequentDecl(), getLookupResult(), remove(), removeExternalDecls(), and clang::ExternalASTSource::SetExternalVisibleDeclsForName().
StoredDeclsList& clang::StoredDeclsList::operator= | ( | StoredDeclsList && | RHS | ) | [inline] |
Definition at line 59 of file DeclContextInternals.h.
References Data, and getAsVector().
void clang::StoredDeclsList::remove | ( | NamedDecl * | D | ) | [inline] |
Definition at line 105 of file DeclContextInternals.h.
References Data, getAsDecl(), getAsVector(), and isNull().
void clang::StoredDeclsList::removeExternalDecls | ( | ) | [inline] |
Remove any declarations which were imported from an external AST source.
Definition at line 125 of file DeclContextInternals.h.
References Data, getAsDecl(), getAsVector(), clang::Decl::isFromASTFile(), isNull(), and StoredDeclsList().
Referenced by clang::ExternalASTSource::SetExternalVisibleDeclsForName().
void clang::StoredDeclsList::setHasExternalDecls | ( | ) | [inline] |
Definition at line 85 of file DeclContextInternals.h.
References Data, getAsDecl(), and getAsVector().
void clang::StoredDeclsList::setOnlyValue | ( | NamedDecl * | ND | ) | [inline] |
Definition at line 96 of file DeclContextInternals.h.
References Data, and getAsVector().
Referenced by HandleRedeclaration(), and clang::ExternalASTSource::SetExternalVisibleDeclsForName().
llvm::PointerUnion<NamedDecl*, DeclsAndHasExternalTy> clang::StoredDeclsList::Data |
The stored data, which will be either a pointer to a NamedDecl, or a pointer to a vector with a flag to indicate if there are further external declarations.
Definition at line 44 of file DeclContextInternals.h.
Referenced by AddSubsequentDecl(), getAsDecl(), getAsVectorAndHasExternal(), getLookupResult(), isNull(), operator=(), remove(), removeExternalDecls(), setHasExternalDecls(), and setOnlyValue().