11#ifndef LIB_CIRCT_TOOLS_CIRCT_VERILOG_LSP_SERVER_VERILOGINDEX_H_
12#define LIB_CIRCT_TOOLS_CIRCT_VERILOG_LSP_SERVER_VERILOGINDEX_H_
14#include "slang/ast/Compilation.h"
16#include "mlir/IR/Attributes.h"
17#include "mlir/IR/MLIRContext.h"
19#include "llvm/ADT/DenseMap.h"
20#include "llvm/ADT/IntervalMap.h"
21#include "llvm/ADT/PointerUnion.h"
22#include "llvm/ADT/SmallVector.h"
28 llvm::PointerUnion<const slang::ast::Symbol *, mlir::Attribute>;
30 llvm::SmallVector<slang::SourceRange>>;
34 llvm::IntervalMapImpl::NodeSizer<
36 llvm::IntervalMapHalfOpenInfo<const SlangBufferPointer>>;
47 void initialize(slang::ast::Compilation &compilation);
50 void insertSymbol(
const slang::ast::Symbol *symbol, slang::SourceRange from,
51 bool isDefinition =
false);
const ReferenceMap & getReferences() const
A mapping from a symbol to their references.
MapT::Allocator allocator
An allocator for the interval map.
ReferenceMap references
References of symbols.
void parseSourceLocation()
Parse source location emitted by ExportVerilog.
const slang::BufferID & bufferId
VerilogIndex(const slang::BufferID &slangBufferID, const slang::SourceManager &sourceManager)
void parseSourceLocation(llvm::StringRef toParse)
const slang::SourceManager & sourceManager
void insertSymbolDefinition(const slang::ast::Symbol *symbol)
mlir::MLIRContext mlirContext
void insertSymbol(const slang::ast::Symbol *symbol, slang::SourceRange from, bool isDefinition=false)
Register a reference to a symbol symbol from from.
const slang::BufferID & getBufferId() const
MapT intervalMap
An interval map containing a corresponding definition mapped to a source interval.
void initialize(slang::ast::Compilation &compilation)
Initialize the index with the given compilation unit.
const slang::SourceManager & getSlangSourceManager() const
char const * SlangBufferPointer
llvm::PointerUnion< const slang::ast::Symbol *, mlir::Attribute > VerilogIndexSymbol
llvm::IntervalMap< SlangBufferPointer, VerilogIndexSymbol, llvm::IntervalMapImpl::NodeSizer< SlangBufferPointer, VerilogIndexSymbol >::LeafSize, llvm::IntervalMapHalfOpenInfo< const SlangBufferPointer > > MapT
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.