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

Stores the declaration occurrences seen in a particular source or header file of a translation unit. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Index/FileIndexRecord.h"

Public Member Functions

 FileIndexRecord (FileID FID, bool IsSystem)
 
ArrayRef< DeclOccurrencegetDeclOccurrencesSortedByOffset () const
 
FileID getFileID () const
 
bool isSystem () const
 
void addDeclOccurence (SymbolRoleSet Roles, unsigned Offset, const Decl *D, ArrayRef< SymbolRelation > Relations)
 Adds an occurrence of the canonical declaration D at the supplied Offset. More...
 
void addMacroOccurence (SymbolRoleSet Roles, unsigned Offset, const IdentifierInfo *Name, const MacroInfo *MI)
 Adds an occurrence of the given macro at the supplied Offset. More...
 
void removeHeaderGuardMacros ()
 Remove any macro occurrences for header guards. More...
 
void print (llvm::raw_ostream &OS, SourceManager &SM) const
 

Detailed Description

Stores the declaration occurrences seen in a particular source or header file of a translation unit.

Definition at line 26 of file FileIndexRecord.h.

Constructor & Destructor Documentation

◆ FileIndexRecord()

clang::index::FileIndexRecord::FileIndexRecord ( FileID  FID,
bool  IsSystem 
)
inline

Definition at line 34 of file FileIndexRecord.h.

Member Function Documentation

◆ addDeclOccurence()

void FileIndexRecord::addDeclOccurence ( SymbolRoleSet  Roles,
unsigned  Offset,
const Decl D,
ArrayRef< SymbolRelation Relations 
)

Adds an occurrence of the canonical declaration D at the supplied Offset.

Parameters
Rolesthe roles the occurrence fulfills in this position.
Offsetthe offset in the file of this occurrence.
Dthe canonical declaration this is an occurrence of.
Relationsthe set of symbols related to this occurrence.

Definition at line 31 of file FileIndexRecord.cpp.

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

◆ addMacroOccurence()

void FileIndexRecord::addMacroOccurence ( SymbolRoleSet  Roles,
unsigned  Offset,
const IdentifierInfo Name,
const MacroInfo MI 
)

Adds an occurrence of the given macro at the supplied Offset.

Parameters
Rolesthe roles the occurrence fulfills in this position.
Offsetthe offset in the file of this occurrence.
Namethe name of the macro.
MIthe canonical declaration this is an occurrence of.

Definition at line 40 of file FileIndexRecord.cpp.

◆ getDeclOccurrencesSortedByOffset()

ArrayRef< DeclOccurrence > FileIndexRecord::getDeclOccurrencesSortedByOffset ( ) const

Definition at line 20 of file FileIndexRecord.cpp.

References clang::index::DeclOccurrence::Offset.

◆ getFileID()

FileID clang::index::FileIndexRecord::getFileID ( ) const
inline

Definition at line 38 of file FileIndexRecord.h.

◆ isSystem()

bool clang::index::FileIndexRecord::isSystem ( ) const
inline

Definition at line 39 of file FileIndexRecord.h.

◆ print()

void FileIndexRecord::print ( llvm::raw_ostream &  OS,
SourceManager SM 
) const

◆ removeHeaderGuardMacros()

void FileIndexRecord::removeHeaderGuardMacros ( )

Remove any macro occurrences for header guards.

When preprocessing, this will only be accurate after HandleEndOfFile.

Definition at line 47 of file FileIndexRecord.cpp.


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