|
CIRCT 24.0.0git
|
#include <VerilogDocument.h>

Public Member Functions | |
| VerilogDocument (VerilogServerContext &globalContext, const llvm::lsp::URIForFile &uri, llvm::StringRef contents, std::vector< llvm::lsp::Diagnostic > &diagnostics, const slang::driver::Driver *projectDriver=nullptr, const std::vector< std::string > &projectIncludeDirectories={}) | |
| VerilogDocument (const VerilogDocument &)=delete | |
| VerilogDocument & | operator= (const VerilogDocument &)=delete |
| const llvm::lsp::URIForFile & | getURI () const |
| const slang::SourceManager & | getSlangSourceManager () const |
| llvm::lsp::Location | getLspLocation (slang::SourceLocation loc) const |
| llvm::lsp::Location | getLspLocation (slang::SourceRange range) const |
| slang::BufferID | getMainBufferID () const |
| void | getLocationsOf (const llvm::lsp::URIForFile &uri, const llvm::lsp::Position &defPos, std::vector< llvm::lsp::Location > &locations) |
| void | findReferencesOf (const llvm::lsp::URIForFile &uri, const llvm::lsp::Position &pos, std::vector< llvm::lsp::Location > &references) |
| std::optional< uint32_t > | lspPositionToOffset (const llvm::lsp::Position &pos) |
| const char * | getPointerFor (const llvm::lsp::Position &pos) |
Private Member Functions | |
| std::optional< std::pair< slang::BufferID, llvm::SmallString< 128 > > > | getOrOpenFile (llvm::StringRef filePath) |
| void | computeLineOffsets (std::string_view text) |
| Build a vector of line start offsets (0-based). | |
Private Attributes | |
| VerilogServerContext & | globalContext |
| slang::BufferID | mainBufferId |
| llvm::StringMap< std::pair< slang::BufferID, llvm::SmallString< 128 > > > | filePathMap |
| llvm::FailureOr< std::unique_ptr< slang::ast::Compilation > > | compilation |
| slang::driver::Driver | driver |
| std::unique_ptr< circt::lsp::VerilogIndex > | index |
| The index of the parsed module. | |
| std::vector< uint32_t > | lineOffsets |
| The precomputed line offsets for faster lookups. | |
| llvm::lsp::URIForFile | uri |
Definition at line 38 of file VerilogDocument.h.
| circt::lsp::VerilogDocument::VerilogDocument | ( | VerilogServerContext & | globalContext, |
| const llvm::lsp::URIForFile & | uri, | ||
| llvm::StringRef | contents, | ||
| std::vector< llvm::lsp::Diagnostic > & | diagnostics, | ||
| const slang::driver::Driver * | projectDriver = nullptr, | ||
| const std::vector< std::string > & | projectIncludeDirectories = {} ) |
References globalContext, and uri.
Referenced by operator=(), and VerilogDocument().
|
delete |
References VerilogDocument().
|
private |
Build a vector of line start offsets (0-based).
Definition at line 296 of file VerilogDocument.cpp.
References lineOffsets.
| void VerilogDocument::findReferencesOf | ( | const llvm::lsp::URIForFile & | uri, |
| const llvm::lsp::Position & | pos, | ||
| std::vector< llvm::lsp::Location > & | references ) |
Definition at line 404 of file VerilogDocument.cpp.
References getLspLocation(), getPointerFor(), index, and uri.
| void VerilogDocument::getLocationsOf | ( | const llvm::lsp::URIForFile & | uri, |
| const llvm::lsp::Position & | defPos, | ||
| std::vector< llvm::lsp::Location > & | locations ) |
Definition at line 357 of file VerilogDocument.cpp.
References circt::lsp::Logger::error(), getLspLocation(), getOrOpenFile(), getPointerFor(), getRange(), index, and uri.
| llvm::lsp::Location VerilogDocument::getLspLocation | ( | slang::SourceLocation | loc | ) | const |
Definition at line 201 of file VerilogDocument.cpp.
References getSlangSourceManager(), mainBufferId, and uri.
Referenced by findReferencesOf(), getLocationsOf(), and getLspLocation().
| llvm::lsp::Location VerilogDocument::getLspLocation | ( | slang::SourceRange | range | ) | const |
Definition at line 234 of file VerilogDocument.cpp.
References getLspLocation().
|
inline |
Definition at line 58 of file VerilogDocument.h.
References mainBufferId.
|
private |
Definition at line 247 of file VerilogDocument.cpp.
References driver, filePathMap, and globalContext.
Referenced by getLocationsOf().
| const char * VerilogDocument::getPointerFor | ( | const llvm::lsp::Position & | pos | ) |
Definition at line 346 of file VerilogDocument.cpp.
References getSlangSourceManager(), lspPositionToOffset(), and mainBufferId.
Referenced by findReferencesOf(), and getLocationsOf().
|
inline |
Definition at line 50 of file VerilogDocument.h.
References driver.
Referenced by getLspLocation(), getPointerFor(), and lspPositionToOffset().
|
inline |
Definition at line 48 of file VerilogDocument.h.
References uri.
| std::optional< uint32_t > VerilogDocument::lspPositionToOffset | ( | const llvm::lsp::Position & | pos | ) |
Definition at line 309 of file VerilogDocument.cpp.
References getSlangSourceManager(), lineOffsets, and mainBufferId.
Referenced by getPointerFor().
|
delete |
References VerilogDocument().
|
private |
Definition at line 89 of file VerilogDocument.h.
|
private |
Definition at line 92 of file VerilogDocument.h.
Referenced by getOrOpenFile(), and getSlangSourceManager().
|
private |
Definition at line 86 of file VerilogDocument.h.
Referenced by getOrOpenFile().
|
private |
Definition at line 79 of file VerilogDocument.h.
Referenced by getOrOpenFile(), and VerilogDocument().
|
private |
The index of the parsed module.
Definition at line 95 of file VerilogDocument.h.
Referenced by findReferencesOf(), and getLocationsOf().
|
private |
The precomputed line offsets for faster lookups.
Definition at line 98 of file VerilogDocument.h.
Referenced by computeLineOffsets(), and lspPositionToOffset().
|
private |
Definition at line 81 of file VerilogDocument.h.
Referenced by getLspLocation(), getMainBufferID(), getPointerFor(), and lspPositionToOffset().
|
private |
Definition at line 102 of file VerilogDocument.h.
Referenced by findReferencesOf(), getLocationsOf(), getLspLocation(), getURI(), and VerilogDocument().