clang 10.0.0git

Public Member Functions | Static Public Member Functions | List of all members
clang::index::IndexingContext Class Reference

`#include "/work/www-prereleases/10.0.0/rc1/docsbuild/clang/lib/Index/IndexingContext.h"`

## Public Member Functions
| IndexingContext (IndexingOptions IndexOpts, IndexDataConsumer &DataConsumer)
const IndexingOptions & | getIndexOpts () const
IndexDataConsumer & | getDataConsumer ()
void | setASTContext (ASTContext &ctx)
bool | shouldIndex (const Decl *D)
const LangOptions & | getLangOpts () const
bool | shouldSuppressRefs () const
bool | shouldIndexFunctionLocalSymbols () const
bool | shouldIndexImplicitInstantiation () const
bool | shouldIndexParametersInDeclarations () const
bool | shouldIndexTemplateParameters () const
bool | handleDecl (const Decl *D, SymbolRoleSet Roles=SymbolRoleSet(), ArrayRef< SymbolRelation > Relations=None)
bool | handleDecl (const Decl *D, SourceLocation Loc, SymbolRoleSet Roles=SymbolRoleSet(), ArrayRef< SymbolRelation > Relations=None, const DeclContext *DC=nullptr)
bool | handleReference (const NamedDecl *D, SourceLocation Loc, const NamedDecl *Parent, const DeclContext *DC, SymbolRoleSet Roles=SymbolRoleSet(), ArrayRef< SymbolRelation > Relations=None, const Expr *RefE=nullptr, const Decl *RefD=nullptr)
void | handleMacroDefined (const IdentifierInfo &Name, SourceLocation Loc, const MacroInfo &MI)
void | handleMacroUndefined (const IdentifierInfo &Name, SourceLocation Loc, const MacroInfo &MI)
void | handleMacroReference (const IdentifierInfo &Name, SourceLocation Loc, const MacroInfo &MD)
bool | importedModule (const ImportDecl *ImportD)
bool | indexDecl (const Decl *D)
void | indexTagDecl (const TagDecl *D, ArrayRef< SymbolRelation > Relations=None)
void | indexTypeSourceInfo (TypeSourceInfo *TInfo, const NamedDecl *Parent, const DeclContext *DC=nullptr, bool isBase=false, bool isIBType=false)
void | indexTypeLoc (TypeLoc TL, const NamedDecl *Parent, const DeclContext *DC=nullptr, bool isBase=false, bool isIBType=false)
void | indexNestedNameSpecifierLoc (NestedNameSpecifierLoc NNS, const NamedDecl *Parent, const DeclContext *DC=nullptr)
bool | indexDeclContext (const DeclContext *DC)
void | indexBody (const Stmt *S, const NamedDecl *Parent, const DeclContext *DC=nullptr)
bool | indexTopLevelDecl (const Decl *D)
bool | indexDeclGroupRef (DeclGroupRef DG)

## Static Public Member Functions
static bool | isTemplateImplicitInstantiation (const Decl *D)

## Detailed Description

Definition at line 38 of file IndexingContext.h.

## Constructor & Destructor Documentation

## ◆ IndexingContext()

clang::index::IndexingContext::IndexingContext | ( | IndexingOptions | IndexOpts,
|  | IndexDataConsumer & | DataConsumer
| ) |  |
| inline

Definition at line 44 of file IndexingContext.h.

## Member Function Documentation

## ◆ getDataConsumer()

IndexDataConsumer& clang::index::IndexingContext::getDataConsumer | ( |  | ) |
| inline

Definition at line 48 of file IndexingContext.h.

## ◆ getIndexOpts()

const IndexingOptions& clang::index::IndexingContext::getIndexOpts | ( |  | ) | const
| inline

Definition at line 47 of file IndexingContext.h.

## ◆ getLangOpts()

const LangOptions & IndexingContext::getLangOpts | ( |  | ) | const

Definition at line 32 of file IndexingContext.cpp.

References clang::ASTContext::getLangOpts().

Referenced by setASTContext().

## ◆ handleDecl() [1/2]

bool IndexingContext::handleDecl | ( | const Decl * | D,
|  | SymbolRoleSet | Roles = `SymbolRoleSet()`,
|  | ArrayRef< SymbolRelation > | Relations = `None`
| ) |  |

Definition at line 52 of file IndexingContext.cpp.

References clang::Decl::getLocation().

Referenced by shouldSuppressRefs().

## ◆ handleDecl() [2/2]

bool IndexingContext::handleDecl | ( | const Decl * | D,
|  | SourceLocation | Loc,
|  | SymbolRoleSet | Roles = `SymbolRoleSet()`,
|  | ArrayRef< SymbolRelation > | Relations = `None`,
|  | const DeclContext * | DC = `nullptr`
| ) |  |

