LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::DiagnosticInfoGeneric Class Reference

#include "llvm/IR/DiagnosticInfo.h"

Inheritance diagram for llvm::DiagnosticInfoGeneric:
Inheritance graph
[legend]

Public Member Functions

 DiagnosticInfoGeneric (const Twine &MsgStr, DiagnosticSeverity Severity=DS_Error)
 MsgStr is the message to be reported to the frontend.
 
 DiagnosticInfoGeneric (const Instruction *I, const Twine &ErrMsg, DiagnosticSeverity Severity=DS_Error)
 
const TwinegetMsgStr () const
 
const InstructiongetInstruction () const
 
void print (DiagnosticPrinter &DP) const override
 
- Public Member Functions inherited from llvm::DiagnosticInfo
 DiagnosticInfo (int Kind, DiagnosticSeverity Severity)
 
virtual ~DiagnosticInfo ()=default
 
int getKind () const
 
DiagnosticSeverity getSeverity () const
 
virtual void print (DiagnosticPrinter &DP) const =0
 Print using the given DP a user-friendly message.
 

Static Public Member Functions

static bool classof (const DiagnosticInfo *DI)
 

Detailed Description

Definition at line 140 of file DiagnosticInfo.h.

Constructor & Destructor Documentation

◆ DiagnosticInfoGeneric() [1/2]

llvm::DiagnosticInfoGeneric::DiagnosticInfoGeneric ( const Twine MsgStr,
DiagnosticSeverity  Severity = DS_Error 
)
inline

MsgStr is the message to be reported to the frontend.

This class does not copy MsgStr, therefore the reference must be valid for the whole life time of the Diagnostic.

Definition at line 148 of file DiagnosticInfo.h.

◆ DiagnosticInfoGeneric() [2/2]

llvm::DiagnosticInfoGeneric::DiagnosticInfoGeneric ( const Instruction I,
const Twine ErrMsg,
DiagnosticSeverity  Severity = DS_Error 
)
inline

Definition at line 152 of file DiagnosticInfo.h.

Member Function Documentation

◆ classof()

static bool llvm::DiagnosticInfoGeneric::classof ( const DiagnosticInfo DI)
inlinestatic

Definition at line 162 of file DiagnosticInfo.h.

References llvm::DK_Generic, and llvm::DiagnosticInfo::getKind().

◆ getInstruction()

const Instruction * llvm::DiagnosticInfoGeneric::getInstruction ( ) const
inline

Definition at line 157 of file DiagnosticInfo.h.

◆ getMsgStr()

const Twine & llvm::DiagnosticInfoGeneric::getMsgStr ( ) const
inline

Definition at line 156 of file DiagnosticInfo.h.

Referenced by print().

◆ print()

void DiagnosticInfoGeneric::print ( DiagnosticPrinter DP) const
overridevirtual
See also
DiagnosticInfo::print.

Implements llvm::DiagnosticInfo.

Definition at line 51 of file DiagnosticInfo.cpp.

References getMsgStr().


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