class DiagnosticInfoOptimizationBase
Declaration
class DiagnosticInfoOptimizationBase
: public DiagnosticInfoWithLocationBase { /* full declaration omitted */ };Description
Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR passes.
Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:414
Inherits from: DiagnosticInfoWithLocationBase
Member Variables
- protected const char* PassName
- Name of the pass that triggers this report. If this matches the regular expression given in -Rpass=regexp, then the remark will be emitted.
- protected llvm::StringRef RemarkName
- Textual identifier for the remark (single-word, camel-case). Can be used by external tools reading the output file for optimization remarks to identify the remark.
- protected 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.
- protected SmallVector<llvm::DiagnosticInfoOptimizationBase:: Argument, 4> Args
- Arguments collected via the streaming interface.
- protected bool IsVerbose = false
- The remark is expected to be noisy.
- protected 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.
Method Overview
- public DiagnosticInfoOptimizationBase(enum DiagnosticKind Kind, enum DiagnosticSeverity Severity, const char * PassName, llvm::StringRef RemarkName, const llvm::Function & Fn, const llvm::DiagnosticLocation & Loc)
- public static bool classof(const llvm::DiagnosticInfo * DI)
- public ArrayRef<llvm::DiagnosticInfoOptimizationBase::Argument> getArgs() const
- public Optional<uint64_t> getHotness() const
- public std::string getMsg() const
- public llvm::StringRef getPassName() const
- public llvm::StringRef getRemarkName() const
- public void insert(llvm::StringRef S)
- public void insert(llvm::DiagnosticInfoOptimizationBase::setExtraArgs EA)
- public void insert(llvm::DiagnosticInfoOptimizationBase::setIsVerbose V)
- public void insert(llvm::DiagnosticInfoOptimizationBase::Argument A)
- public bool isAnalysis() const
- public virtual bool isEnabled() const
- public bool isMissed() const
- public bool isPassed() const
- public bool isVerbose() const
- public void print(llvm::DiagnosticPrinter & DP) const
- public void setHotness(Optional<uint64_t> H)
Inherited from DiagnosticInfoWithLocationBase:
- public getAbsolutePath
- public getFunction
- public getLocation
- public getLocation
- public getLocationStr
- public isLocationAvailable
Inherited from DiagnosticInfo:
Methods
¶DiagnosticInfoOptimizationBase(
enum DiagnosticKind Kind,
enum DiagnosticSeverity Severity,
const char* PassName,
llvm::StringRef RemarkName,
const llvm::Function& Fn,
const llvm::DiagnosticLocation& Loc)
DiagnosticInfoOptimizationBase(
enum DiagnosticKind Kind,
enum DiagnosticSeverity Severity,
const char* PassName,
llvm::StringRef RemarkName,
const llvm::Function& Fn,
const llvm::DiagnosticLocation& Loc)Description
\p PassName is the name of the pass emitting this diagnostic. \p RemarkName is a textual identifier for the remark (single-word, camel-case). \p Fn is the function where the diagnostic is being emitted.\p Loc is the location information to use in the diagnostic. If line table information is available, the diagnostic will include the source code location.
Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:457
Parameters
- enum DiagnosticKind Kind
- enum DiagnosticSeverity Severity
- const char* PassName
- llvm::StringRef RemarkName
- const llvm::Function& Fn
- const llvm::DiagnosticLocation& Loc
¶static bool classof(
const llvm::DiagnosticInfo* DI)
static bool classof(
const llvm::DiagnosticInfo* DI)Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:490
Parameters
- const llvm::DiagnosticInfo* DI
¶ArrayRef<llvm::DiagnosticInfoOptimizationBase::
Argument>
getArgs() const
ArrayRef<llvm::DiagnosticInfoOptimizationBase::
Argument>
getArgs() constDeclared at: llvm/include/llvm/IR/DiagnosticInfo.h:488
¶Optional<uint64_t> getHotness() const
Optional<uint64_t> getHotness() constDeclared at: llvm/include/llvm/IR/DiagnosticInfo.h:483
¶std::string getMsg() const
std::string getMsg() constDeclared at: llvm/include/llvm/IR/DiagnosticInfo.h:482
¶llvm::StringRef getPassName() const
llvm::StringRef getPassName() constDeclared at: llvm/include/llvm/IR/DiagnosticInfo.h:480
¶llvm::StringRef getRemarkName() const
llvm::StringRef getRemarkName() constDeclared at: llvm/include/llvm/IR/DiagnosticInfo.h:481
¶void insert(llvm::StringRef S)
void insert(llvm::StringRef S)Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:465
Parameters
¶void insert(llvm::DiagnosticInfoOptimizationBase::
setExtraArgs EA)
void insert(llvm::DiagnosticInfoOptimizationBase::
setExtraArgs EA)Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:468
Parameters
¶void insert(llvm::DiagnosticInfoOptimizationBase::
setIsVerbose V)
void insert(llvm::DiagnosticInfoOptimizationBase::
setIsVerbose V)Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:467
Parameters
¶void insert(
llvm::DiagnosticInfoOptimizationBase::Argument
A)
void insert(
llvm::DiagnosticInfoOptimizationBase::Argument
A)Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:466
Parameters
¶bool isAnalysis() const
bool isAnalysis() constDeclared at: llvm/include/llvm/IR/DiagnosticInfo.h:507
¶virtual bool isEnabled() const
virtual bool isEnabled() constDescription
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).
Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:478
¶bool isMissed() const
bool isMissed() constDeclared at: llvm/include/llvm/IR/DiagnosticInfo.h:502
¶bool isPassed() const
bool isPassed() constDeclared at: llvm/include/llvm/IR/DiagnosticInfo.h:497
¶bool isVerbose() const
bool isVerbose() constDeclared at: llvm/include/llvm/IR/DiagnosticInfo.h:486
¶void print(llvm::DiagnosticPrinter& DP) const
void print(llvm::DiagnosticPrinter& DP) constDeclared at: llvm/include/llvm/IR/DiagnosticInfo.h:471
Parameters
¶void setHotness(Optional<uint64_t> H)
void setHotness(Optional<uint64_t> H)Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:484
Parameters
- Optional<uint64_t> H