|
LLVM
7.0.0
|
Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR passes. More...
#include "llvm/IR/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 DiagnosticLocation &Loc) | |
PassName is the name of the pass emitting this diagnostic. More... | |
| void | insert (StringRef S) |
| void | insert (Argument A) |
| void | insert (setIsVerbose V) |
| void | insert (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) |
| bool | isVerbose () const |
| bool | isPassed () const |
| bool | isMissed () const |
| bool | isAnalysis () const |
Public Member Functions inherited from llvm::DiagnosticInfoWithLocationBase | |
| 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 |
Static Public Member Functions | |
| static bool | classof (const DiagnosticInfo *DI) |
Protected Attributes | |
| const char * | PassName |
| Name of the pass that triggers this report. More... | |
| StringRef | RemarkName |
| Textual identifier for the remark (single-word, camel-case). More... | |
| Optional< uint64_t > | Hotness |
| If profile information is available, this is the number of times the corresponding code was executed in a profile instrumentation run. More... | |
| SmallVector< Argument, 4 > | Args |
| Arguments collected via the streaming interface. More... | |
| bool | IsVerbose = false |
| The remark is expected to be noisy. More... | |
| int | FirstExtraArgIndex = -1 |
| If positive, the index of the first argument that only appear in the optimization records and not in the remark printed in the compiler output. More... | |
Friends | |
| struct | yaml::MappingTraits< DiagnosticInfoOptimizationBase *> |
Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR passes.
Definition at line 394 of file DiagnosticInfo.h.
|
inline |
PassName is the name of the pass emitting this diagnostic.
RemarkName is a textual identifier for the remark (single-word, camel-case). Fn is the function where the diagnostic is being emitted. Loc is the location information to use in the diagnostic. If line table information is available, the diagnostic will include the source code location.
Definition at line 434 of file DiagnosticInfo.h.
References isEnabled(), and llvm::DiagnosticInfo::print().
|
inlinestatic |
Definition at line 464 of file DiagnosticInfo.h.
References llvm::DK_FirstMachineRemark, llvm::DK_FirstRemark, llvm::DK_LastMachineRemark, llvm::DK_LastRemark, and llvm::DiagnosticInfo::getKind().
|
inline |
Definition at line 459 of file DiagnosticInfo.h.
Referenced by llvm::OptimizationRemarkEmitter::emit().
| std::string DiagnosticInfoOptimizationBase::getMsg | ( | ) | const |
Definition at line 338 of file DiagnosticInfo.cpp.
References Arg, Args, assert(), llvm::DK_MachineOptimizationRemark, llvm::DK_MachineOptimizationRemarkAnalysis, llvm::DK_MachineOptimizationRemarkMissed, llvm::DK_OptimizationFailure, llvm::DK_OptimizationRemark, llvm::DK_OptimizationRemarkAnalysis, llvm::DK_OptimizationRemarkAnalysisAliasing, llvm::DK_OptimizationRemarkAnalysisFPCommute, llvm::DK_OptimizationRemarkMissed, llvm::GlobalValue::dropLLVMManglingEscape(), FirstExtraArgIndex, llvm::DiagnosticInfoWithLocationBase::getFunction(), llvm::DiagnosticInfo::getKind(), llvm::DiagnosticInfoWithLocationBase::getLocation(), llvm::Value::getName(), Hotness, llvm::DiagnosticLocation::isValid(), llvm_unreachable, llvm::make_range(), PassName, RemarkName, and llvm::raw_string_ostream::str().
Referenced by print(), reportFastISelFailure(), and llvm::reportGISelFailure().
|
inline |
Definition at line 457 of file DiagnosticInfo.h.
Referenced by llvm::MachineOptimizationRemark::isEnabled(), llvm::MachineOptimizationRemarkMissed::isEnabled(), llvm::MachineOptimizationRemarkAnalysis::isEnabled(), llvm::OptimizationRemark::isEnabled(), llvm::OptimizationRemarkMissed::isEnabled(), and llvm::OptimizationRemarkAnalysis::isEnabled().
| void DiagnosticInfoOptimizationBase::insert | ( | StringRef | S | ) |
Definition at line 322 of file DiagnosticInfo.cpp.
References Args.
| void DiagnosticInfoOptimizationBase::insert | ( | Argument | A | ) |
Definition at line 326 of file DiagnosticInfo.cpp.
References Args.
| void DiagnosticInfoOptimizationBase::insert | ( | setIsVerbose | V | ) |
Definition at line 330 of file DiagnosticInfo.cpp.
References IsVerbose.
| void DiagnosticInfoOptimizationBase::insert | ( | setExtraArgs | EA | ) |
Definition at line 334 of file DiagnosticInfo.cpp.
References Args, and FirstExtraArgIndex.
|
inline |
Definition at line 481 of file DiagnosticInfo.h.
References llvm::DK_MachineOptimizationRemarkAnalysis, llvm::DK_OptimizationRemarkAnalysis, and llvm::DiagnosticInfo::getKind().
|
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, llvm::OptimizationRemark, llvm::MachineOptimizationRemarkAnalysis, llvm::MachineOptimizationRemarkMissed, and llvm::MachineOptimizationRemark.
|
inline |
Definition at line 476 of file DiagnosticInfo.h.
References llvm::DK_MachineOptimizationRemarkMissed, llvm::DK_OptimizationRemarkMissed, and llvm::DiagnosticInfo::getKind().
|
inline |
Definition at line 471 of file DiagnosticInfo.h.
References llvm::DK_MachineOptimizationRemark, llvm::DK_OptimizationRemark, and llvm::DiagnosticInfo::getKind().
|
inline |
Definition at line 462 of file DiagnosticInfo.h.
|
overridevirtual |
Implements llvm::DiagnosticInfo.
Definition at line 201 of file DiagnosticInfo.cpp.
References llvm::DiagnosticInfoWithLocationBase::getLocationStr(), getMsg(), and Hotness.
|
inline |
Definition at line 460 of file DiagnosticInfo.h.
References H.
Referenced by llvm::OptimizationRemarkEmitter::invalidate(), and llvm::DiagnosticInfoMIROptimization::MachineArgument::MachineArgument().
|
friend |
Definition at line 512 of file DiagnosticInfo.h.
|
protected |
Arguments collected via the streaming interface.
Definition at line 502 of file DiagnosticInfo.h.
Referenced by llvm::DiagnosticInfoIROptimization::DiagnosticInfoIROptimization(), getMsg(), and insert().
|
protected |
If positive, the index of the first argument that only appear in the optimization records and not in the remark printed in the compiler output.
Definition at line 510 of file DiagnosticInfo.h.
|
protected |
If profile information is available, this is the number of times the corresponding code was executed in a profile instrumentation run.
Definition at line 499 of file DiagnosticInfo.h.
The remark is expected to be noisy.
Definition at line 505 of file DiagnosticInfo.h.
Referenced by insert().
Name of the pass that triggers this report.
If this matches the regular expression given in -Rpass=regexp, then the remark will be emitted.
Definition at line 490 of file DiagnosticInfo.h.
Referenced by getMsg().
|
protected |
Textual identifier for the remark (single-word, camel-case).
Can be used by external tools reading the YAML output file for optimization remarks to identify the remark.
Definition at line 495 of file DiagnosticInfo.h.
Referenced by getMsg().
1.8.13