clang 10.0.0git

Public Member Functions | List of all members
clang::VisibleDeclConsumer Class Referenceabstract

Consumes visible declarations found when searching for all visible names within a given scope or context. More...

`#include "clang/Sema/Lookup.h"`

Inheritance diagram for clang::VisibleDeclConsumer:
[legend]

## Public Member Functions
virtual | ~VisibleDeclConsumer ()
| Destroys the visible declaration consumer. More...
virtual bool | includeHiddenDecls () const
| Determine whether hidden declarations (from unimported modules) should be given to this consumer. More...
virtual void | FoundDecl (NamedDecl *ND, NamedDecl *Hiding, DeclContext *Ctx, bool InBaseClass)=0
| Invoked each time `Sema::LookupVisibleDecls()` finds a declaration visible from the current scope or context. More...
virtual void | EnteredContext (DeclContext *Ctx)
| Callback to inform the client that Sema entered into a new context to find a visible declaration. More...

## Detailed Description

Consumes visible declarations found when searching for all visible names within a given scope or context.

This abstract class is meant to be subclassed by clients of `Sema::LookupVisibleDecls()`, each of which should override the `FoundDecl()` function to process declarations as they are found.

Definition at line 765 of file Lookup.h.

## Constructor & Destructor Documentation

## ◆ ~VisibleDeclConsumer()

VisibleDeclConsumer::~VisibleDeclConsumer | ( |  | ) |
| virtual

Destroys the visible declaration consumer.

Definition at line 3624 of file SemaLookup.cpp.

## Member Function Documentation

## ◆ EnteredContext()

virtual void clang::VisibleDeclConsumer::EnteredContext | ( | DeclContext * | Ctx | ) |
| inline virtual

Callback to inform the client that Sema entered into a new context to find a visible declaration.

Parameters

  Ctx | the context which Sema entered.

Definition at line 794 of file Lookup.h.

## ◆ FoundDecl()

virtual void clang::VisibleDeclConsumer::FoundDecl | ( | NamedDecl * | ND,
|  | NamedDecl * | Hiding,
|  | DeclContext * | Ctx,
|  | bool | InBaseClass
| ) |  |
| pure virtual

Invoked each time `Sema::LookupVisibleDecls()` finds a declaration visible from the current scope or context.

Parameters

  ND | the declaration found.
  Hiding | a declaration that hides the declaration `ND`, or NULL if no such declaration exists.
  Ctx | the original context from which the lookup started.
  InBaseClass | whether this declaration was found in base class of the context we searched.

Implemented in clang::TypoCorrectionConsumer.

## ◆ includeHiddenDecls()

bool VisibleDeclConsumer::includeHiddenDecls | ( |  | ) | const
| virtual

Determine whether hidden declarations (from unimported modules) should be given to this consumer.

By default, they are not included.

Reimplemented in clang::TypoCorrectionConsumer.

Definition at line 3626 of file SemaLookup.cpp.

References clang::NamedDecl::getDeclName(), clang::Decl::getIdentifierNamespace(), clang::NamedDecl::getUnderlyingDecl(), clang::Decl::hasTagIdentifierNamespace(), clang::Decl::IDNS_Member, clang::Decl::IDNS_ObjCProtocol, clang::Decl::IDNS_Ordinary, clang::Decl::isFunctionOrFunctionTemplate(), and SM.

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

- include/clang/Sema/Lookup.h
- lib/Sema/SemaLookup.cpp