CIRCT 22.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
circt::lsp::VerilogIndex Class Reference

#include <VerilogIndex.h>

Collaboration diagram for circt::lsp::VerilogIndex:
Collaboration graph
[legend]

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
 
MapTgetIntervalMap ()
 
const ReferenceMapgetReferences () 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.

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 199 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 308 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 337 of file VerilogIndex.cpp.

References insertSymbol().

◆ parseSourceLocation() [1/2]

void VerilogIndex::parseSourceLocation ( )
private

Parse source location emitted by ExportVerilog.

Definition at line 283 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.

◆ bufferId

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

Definition at line 84 of file VerilogIndex.h.

Referenced by getBufferId().

◆ 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(), and insertSymbol().

◆ mlirContext

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

Definition at line 71 of file VerilogIndex.h.

◆ 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().


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