clang  14.0.0git
Public Member Functions | List of all members
clang::StoredDeclsList Class Reference

An array of decls optimized for the common case of only containing one entry. More...

#include "clang/AST/DeclContextInternals.h"

Public Member Functions

 StoredDeclsList ()=default
 
 StoredDeclsList (StoredDeclsList &&RHS)
 
void MaybeDeallocList ()
 
 ~StoredDeclsList ()
 
StoredDeclsListoperator= (StoredDeclsList &&RHS)
 
bool isNull () const
 
ASTContextgetASTContext ()
 
DeclsAndHasExternalTy getAsListAndHasExternal () const
 
NamedDeclgetAsDecl () const
 
DeclListNodegetAsList () const
 
bool hasExternalDecls () const
 
void setHasExternalDecls ()
 
void remove (NamedDecl *D)
 
void removeExternalDecls ()
 Remove any declarations which were imported from an external AST source. More...
 
void replaceExternalDecls (ArrayRef< NamedDecl * > Decls)
 
DeclContext::lookup_result getLookupResult () const
 Return an array of all the decls that this list represents. More...
 
void addOrReplaceDecl (NamedDecl *D)
 If this is a redeclaration of an existing decl, replace the old one with D. More...
 
void prependDeclNoReplace (NamedDecl *D)
 Add a declaration to the list without checking if it replaces anything. More...
 
LLVM_DUMP_METHOD void dump () const
 

Detailed Description

An array of decls optimized for the common case of only containing one entry.

Definition at line 33 of file DeclContextInternals.h.

Constructor & Destructor Documentation

◆ StoredDeclsList() [1/2]

clang::StoredDeclsList::StoredDeclsList ( )
default

◆ StoredDeclsList() [2/2]

clang::StoredDeclsList::StoredDeclsList ( StoredDeclsList &&  RHS)
inline

Definition at line 91 of file DeclContextInternals.h.

◆ ~StoredDeclsList()

clang::StoredDeclsList::~StoredDeclsList ( )
inline

Definition at line 108 of file DeclContextInternals.h.

References MaybeDeallocList().

Member Function Documentation

◆ addOrReplaceDecl()

void clang::StoredDeclsList::addOrReplaceDecl ( NamedDecl D)
inline

If this is a redeclaration of an existing decl, replace the old one with D.

Otherwise, append D.

Definition at line 215 of file DeclContextInternals.h.

References clang::NamedDecl::declarationReplaces(), getAsDecl(), getAsList(), clang::Decl::getASTContext(), getLookupResult(), isNull(), and Node.

◆ dump()

LLVM_DUMP_METHOD void clang::StoredDeclsList::dump ( ) const
inline

Definition at line 277 of file DeclContextInternals.h.

References Node.

◆ getAsDecl()

NamedDecl* clang::StoredDeclsList::getAsDecl ( ) const
inline

Definition at line 132 of file DeclContextInternals.h.

References getAsListAndHasExternal().

Referenced by addOrReplaceDecl(), and getASTContext().

◆ getAsList()

DeclListNode* clang::StoredDeclsList::getAsList ( ) const
inline

Definition at line 136 of file DeclContextInternals.h.

References getAsListAndHasExternal().

Referenced by addOrReplaceDecl(), and getASTContext().

◆ getAsListAndHasExternal()

DeclsAndHasExternalTy clang::StoredDeclsList::getAsListAndHasExternal ( ) const
inline

Definition at line 130 of file DeclContextInternals.h.

Referenced by getAsDecl(), getAsList(), and hasExternalDecls().

◆ getASTContext()

ASTContext& clang::StoredDeclsList::getASTContext ( )
inline

Definition at line 123 of file DeclContextInternals.h.

References getAsDecl(), getAsList(), clang::Decl::getASTContext(), and isNull().

Referenced by MaybeDeallocList().

◆ getLookupResult()

DeclContext::lookup_result clang::StoredDeclsList::getLookupResult ( ) const
inline

Return an array of all the decls that this list represents.

Definition at line 209 of file DeclContextInternals.h.

Referenced by addOrReplaceDecl().

◆ hasExternalDecls()

bool clang::StoredDeclsList::hasExternalDecls ( ) const
inline

Definition at line 140 of file DeclContextInternals.h.

References getAsListAndHasExternal().

◆ isNull()

bool clang::StoredDeclsList::isNull ( ) const
inline

◆ MaybeDeallocList()

void clang::StoredDeclsList::MaybeDeallocList ( )
inline

Definition at line 96 of file DeclContextInternals.h.

References getASTContext(), and isNull().

Referenced by operator=(), and ~StoredDeclsList().

◆ operator=()

StoredDeclsList& clang::StoredDeclsList::operator= ( StoredDeclsList &&  RHS)
inline

Definition at line 112 of file DeclContextInternals.h.

References MaybeDeallocList().

◆ prependDeclNoReplace()

void clang::StoredDeclsList::prependDeclNoReplace ( NamedDecl D)
inline

Add a declaration to the list without checking if it replaces anything.

Definition at line 265 of file DeclContextInternals.h.

References clang::Decl::getASTContext(), isNull(), and Node.

◆ remove()

void clang::StoredDeclsList::remove ( NamedDecl D)
inline

Definition at line 148 of file DeclContextInternals.h.

References isNull().

◆ removeExternalDecls()

void clang::StoredDeclsList::removeExternalDecls ( )
inline

Remove any declarations which were imported from an external AST source.

Definition at line 154 of file DeclContextInternals.h.

References clang::Decl::isFromASTFile().

◆ replaceExternalDecls()

void clang::StoredDeclsList::replaceExternalDecls ( ArrayRef< NamedDecl * >  Decls)
inline

Definition at line 161 of file DeclContextInternals.h.

References clang::for(), clang::Decl::isFromASTFile(), and Node.

◆ setHasExternalDecls()

void clang::StoredDeclsList::setHasExternalDecls ( )
inline

Definition at line 144 of file DeclContextInternals.h.


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