Changeset View
Changeset View
Standalone View
Standalone View
include/llvm/IR/DiagnosticInfo.h
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | enum DiagnosticKind { | ||||
DK_SampleProfile, | DK_SampleProfile, | ||||
DK_OptimizationRemark, | DK_OptimizationRemark, | ||||
DK_OptimizationRemarkMissed, | DK_OptimizationRemarkMissed, | ||||
DK_OptimizationRemarkAnalysis, | DK_OptimizationRemarkAnalysis, | ||||
DK_OptimizationRemarkAnalysisFPCommute, | DK_OptimizationRemarkAnalysisFPCommute, | ||||
DK_OptimizationRemarkAnalysisAliasing, | DK_OptimizationRemarkAnalysisAliasing, | ||||
DK_OptimizationFailure, | DK_OptimizationFailure, | ||||
DK_MIRParser, | DK_MIRParser, | ||||
DK_PGOProfile, | |||||
DK_FirstPluginKind | DK_FirstPluginKind | ||||
}; | }; | ||||
/// \brief Get the next available kind ID for a plugin diagnostic. | /// \brief Get the next available kind ID for a plugin diagnostic. | ||||
/// Each time this function is called, it returns a different number. | /// Each time this function is called, it returns a different number. | ||||
/// Therefore, a plugin that wants to "identify" its own classes | /// Therefore, a plugin that wants to "identify" its own classes | ||||
/// with a dynamic identifier, just have to use this method to get a new ID | /// with a dynamic identifier, just have to use this method to get a new ID | ||||
/// and assign it to each of its classes. | /// and assign it to each of its classes. | ||||
▲ Show 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | private: | ||||
/// Line number where the diagnostic occurred. If 0, no line number will | /// Line number where the diagnostic occurred. If 0, no line number will | ||||
/// be emitted in the message. | /// be emitted in the message. | ||||
unsigned LineNum; | unsigned LineNum; | ||||
/// Message to report. | /// Message to report. | ||||
const Twine &Msg; | const Twine &Msg; | ||||
}; | }; | ||||
/// Diagnostic information for the PGO profiler. | |||||
class DiagnosticInfoPGOProfile : public DiagnosticInfo { | |||||
public: | |||||
DiagnosticInfoPGOProfile(const char *FileName, const Twine &Msg, | |||||
DiagnosticSeverity Severity = DS_Error) | |||||
: DiagnosticInfo(DK_PGOProfile, Severity), FileName(FileName), Msg(Msg) {} | |||||
/// \see DiagnosticInfo::print. | |||||
void print(DiagnosticPrinter &DP) const override; | |||||
static bool classof(const DiagnosticInfo *DI) { | |||||
return DI->getKind() == DK_PGOProfile; | |||||
} | |||||
const char *getFileName() const { return FileName; } | |||||
const Twine &getMsg() const { return Msg; } | |||||
private: | |||||
/// Name of the input file associated with this diagnostic. | |||||
const char *FileName; | |||||
/// Message to report. | |||||
const Twine &Msg; | |||||
}; | |||||
/// Common features for diagnostics dealing with optimization remarks. | /// Common features for diagnostics dealing with optimization remarks. | ||||
class DiagnosticInfoOptimizationBase : public DiagnosticInfo { | class DiagnosticInfoOptimizationBase : public DiagnosticInfo { | ||||
public: | public: | ||||
/// \p PassName is the name of the pass emitting this diagnostic. | /// \p PassName is the name of the pass emitting this diagnostic. | ||||
/// \p Fn is the function where the diagnostic is being emitted. \p DLoc is | /// \p Fn is the function where the diagnostic is being emitted. \p DLoc is | ||||
/// the location information to use in the diagnostic. If line table | /// the location information to use in the diagnostic. If line table | ||||
/// information is available, the diagnostic will include the source code | /// information is available, the diagnostic will include the source code | ||||
/// location. \p Msg is the message to show. Note that this class does not | /// location. \p Msg is the message to show. Note that this class does not | ||||
▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines |