|
LLVM
4.0.0
|
Common features for diagnostics dealing with optimization remarks. More...
#include <DiagnosticInfo.h>
Classes | |
| struct | Argument |
| Used in the streaming interface as the general argument type. More... | |
| struct | setExtraArgs |
| When an instance of this is inserted into the stream, the arguments following will not appear in the remark printed in the compiler output (-Rpass) but only in the optimization record file (-fsave-optimization-record). More... | |
| struct | setIsVerbose |
| Used to set IsVerbose via the stream interface. More... | |
Public Member Functions | |
| DiagnosticInfoOptimizationBase (enum DiagnosticKind Kind, enum DiagnosticSeverity Severity, const char *PassName, StringRef RemarkName, const Function &Fn, const DebugLoc &DLoc, Value *CodeRegion=nullptr) | |
PassName is the name of the pass emitting this diagnostic. More... | |
| DiagnosticInfoOptimizationBase (const char *PassName, StringRef Prepend, const DiagnosticInfoOptimizationBase &Orig) | |
| This is ctor variant allows a pass to build an optimization remark from an existing remark. More... | |
| DiagnosticInfoOptimizationBase (enum DiagnosticKind Kind, enum DiagnosticSeverity Severity, const char *PassName, const Function &Fn, const DebugLoc &DLoc, const Twine &Msg, Optional< uint64_t > Hotness=None) | |
| Legacy interface. More... | |
| DiagnosticInfoOptimizationBase & | operator<< (StringRef S) |
| DiagnosticInfoOptimizationBase & | operator<< (Argument A) |
| DiagnosticInfoOptimizationBase & | operator<< (setIsVerbose V) |
| DiagnosticInfoOptimizationBase & | operator<< (setExtraArgs EA) |
| void | print (DiagnosticPrinter &DP) const override |
| virtual bool | isEnabled () const =0 |
| Return true if this optimization remark is enabled by one of of the LLVM command line flags (-pass-remarks, -pass-remarks-missed, or -pass-remarks-analysis). More... | |
| StringRef | getPassName () const |
| std::string | getMsg () const |
| Optional< uint64_t > | getHotness () const |
| void | setHotness (Optional< uint64_t > H) |
| Value * | getCodeRegion () const |
| bool | isVerbose () const |
Public Member Functions inherited from llvm::DiagnosticInfoWithDebugLocBase | |
| DiagnosticInfoWithDebugLocBase (enum DiagnosticKind Kind, enum DiagnosticSeverity Severity, const Function &Fn, const DebugLoc &DLoc) | |
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 |
| const DebugLoc & | getDebugLoc () const |
Public Member Functions inherited from llvm::DiagnosticInfo | |
| DiagnosticInfo (int Kind, DiagnosticSeverity Severity) | |
| virtual | ~DiagnosticInfo ()=default |
| int | getKind () const |
| DiagnosticSeverity | getSeverity () const |
Static Public Member Functions | |
| static bool | classof (const DiagnosticInfo *DI) |
Friends | |
| struct | yaml::MappingTraits< DiagnosticInfoOptimizationBase * > |
Common features for diagnostics dealing with optimization remarks.
Definition at line 380 of file DiagnosticInfo.h.
|
inline |
PassName is the name of the pass emitting this diagnostic.
RemarkName is a textual identifier for the remark. Fn is the function where the diagnostic is being emitted. DLoc is the location information to use in the diagnostic. If line table information is available, the diagnostic will include the source code location. CodeRegion is IR value (currently basic block) that the optimization operates on. This is currently used to provide run-time hotness information with PGO.
Definition at line 414 of file DiagnosticInfo.h.
|
inline |
This is ctor variant allows a pass to build an optimization remark from an existing remark.
This is useful when a transformation pass (e.g LV) wants to emit a remark (Orig) generated by one of its analyses (e.g. LAA) as its own analysis remark. The string Prepend will be emitted before the original message.
Definition at line 429 of file DiagnosticInfo.h.
|
inline |
Legacy interface.
PassName is the name of the pass emitting this diagnostic. Fn is the function where the diagnostic is being emitted. DLoc is the location information to use in the diagnostic. If line table information is available, the diagnostic will include the source code location. Msg is the message to show. Note that this class does not copy this message, so this reference must be valid for the whole life time of the diagnostic.
Definition at line 448 of file DiagnosticInfo.h.
References llvm::Twine::str().
|
inlinestatic |
Definition at line 482 of file DiagnosticInfo.h.
References llvm::DK_FirstRemark, llvm::DK_LastRemark, and llvm::DiagnosticInfo::getKind().
|
inline |
Definition at line 478 of file DiagnosticInfo.h.
|
inline |
Definition at line 475 of file DiagnosticInfo.h.
| std::string DiagnosticInfoOptimizationBase::getMsg | ( | ) | const |
Definition at line 379 of file DiagnosticInfo.cpp.
References llvm::make_range(), and llvm::raw_string_ostream::str().
Referenced by print().
|
inline |
Definition at line 473 of file DiagnosticInfo.h.
Referenced by llvm::OptimizationRemark::isEnabled(), llvm::OptimizationRemarkMissed::isEnabled(), llvm::OptimizationRemarkAnalysis::isEnabled(), and llvm::OptimizationRemarkAnalysis::shouldAlwaysPrint().
|
pure virtual |
Return true if this optimization remark is enabled by one of of the LLVM command line flags (-pass-remarks, -pass-remarks-missed, or -pass-remarks-analysis).
Note that this only handles the LLVM flags. We cannot access Clang flags from here (they are handled in BackendConsumer::OptimizationRemarkHandler).
Implemented in llvm::DiagnosticInfoOptimizationFailure, llvm::OptimizationRemarkAnalysis, llvm::OptimizationRemarkMissed, and llvm::OptimizationRemark.
|
inline |
Definition at line 480 of file DiagnosticInfo.h.
Referenced by llvm::OptimizationRemarkEmitter::emit().
| DiagnosticInfoOptimizationBase & DiagnosticInfoOptimizationBase::operator<< | ( | StringRef | S | ) |
Definition at line 356 of file DiagnosticInfo.cpp.
| DiagnosticInfoOptimizationBase & DiagnosticInfoOptimizationBase::operator<< | ( | Argument | A | ) |
Definition at line 362 of file DiagnosticInfo.cpp.
| DiagnosticInfoOptimizationBase & DiagnosticInfoOptimizationBase::operator<< | ( | setIsVerbose | V | ) |
Definition at line 368 of file DiagnosticInfo.cpp.
| DiagnosticInfoOptimizationBase & DiagnosticInfoOptimizationBase::operator<< | ( | setExtraArgs | EA | ) |
Definition at line 374 of file DiagnosticInfo.cpp.
|
overridevirtual |
Implements llvm::DiagnosticInfo.
Definition at line 206 of file DiagnosticInfo.cpp.
References llvm::DiagnosticInfoWithDebugLocBase::getLocationStr(), and getMsg().
|
inline |
Definition at line 476 of file DiagnosticInfo.h.
References H.
|
friend |
Definition at line 516 of file DiagnosticInfo.h.
1.8.6