My Project
Classes | Public Types | Public Member Functions | List of all members
mlir::Diagnostic Class Reference

#include <Diagnostics.h>

Public Types

using note_iterator = NoteIteratorImpl< NoteVector::iterator >
 
using const_note_iterator = NoteIteratorImpl< NoteVector::const_iterator >
 

Public Member Functions

 Diagnostic (Location loc, DiagnosticSeverity severity)
 
 Diagnostic (Diagnostic &&)=default
 
Diagnosticoperator= (Diagnostic &&)=default
 
DiagnosticSeverity getSeverity () const
 Returns the severity of this diagnostic. More...
 
Location getLocation () const
 Returns the source location for this diagnostic. More...
 
MutableArrayRef< DiagnosticArgumentgetArguments ()
 Returns the current list of diagnostic arguments. More...
 
ArrayRef< DiagnosticArgumentgetArguments () const
 
template<typename Arg >
std::enable_if<!std::is_convertible< Arg, StringRef >::value, Diagnostic & >::type operator<< (Arg &&val)
 Stream operator for inserting new diagnostic arguments. More...
 
Diagnosticoperator<< (const char *val)
 Stream in a string literal. More...
 
Diagnosticoperator<< (char val)
 Stream in a Twine argument. More...
 
Diagnosticoperator<< (const Twine &val)
 
Diagnosticoperator<< (Twine &&val)
 
Diagnosticoperator<< (Identifier val)
 Stream in an Identifier. More...
 
Diagnosticoperator<< (OperationName val)
 Stream in an OperationName. More...
 
template<typename T >
Diagnosticoperator<< (iterator_range< T > range)
 Stream in a range. More...
 
template<typename T >
Diagnosticoperator<< (ArrayRef< T > range)
 
template<typename T , template< typename > class Container>
DiagnosticappendRange (const Container< T > &c, const char *delim=", ")
 
template<typename Arg1 , typename Arg2 , typename... Args>
Diagnosticappend (Arg1 &&arg1, Arg2 &&arg2, Args &&... args)
 Append arguments to the diagnostic. More...
 
template<typename Arg >
Diagnosticappend (Arg &&arg)
 Append one argument to the diagnostic. More...
 
void print (raw_ostream &os) const
 Outputs this diagnostic to a stream. More...
 
std::string str () const
 Converts the diagnostic to a string. More...
 
DiagnosticattachNote (Optional< Location > noteLoc=llvm::None)
 
iterator_range< note_iteratorgetNotes ()
 Returns the notes held by this diagnostic. More...
 
iterator_range< const_note_iteratorgetNotes () const
 
 operator LogicalResult () const
 Allow a diagnostic to be converted to 'failure'. More...
 

Detailed Description

This class contains all of the information necessary to report a diagnostic to the DiagnosticEngine. It should generally not be constructed directly, and instead used transitively via InFlightDiagnostic.

Member Typedef Documentation

◆ const_note_iterator

using mlir::Diagnostic::const_note_iterator = NoteIteratorImpl<NoteVector::const_iterator>

◆ note_iterator

using mlir::Diagnostic::note_iterator = NoteIteratorImpl<NoteVector::iterator>

Constructor & Destructor Documentation

◆ Diagnostic() [1/2]

mlir::Diagnostic::Diagnostic ( Location  loc,
DiagnosticSeverity  severity 
)
inline

◆ Diagnostic() [2/2]

mlir::Diagnostic::Diagnostic ( Diagnostic &&  )
default

Member Function Documentation

◆ append() [1/2]

template<typename Arg1 , typename Arg2 , typename... Args>
Diagnostic& mlir::Diagnostic::append ( Arg1 &&  arg1,
Arg2 &&  arg2,
Args &&...  args 
)
inline

Append arguments to the diagnostic.

◆ append() [2/2]

template<typename Arg >
Diagnostic& mlir::Diagnostic::append ( Arg &&  arg)
inline

Append one argument to the diagnostic.

◆ appendRange()

template<typename T , template< typename > class Container>
Diagnostic& mlir::Diagnostic::appendRange ( const Container< T > &  c,
const char *  delim = ", " 
)
inline

Append a range to the diagnostic. The default delimiter between elements is ','.

◆ attachNote()

Diagnostic & Diagnostic::attachNote ( Optional< Location noteLoc = llvm::None)

Attaches a note to this diagnostic. A new location may be optionally provided, if not, then the location defaults to the one specified for this diagnostic. Notes may not be attached to other notes.

Append and return a new note.

◆ getArguments() [1/2]

MutableArrayRef<DiagnosticArgument> mlir::Diagnostic::getArguments ( )
inline

Returns the current list of diagnostic arguments.

◆ getArguments() [2/2]

ArrayRef<DiagnosticArgument> mlir::Diagnostic::getArguments ( ) const
inline

◆ getLocation()

Location mlir::Diagnostic::getLocation ( ) const
inline

Returns the source location for this diagnostic.

◆ getNotes() [1/2]

iterator_range<note_iterator> mlir::Diagnostic::getNotes ( )
inline

Returns the notes held by this diagnostic.

◆ getNotes() [2/2]

iterator_range<const_note_iterator> mlir::Diagnostic::getNotes ( ) const
inline

◆ getSeverity()

DiagnosticSeverity mlir::Diagnostic::getSeverity ( ) const
inline

Returns the severity of this diagnostic.

◆ operator LogicalResult()

Diagnostic::operator LogicalResult ( ) const

Allow a diagnostic to be converted to 'failure'.

◆ operator<<() [1/9]

template<typename Arg >
std::enable_if<!std::is_convertible<Arg, StringRef>::value, Diagnostic &>::type mlir::Diagnostic::operator<< ( Arg &&  val)
inline

Stream operator for inserting new diagnostic arguments.

◆ operator<<() [2/9]

Diagnostic& mlir::Diagnostic::operator<< ( const char *  val)
inline

Stream in a string literal.

◆ operator<<() [3/9]

Diagnostic & Diagnostic::operator<< ( char  val)

Stream in a Twine argument.

◆ operator<<() [4/9]

Diagnostic & Diagnostic::operator<< ( const Twine &  val)

◆ operator<<() [5/9]

Diagnostic & Diagnostic::operator<< ( Twine &&  val)

◆ operator<<() [6/9]

Diagnostic & Diagnostic::operator<< ( Identifier  val)

Stream in an Identifier.

◆ operator<<() [7/9]

Diagnostic & Diagnostic::operator<< ( OperationName  val)

Stream in an OperationName.

◆ operator<<() [8/9]

template<typename T >
Diagnostic& mlir::Diagnostic::operator<< ( iterator_range< T >  range)
inline

Stream in a range.

◆ operator<<() [9/9]

template<typename T >
Diagnostic& mlir::Diagnostic::operator<< ( ArrayRef< T >  range)
inline

◆ operator=()

Diagnostic& mlir::Diagnostic::operator= ( Diagnostic &&  )
default

◆ print()

void Diagnostic::print ( raw_ostream &  os) const

Outputs this diagnostic to a stream.

◆ str()

std::string Diagnostic::str ( ) const

Converts the diagnostic to a string.

Convert the diagnostic to a string.


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