CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::lsp::VerilogIndex Class Reference

#include <VerilogIndex.h>

Collaboration diagram for circt::lsp::VerilogIndex:

Public Member Functions

 VerilogIndex (const slang::BufferID &slangBufferID, const slang::SourceManager &sourceManager)
void initialize (slang::ast::Compilation &compilation)
 Initialize the index with the given compilation unit.
void insertSymbol (const slang::ast::Symbol *symbol, slang::SourceRange from, bool isDefinition=false)
 Register a reference to a symbol symbol from from.
void insertSymbolDefinition (const slang::ast::Symbol *symbol)
const slang::SourceManager & getSlangSourceManager () const
const slang::BufferID & getBufferId () const
MapT & getIntervalMap ()
const ReferenceMap & getReferences () const
 A mapping from a symbol to their references.

Private Member Functions

void parseSourceLocation ()
 Parse source location emitted by ExportVerilog.
void parseSourceLocation (llvm::StringRef toParse)

Private Attributes

mlir::MLIRContext mlirContext
MapT::Allocator allocator
 An allocator for the interval map.
MapT intervalMap
 An interval map containing a corresponding definition mapped to a source interval.
ReferenceMap references
 References of symbols.
const slang::BufferID & bufferId
const slang::SourceManager & sourceManager

Detailed Description

Definition at line 38 of file VerilogIndex.h.

Constructor & Destructor Documentation

◆ VerilogIndex()

circt::lsp::VerilogIndex::VerilogIndex ( const slang::BufferID & slangBufferID,
const slang::SourceManager & sourceManager )
inline

Definition at line 40 of file VerilogIndex.h.

References allocator, bufferId, intervalMap, mlirContext, and sourceManager.

Member Function Documentation

◆ getBufferId()

const slang::BufferID & circt::lsp::VerilogIndex::getBufferId ( ) const
inline

Definition at line 57 of file VerilogIndex.h.

References bufferId.

Referenced by initialize(), and parseSourceLocation().

◆ getIntervalMap()

MapT & circt::lsp::VerilogIndex::getIntervalMap ( )
inline

Definition at line 60 of file VerilogIndex.h.

References intervalMap.

◆ getReferences()

const ReferenceMap & circt::lsp::VerilogIndex::getReferences ( ) const
inline

A mapping from a symbol to their references.

Definition at line 63 of file VerilogIndex.h.

References references.

◆ getSlangSourceManager()

const slang::SourceManager & circt::lsp::VerilogIndex::getSlangSourceManager ( ) const
inline

Definition at line 54 of file VerilogIndex.h.

References sourceManager.

Referenced by insertSymbol(), and parseSourceLocation().

◆ initialize()

void VerilogIndex::initialize ( slang::ast::Compilation & compilation)

Initialize the index with the given compilation unit.

Definition at line 200 of file VerilogIndex.cpp.

References getBufferId(), and parseSourceLocation().

◆ insertSymbol()

void VerilogIndex::insertSymbol ( const slang::ast::Symbol * symbol,
slang::SourceRange from,
bool isDefinition = false )

Register a reference to a symbol symbol from from.

Definition at line 309 of file VerilogIndex.cpp.

References assert(), getSlangSourceManager(), intervalMap, and references.

Referenced by insertSymbolDefinition().

◆ insertSymbolDefinition()

void VerilogIndex::insertSymbolDefinition ( const slang::ast::Symbol * symbol)

Definition at line 338 of file VerilogIndex.cpp.

References insertSymbol().

◆ parseSourceLocation() [1/2]

void VerilogIndex::parseSourceLocation ( )
private

Parse source location emitted by ExportVerilog.

Definition at line 284 of file VerilogIndex.cpp.

References getBufferId(), getSlangSourceManager(), circt::lsp::Logger::info(), and parseSourceLocation().

Referenced by initialize(), and parseSourceLocation().

◆ parseSourceLocation() [2/2]

void circt::lsp::VerilogIndex::parseSourceLocation ( llvm::StringRef toParse)
private

Member Data Documentation

◆ allocator

MapT::Allocator circt::lsp::VerilogIndex::allocator
private

An allocator for the interval map.

Definition at line 74 of file VerilogIndex.h.

Referenced by VerilogIndex().

◆ bufferId

const slang::BufferID& circt::lsp::VerilogIndex::bufferId
private

Definition at line 84 of file VerilogIndex.h.

Referenced by getBufferId(), and VerilogIndex().

◆ intervalMap

MapT circt::lsp::VerilogIndex::intervalMap
private

An interval map containing a corresponding definition mapped to a source interval.

Definition at line 78 of file VerilogIndex.h.

Referenced by getIntervalMap(), insertSymbol(), and VerilogIndex().

◆ mlirContext

mlir::MLIRContext circt::lsp::VerilogIndex::mlirContext
private

Definition at line 71 of file VerilogIndex.h.

Referenced by VerilogIndex().

◆ references

ReferenceMap circt::lsp::VerilogIndex::references
private

References of symbols.

Definition at line 81 of file VerilogIndex.h.

Referenced by getReferences(), and insertSymbol().

◆ sourceManager

const slang::SourceManager& circt::lsp::VerilogIndex::sourceManager
private

Definition at line 86 of file VerilogIndex.h.

Referenced by getSlangSourceManager(), and VerilogIndex().


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