slang::Diagnostics class

A collection of diagnostics.

Base classes

template<typename T, size_t N = detail::calculateDefaultSmallVectorElems<T>()>
class SmallVector<Diagnostic>
A concrete, sized version of the SmallVectorBase<T> template.

Public functions

auto add(DiagCode code, SourceLocation location) -> Diagnostic&
Adds a new diagnostic to the collection, pointing to the given source location.
auto add(DiagCode code, SourceRange range) -> Diagnostic&
Adds a new diagnostic to the collection, highlighting the given source range.
auto add(const ast::Symbol& source, DiagCode code, SourceLocation location) -> Diagnostic&
Adds a new diagnostic to the collection, pointing to the given source location.
auto add(const ast::Symbol& source, DiagCode code, SourceRange range) -> Diagnostic&
Adds a new diagnostic to the collection, highlighting the given source range.
void sort(const SourceManager& sourceManager)
Sorts the diagnostics in the collection based on source file and line number.
auto filter(std::initializer_list<DiagCode> list) const -> Diagnostics
Returns a copy of this collection with all diagnostics that match any of the codes given in list filtered out.