LLVM  8.0.1
Public Member Functions | List of all members
llvm::SMDiagnostic Class Reference

Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a caret diagnostic. More...

#include "llvm/Support/SourceMgr.h"

Public Member Functions

 SMDiagnostic ()=default
 
 SMDiagnostic (StringRef filename, SourceMgr::DiagKind Knd, StringRef Msg)
 
 SMDiagnostic (const SourceMgr &sm, SMLoc L, StringRef FN, int Line, int Col, SourceMgr::DiagKind Kind, StringRef Msg, StringRef LineStr, ArrayRef< std::pair< unsigned, unsigned >> Ranges, ArrayRef< SMFixIt > FixIts=None)
 
const SourceMgrgetSourceMgr () const
 
SMLoc getLoc () const
 
StringRef getFilename () const
 
int getLineNo () const
 
int getColumnNo () const
 
SourceMgr::DiagKind getKind () const
 
StringRef getMessage () const
 
StringRef getLineContents () const
 
ArrayRef< std::pair< unsigned, unsigned > > getRanges () const
 
void addFixIt (const SMFixIt &Hint)
 
ArrayRef< SMFixItgetFixIts () const
 
void print (const char *ProgName, raw_ostream &S, bool ShowColors=true, bool ShowKindLabel=true) const
 

Detailed Description

Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a caret diagnostic.

Definition at line 260 of file SourceMgr.h.

Constructor & Destructor Documentation

◆ SMDiagnostic() [1/3]

llvm::SMDiagnostic::SMDiagnostic ( )
default

◆ SMDiagnostic() [2/3]

llvm::SMDiagnostic::SMDiagnostic ( StringRef  filename,
SourceMgr::DiagKind  Knd,
StringRef  Msg 
)
inline

Definition at line 275 of file SourceMgr.h.

References llvm::None.

◆ SMDiagnostic() [3/3]

SMDiagnostic::SMDiagnostic ( const SourceMgr sm,
SMLoc  L,
StringRef  FN,
int  Line,
int  Col,
SourceMgr::DiagKind  Kind,
StringRef  Msg,
StringRef  LineStr,
ArrayRef< std::pair< unsigned, unsigned >>  Ranges,
ArrayRef< SMFixIt FixIts = None 
)

Definition at line 265 of file SourceMgr.cpp.

References llvm::sort().

Member Function Documentation

◆ addFixIt()

void llvm::SMDiagnostic::addFixIt ( const SMFixIt Hint)
inline

Definition at line 295 of file SourceMgr.h.

References llvm::SmallVectorTemplateBase< T >::push_back().

◆ getColumnNo()

int llvm::SMDiagnostic::getColumnNo ( ) const
inline

◆ getFilename()

StringRef llvm::SMDiagnostic::getFilename ( ) const
inline

Definition at line 287 of file SourceMgr.h.

◆ getFixIts()

ArrayRef<SMFixIt> llvm::SMDiagnostic::getFixIts ( ) const
inline

Definition at line 299 of file SourceMgr.h.

References print().

Referenced by llvm::MIRParserImpl::initializeJumpTableInfo().

◆ getKind()

SourceMgr::DiagKind llvm::SMDiagnostic::getKind ( ) const
inline

◆ getLineContents()

StringRef llvm::SMDiagnostic::getLineContents ( ) const
inline

◆ getLineNo()

int llvm::SMDiagnostic::getLineNo ( ) const
inline

Definition at line 288 of file SourceMgr.h.

Referenced by llvm::MIRParserImpl::initializeJumpTableInfo(), and srcMgrDiagHandler().

◆ getLoc()

SMLoc llvm::SMDiagnostic::getLoc ( ) const
inline

◆ getMessage()

StringRef llvm::SMDiagnostic::getMessage ( ) const
inline

◆ getRanges()

ArrayRef<std::pair<unsigned, unsigned> > llvm::SMDiagnostic::getRanges ( ) const
inline

◆ getSourceMgr()

const SourceMgr* llvm::SMDiagnostic::getSourceMgr ( ) const
inline

Definition at line 285 of file SourceMgr.h.

Referenced by getGNUBinOpPrecedence().

◆ print()

void SMDiagnostic::print ( const char ProgName,
raw_ostream S,
bool  ShowColors = true,
bool  ShowKindLabel = true 
) const

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