Definition at line 58 of file IndexingContext.cpp.

References clang::Decl::getDeclContext().

## ◆ handleMacroDefined()

void IndexingContext::handleMacroDefined | ( | const IdentifierInfo & | Name,
|  | SourceLocation | Loc,
|  | const MacroInfo & | MI
| ) |  |

Definition at line 448 of file IndexingContext.cpp.

Referenced by shouldSuppressRefs().

## ◆ handleMacroReference()

void IndexingContext::handleMacroReference | ( | const IdentifierInfo & | Name,
|  | SourceLocation | Loc,
|  | const MacroInfo & | MD
| ) |  |

Definition at line 462 of file IndexingContext.cpp.

## ◆ handleMacroUndefined()

void IndexingContext::handleMacroUndefined | ( | const IdentifierInfo & | Name,
|  | SourceLocation | Loc,
|  | const MacroInfo & | MI
| ) |  |

Definition at line 455 of file IndexingContext.cpp.

## ◆ handleReference()

bool IndexingContext::handleReference | ( | const NamedDecl * | D,
|  | SourceLocation | Loc,
|  | const NamedDecl * | Parent,
|  | const DeclContext * | DC,
|  | SymbolRoleSet | Roles = `SymbolRoleSet()`,
|  | ArrayRef< SymbolRelation > | Relations = `None`,
|  | const Expr * | RefE = `nullptr`,
|  | const Decl * | RefD = `nullptr`
| ) |  |

Definition at line 74 of file IndexingContext.cpp.

References clang::index::isFunctionLocalSymbol(), shouldIndexFunctionLocalSymbols(), and shouldIndexTemplateParameters().

Referenced by shouldSuppressRefs().

## ◆ importedModule()

bool IndexingContext::importedModule | ( | const ImportDecl * | ImportD | ) |

Definition at line 106 of file IndexingContext.cpp.

References clang::index::IndexingOptions::All, clang::SrcMgr::C_User, clang::index::Declaration, clang::index::IndexingOptions::DeclarationsOnly, clang::SrcMgr::SLocEntry::getFile(), clang::SrcMgr::FileInfo::getFileCharacteristic(), clang::SourceManager::getFileID(), clang::SourceManager::getFileLoc(), clang::ImportDecl::getIdentifierLocs(), clang::ImportDecl::getImportedModule(), clang::Decl::getLocation(), clang::SourceManager::getSLocEntry(), clang::ASTContext::getSourceManager(), clang::index::IndexDataConsumer::handleModuleOccurrence(), clang::index::Implicit, clang::SrcMgr::SLocEntry::isFile(), clang::Decl::isImplicit(), clang::FileID::isInvalid(), clang::Decl::isInvalidDecl(), clang::index::IndexingOptions::None, clang::Module::Parent, reportModuleReferences(), SM, and clang::index::IndexingOptions::SystemSymbolFilter.

## ◆ indexBody()

void IndexingContext::indexBody | ( | const Stmt * | S,
|  | const NamedDecl * | Parent,
|  | const DeclContext * | DC = `nullptr`
| ) |  |

Definition at line 471 of file IndexBody.cpp.

References clang::Decl::getLexicalDeclContext().

## ◆ indexDecl()

bool IndexingContext::indexDecl | ( | const Decl * | D | ) |

Definition at line 731 of file IndexDecl.cpp.

References clang::Decl::isImplicit().

## ◆ indexDeclContext()

bool IndexingContext::indexDeclContext | ( | const DeclContext * | DC | ) |

Definition at line 749 of file IndexDecl.cpp.

References clang::DeclContext::decls().

## ◆ indexDeclGroupRef()

bool IndexingContext::indexDeclGroupRef | ( | DeclGroupRef | DG | ) |

Definition at line 766 of file IndexDecl.cpp.

References clang::DeclGroupRef::begin(), and clang::DeclGroupRef::end().

## ◆ indexNestedNameSpecifierLoc()

void IndexingContext::indexNestedNameSpecifierLoc | ( | NestedNameSpecifierLoc | NNS,
|  | const NamedDecl * | Parent,
|  | const DeclContext * | DC = `nullptr`
| ) |  |

Definition at line 233 of file IndexTypeSourceInfo.cpp.

References clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::NestedNameSpecifier::getKind(), clang::Decl::getLexicalDeclContext(), clang::NestedNameSpecifierLoc::getLocalBeginLoc(), clang::NestedNameSpecifierLoc::getNestedNameSpecifier(), clang::NestedNameSpecifierLoc::getPrefix(), clang::NestedNameSpecifierLoc::getTypeLoc(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, Parent, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.

## ◆ indexTagDecl()

void IndexingContext::indexTagDecl | ( | const TagDecl * | D,
|  | ArrayRef< SymbolRelation > | Relations = `None`
| ) |  |

Definition at line 268 of file IndexTypeSourceInfo.cpp.

References clang::TagDecl::getQualifierLoc(), clang::index::isFunctionLocalSymbol(), and clang::TagDecl::isThisDeclarationADefinition().

## ◆ indexTopLevelDecl()

bool IndexingContext::indexTopLevelDecl | ( | const Decl * | D | ) |

Definition at line 756 of file IndexDecl.cpp.

References clang::Decl::getLocation(), and clang::SourceLocation::isInvalid().

Referenced by clang::index::indexModuleFile(), clang::index::indexTopLevelDecls(), and topLevelDeclVisitor().

## ◆ indexTypeLoc()

void IndexingContext::indexTypeLoc | ( | TypeLoc | TL,
|  | const NamedDecl * | Parent,
|  | const DeclContext * | DC = `nullptr`,
|  | bool | isBase = `false`,
|  | bool | isIBType = `false`
| ) |  |

Definition at line 220 of file IndexTypeSourceInfo.cpp.

References clang::Decl::getLexicalDeclContext(), and clang::TypeLoc::isNull().

## ◆ indexTypeSourceInfo()

void IndexingContext::indexTypeSourceInfo | ( | TypeSourceInfo * | TInfo,
|  | const NamedDecl * | Parent,
|  | const DeclContext * | DC = `nullptr`,
|  | bool | isBase = `false`,
|  | bool | isIBType = `false`
| ) |  |

Definition at line 209 of file IndexTypeSourceInfo.cpp.

References clang::TypeSourceInfo::getTypeLoc(), clang::TypeLoc::isNull(), and Parent.

## ◆ isTemplateImplicitInstantiation()

bool IndexingContext::isTemplateImplicitInstantiation | ( | const Decl * | D | ) |
| static

Definition at line 150 of file IndexingContext.cpp.

References clang::Decl::getDeclContext(), Parent, clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.

Referenced by shouldReportOccurrenceForSystemDeclOnlyMode(), and shouldSuppressRefs().

## ◆ setASTContext()

void clang::index::IndexingContext::setASTContext | ( | ASTContext & | ctx | ) |
| inline

Definition at line 50 of file IndexingContext.h.

References getLangOpts(), and shouldIndex().

Referenced by clang::index::indexASTUnit(), clang::index::indexModuleFile(), and clang::index::indexTopLevelDecls().

## ◆ shouldIndex()

bool IndexingContext::shouldIndex | ( | const Decl * | D | ) |

Definition at line 28 of file IndexingContext.cpp.

References isGeneratedDecl().

Referenced by setASTContext().

## ◆ shouldIndexFunctionLocalSymbols()

bool IndexingContext::shouldIndexFunctionLocalSymbols | ( |  | ) | const

Definition at line 36 of file IndexingContext.cpp.

References clang::index::IndexingOptions::IndexFunctionLocals.

Referenced by handleReference(), and shouldSuppressRefs().

## ◆ shouldIndexImplicitInstantiation()

bool IndexingContext::shouldIndexImplicitInstantiation | ( |  | ) | const

Definition at line 40 of file IndexingContext.cpp.

References clang::index::IndexingOptions::IndexImplicitInstantiation.

Referenced by shouldSuppressRefs().

## ◆ shouldIndexParametersInDeclarations()

bool IndexingContext::shouldIndexParametersInDeclarations | ( |  | ) | const

Definition at line 44 of file IndexingContext.cpp.

References clang::index::IndexingOptions::IndexParametersInDeclarations.

Referenced by shouldSuppressRefs().

## ◆ shouldIndexTemplateParameters()

bool IndexingContext::shouldIndexTemplateParameters | ( |  | ) | const

Definition at line 48 of file IndexingContext.cpp.

References clang::index::IndexingOptions::IndexTemplateParameters.

Referenced by handleReference(), and shouldSuppressRefs().

## ◆ shouldSuppressRefs()

bool clang::index::IndexingContext::shouldSuppressRefs | ( |  | ) | const
| inline

Definition at line 56 of file IndexingContext.h.

References handleDecl(), handleMacroDefined(), handleReference(), isTemplateImplicitInstantiation(), clang::index::None, Parent, shouldIndexFunctionLocalSymbols(), shouldIndexImplicitInstantiation(), shouldIndexParametersInDeclarations(), and shouldIndexTemplateParameters().

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

- lib/Index/IndexingContext.h
- lib/Index/IndexBody.cpp
- lib/Index/IndexDecl.cpp
- lib/Index/IndexingContext.cpp
- lib/Index/IndexTypeSourceInfo.cpp