clang 10.0.0git

Functions
IndexingContext.cpp File Reference
`#include "IndexingContext.h"`
`#include "clang/AST/ASTContext.h"`
`#include "clang/AST/Attr.h"`
`#include "clang/AST/DeclObjC.h"`
`#include "clang/AST/DeclTemplate.h"`
`#include "clang/Basic/SourceLocation.h"`
`#include "clang/Basic/SourceManager.h"`
`#include "clang/Index/IndexDataConsumer.h"`
Include dependency graph for IndexingContext.cpp:

Go to the source code of this file.

## Functions
static bool | isGeneratedDecl (const Decl *D)
static void | reportModuleReferences (const Module *Mod, ArrayRef< SourceLocation > IdLocs, const ImportDecl *ImportD, IndexDataConsumer &DataConsumer)
static const CXXRecordDecl * | getDeclContextForTemplateInstationPattern (const Decl *D)
static const Decl * | adjustTemplateImplicitInstantiation (const Decl *D)
static bool | isDeclADefinition (const Decl *D, const DeclContext *ContainerDC, ASTContext &Ctx)
static bool | shouldSkipNamelessDecl (const NamedDecl *ND)
| Whether the given NamedDecl should be skipped because it has no name. More...
static const Decl * | adjustParent (const Decl *Parent)
static const Decl * | getCanonicalDecl (const Decl *D)
static bool | shouldReportOccurrenceForSystemDeclOnlyMode (bool IsRef, SymbolRoleSet Roles, ArrayRef< SymbolRelation > Relations)

## Function Documentation

## ◆ adjustParent()

static const Decl* adjustParent | ( | const Decl * | Parent | ) |
| static

Definition at line 270 of file IndexingContext.cpp.

References clang::Decl::getDeclContext(), Parent, and shouldSkipNamelessDecl().

Referenced by shouldReportOccurrenceForSystemDeclOnlyMode().

## ◆ adjustTemplateImplicitInstantiation()

static const Decl* adjustTemplateImplicitInstantiation | ( | const Decl * | D | ) |
| static

Definition at line 206 of file IndexingContext.cpp.

References getDeclContextForTemplateInstationPattern(), and clang::EnumDecl::getInstantiatedFromMemberEnum().

Referenced by shouldReportOccurrenceForSystemDeclOnlyMode().

## ◆ getCanonicalDecl()

static const Decl* getCanonicalDecl | ( | const Decl * | D | ) |
| static

Definition at line 292 of file IndexingContext.cpp.

References clang::Decl::getCanonicalDecl(), and clang::Decl::isCanonicalDecl().

Referenced by areSortedAndUniqued(), clang::Sema::CheckQualifiedMemberReference(), clang::NamedDecl::declarationReplaces(), clang::CodeGen::emitDeclareSimdFunction(), clang::CodeGen::CodeGenFunction::EmitOMPFirstprivateClause(), clang::CodeGen::CodeGenFunction::EmitOMPLastprivateClauseInit(), clang::CodeGen::CodeGenFunction::EmitOMPLinearClause(), clang::CodeGen::CodeGenVTables::EmitThunks(), clang::CodeGen::CGOpenMPRuntimeNVPTX::getAddressOfLocalVariable(), clang::ObjCMethodDecl::getCanonicalDecl(), clang::ASTReader::getOwningModuleNameForDiagnostic(), getThreadLocalWrapperLinkage(), clang::CXXRecordDecl::isDerivedFrom(), clang::CXXRecordDecl::isVirtuallyDerivedFrom(), and shouldReportOccurrenceForSystemDeclOnlyMode().

## ◆ getDeclContextForTemplateInstationPattern()

static const CXXRecordDecl* getDeclContextForTemplateInstationPattern | ( | const Decl * | D | ) |
| static

Definition at line 197 of file IndexingContext.cpp.

