clang 10.0.0git

Public Types | Public Member Functions | Public Attributes | List of all members
clang::StoredDeclsList Struct Reference

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

`#include "clang/AST/DeclContextInternals.h"`

Collaboration diagram for clang::StoredDeclsList:
[legend]

## Public Types
using | DeclsTy = SmallVector< NamedDecl *, 4 >
| When in vector form, this is what the Data pointer points to. More...
using | DeclsAndHasExternalTy = llvm::PointerIntPair< DeclsTy *, 1, bool >
| A collection of declarations, with a flag to indicate if we have further external declarations. More...

## Public Member Functions
| StoredDeclsList ()=default
| 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. More...
DeclContext::lookup_result | getLookupResult ()
| getLookupResult - Return an array of all the decls that this list represents. More...
bool | HandleRedeclaration (NamedDecl *D, bool IsKnownNewer)
| HandleRedeclaration - If this is a redeclaration of an existing decl, replace the old one with D and return true. More...
void | AddSubsequentDecl (NamedDecl *D)
| 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. More...

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

## Detailed Description

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

Definition at line 34 of file DeclContextInternals.h.

## Member Typedef Documentation

## ◆ DeclsAndHasExternalTy

using clang::StoredDeclsList::DeclsAndHasExternalTy = llvm::PointerIntPair<DeclsTy *, 1, bool>

A collection of declarations, with a flag to indicate if we have further external declarations.

Definition at line 40 of file DeclContextInternals.h.

## ◆ DeclsTy

using clang::StoredDeclsList::DeclsTy = SmallVector<NamedDecl *, 4>

When in vector form, this is what the Data pointer points to.

Definition at line 36 of file DeclContextInternals.h.

## Constructor & Destructor Documentation

## ◆ StoredDeclsList() [1/2]

clang::StoredDeclsList::StoredDeclsList | ( |  | ) |
| default

Referenced by removeExternalDecls().

## ◆ StoredDeclsList() [2/2]

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

Definition at line 50 of file DeclContextInternals.h.

## ◆ ~StoredDeclsList()

clang::StoredDeclsList::~StoredDeclsList | ( |  | ) |
| inline

Definition at line 54 of file DeclContextInternals.h.

References getAsVector().

## Member Function Documentation

## ◆ AddSubsequentDecl()

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 189 of file DeclContextInternals.h.

References getAsDecl(), getAsVector(), clang::Decl::getIdentifierNamespace(), clang::Decl::hasTagIdentifierNamespace(), clang::Decl::IDNS_Using, and isNull().

Referenced by clang::DeclContext::makeDeclVisibleInContext().

## ◆ getAsDecl()

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

Definition at line 70 of file DeclContextInternals.h.

Referenced by AddSubsequentDecl(), getLookupResult(), HandleRedeclaration(), remove(), removeExternalDecls(), and setHasExternalDecls().

## ◆ getAsVector()

DeclsTy* clang::StoredDeclsList::getAsVector | ( |  | ) | const
| inline

Definition at line 78 of file DeclContextInternals.h.

References getAsVectorAndHasExternal().

Referenced by AddSubsequentDecl(), getLookupResult(), HandleRedeclaration(), operator=(), remove(), removeExternalDecls(), setHasExternalDecls(), setOnlyValue(), and ~StoredDeclsList().

## ◆ getAsVectorAndHasExternal()

DeclsAndHasExternalTy clang::StoredDeclsList::getAsVectorAndHasExternal | ( |  | ) | const
| inline

Definition at line 74 of file DeclContextInternals.h.

Referenced by getAsVector(), and hasExternalDecls().

## ◆ getLookupResult()

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

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

Definition at line 143 of file DeclContextInternals.h.

References getAsDecl(), getAsVector(), and isNull().

## ◆ HandleRedeclaration()

bool clang::StoredDeclsList::HandleRedeclaration | ( | NamedDecl * | D,
|  | bool | IsKnownNewer
| ) |  |
| 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 164 of file DeclContextInternals.h.

References clang::NamedDecl::declarationReplaces(), getAsDecl(), getAsVector(), and setOnlyValue().

Referenced by clang::DeclContext::makeDeclVisibleInContext().

## ◆ hasExternalDecls()

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

Definition at line 82 of file DeclContextInternals.h.

References getAsVectorAndHasExternal().

## ◆ isNull()

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

Definition at line 68 of file DeclContextInternals.h.

Referenced by AddSubsequentDecl(), getLookupResult(), clang::DeclContext::makeDeclVisibleInContext(), remove(), and removeExternalDecls().

## ◆ operator=()

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

Definition at line 60 of file DeclContextInternals.h.

References Data, and getAsVector().

## ◆ remove()

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

Definition at line 106 of file DeclContextInternals.h.

References getAsDecl(), getAsVector(), and isNull().

## ◆ removeExternalDecls()

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 getAsDecl(), getAsVector(), isNull(), and StoredDeclsList().

## ◆ setHasExternalDecls()

void clang::StoredDeclsList::setHasExternalDecls | ( |  | ) |
| inline

Definition at line 86 of file DeclContextInternals.h.

References getAsDecl(), and getAsVector().

Referenced by clang::DeclContext::makeDeclVisibleInContext().

## ◆ setOnlyValue()

void clang::StoredDeclsList::setOnlyValue | ( | NamedDecl * | ND | ) |
| inline

Definition at line 97 of file DeclContextInternals.h.

References getAsVector().

Referenced by HandleRedeclaration(), and clang::DeclContext::makeDeclVisibleInContext().

## Member Data Documentation

## ◆ Data

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 45 of file DeclContextInternals.h.

Referenced by operator=().

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

- include/clang/AST/DeclContextInternals.h