LLVM  5.0.0
Public Member Functions | List of all members
llvm::DiagnosticInfoWithLocationBase Class Reference

Common features for diagnostics with an associated location. More...

#include "llvm/IR/DiagnosticInfo.h"

Inheritance diagram for llvm::DiagnosticInfoWithLocationBase:
[legend]
Collaboration diagram for llvm::DiagnosticInfoWithLocationBase:
[legend]

Public Member Functions

 DiagnosticInfoWithLocationBase (enum DiagnosticKind Kind, enum DiagnosticSeverity Severity, const Function &Fn, const DiagnosticLocation &Loc)
 Fn is the function where the diagnostic is being emitted. More...
 
bool isLocationAvailable () const
 Return true if location information is available for this diagnostic. More...
 
const std::string getLocationStr () const
 Return a string with the location information for this diagnostic in the format "file:line:col". More...
 
void getLocation (StringRef *Filename, unsigned *Line, unsigned *Column) const
 Return location information for this diagnostic in three parts: the source file name, line number and column. More...
 
const Function & getFunction () const
 
DiagnosticLocation getLocation () const
 
- 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. More...
 

Detailed Description

Common features for diagnostics with an associated location.

Definition at line 365 of file DiagnosticInfo.h.

Constructor & Destructor Documentation

llvm::DiagnosticInfoWithLocationBase::DiagnosticInfoWithLocationBase ( enum DiagnosticKind  Kind,
enum DiagnosticSeverity  Severity,
const Function &  Fn,
const DiagnosticLocation &  Loc 
)
inline

Fn is the function where the diagnostic is being emitted.

Loc is the location information to use in the diagnostic.

Definition at line 369 of file DiagnosticInfo.h.

Member Function Documentation

const Function& llvm::DiagnosticInfoWithLocationBase::getFunction ( ) const
inline
void DiagnosticInfoWithLocationBase::getLocation ( StringRef *  Filename,
unsigned *  Line,
unsigned *  Column 
) const

Return location information for this diagnostic in three parts: the source file name, line number and column.

Definition at line 178 of file DiagnosticInfo.cpp.

References llvm::DiagnosticLocation::getColumn(), llvm::DiagnosticLocation::getFilename(), and llvm::DiagnosticLocation::getLine().

Referenced by llvm::yaml::MappingTraits< DiagnosticInfoOptimizationBase * >::mapping(), reportFastISelFailure(), and llvm::reportGISelFailure().

DiagnosticLocation llvm::DiagnosticInfoWithLocationBase::getLocation ( ) const
inline

Definition at line 388 of file DiagnosticInfo.h.

Referenced by getLocationStr().

const std::string DiagnosticInfoWithLocationBase::getLocationStr ( ) const

Return a string with the location information for this diagnostic in the format "file:line:col".

If location information is not available, it returns "<unknown>:0:0".

Definition at line 186 of file DiagnosticInfo.cpp.

References getLocation(), and isLocationAvailable().

Referenced by llvm::DiagnosticInfoOptimizationBase::print(), and llvm::DiagnosticInfoUnsupported::print().

bool llvm::DiagnosticInfoWithLocationBase::isLocationAvailable ( ) const
inline

Return true if location information is available for this diagnostic.

Definition at line 376 of file DiagnosticInfo.h.

References llvm::DiagnosticLocation::isValid().

Referenced by getLocationStr().


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