References clang::Decl::getDeclContext(), clang::CXXRecordDecl::getInstantiatedFromMemberClass(), and clang::CXXRecordDecl::getTemplateInstantiationPattern().

Referenced by adjustTemplateImplicitInstantiation().

## ◆ isDeclADefinition()

static bool isDeclADefinition | ( | const Decl * | D,
|  | const DeclContext * | ContainerDC,
|  | ASTContext & | Ctx
| ) |  |
| static

Definition at line 240 of file IndexingContext.cpp.

Referenced by shouldReportOccurrenceForSystemDeclOnlyMode().

## ◆ isGeneratedDecl()

static bool isGeneratedDecl | ( | const Decl * | D | ) |
| static

Definition at line 21 of file IndexingContext.cpp.

References clang::Decl::getAttr().

Referenced by clang::index::IndexingContext::shouldIndex().

## ◆ reportModuleReferences()

static void reportModuleReferences | ( | const Module * | Mod,
|  | ArrayRef< SourceLocation > | IdLocs,
|  | const ImportDecl * | ImportD,
|  | IndexDataConsumer & | DataConsumer
| ) |  |
| static

Definition at line 94 of file IndexingContext.cpp.

References clang::index::IndexDataConsumer::handleModuleOccurrence(), clang::Module::Parent, and clang::index::Reference.

Referenced by clang::index::IndexingContext::importedModule().

## ◆ shouldReportOccurrenceForSystemDeclOnlyMode()

static bool shouldReportOccurrenceForSystemDeclOnlyMode | ( | bool | IsRef,
|  | SymbolRoleSet | Roles,
|  | ArrayRef< SymbolRelation > | Relations
| ) |  |
| static

Definition at line 304 of file IndexingContext.cpp.

References clang::index::AddressOf, adjustParent(), adjustTemplateImplicitInstantiation(), clang::index::IndexingOptions::All, clang::index::applyForEachSymbolRoleInterruptible(), clang::SrcMgr::C_User, clang::index::Call, clang::index::Declaration, clang::index::IndexingOptions::DeclarationsOnly, clang::index::Definition, clang::index::Dynamic, getCanonicalDecl(), clang::SrcMgr::SLocEntry::getFile(), clang::SrcMgr::FileInfo::getFileCharacteristic(), clang::SourceManager::getFileID(), clang::SourceManager::getFileLoc(), clang::SourceManager::getSLocEntry(), clang::ASTContext::getSourceManager(), clang::index::IndexDataConsumer::handleDeclOccurrence(), clang::index::Implicit, isDeclADefinition(), clang::SrcMgr::SLocEntry::isFile(), clang::index::isFunctionLocalSymbol(), clang::Decl::isImplicit(), clang::FileID::isInvalid(), clang::index::IndexingContext::isTemplateImplicitInstantiation(), clang::index::NameReference, Node, clang::index::IndexingOptions::None, Parent, clang::index::Read, clang::index::Reference, clang::index::SymbolRelation::RelatedSymbol, clang::index::RelationAccessorOf, clang::index::RelationBaseOf, clang::index::RelationCalledBy, clang::index::RelationChildOf, clang::index::RelationContainedBy, clang::index::RelationExtendedBy, clang::index::RelationIBTypeOf, clang::index::RelationOverrideOf, clang::index::RelationReceivedBy, clang::index::RelationSpecializationOf, shouldSkipNamelessDecl(), SM, clang::index::IndexingOptions::SystemSymbolFilter, clang::index::Undefinition, and clang::index::Write.

## ◆ shouldSkipNamelessDecl()

static bool shouldSkipNamelessDecl | ( | const NamedDecl * | ND | ) |
| static

Whether the given NamedDecl should be skipped because it has no name.

Definition at line 265 of file IndexingContext.cpp.

References clang::NamedDecl::getDeclName(), and clang::DeclarationName::isEmpty().

Referenced by adjustParent(), and shouldReportOccurrenceForSystemDeclOnlyMode().