llvm::DiagnosticInfoOptimizationBase

Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR passes.

Synopsis

Declared in <llvm/IR/DiagnosticInfo.h>

class DiagnosticInfoOptimizationBase
    : public DiagnosticInfoWithLocationBase

Base Classes

NameDescription
DiagnosticInfoWithLocationBaseCommon features for diagnostics with an associated location.

Types

NameDescription
Argument Used in the streaming interface as the general argument type. It internally converts everything into a key-value pair.
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).
setIsVerbose Used to set IsVerbose via the stream interface.

Member Functions

NameDescription
DiagnosticInfoOptimizationBase [constructor]PassName is the name of the pass emitting this diagnostic. RemarkName is a textual identifier for the remark (single-word, CamelCase). 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.
getAbsolutePath Return the absolute path tot the file.
getArgs
getFunction
getHotness
getKind
getLocation Return location information for this diagnostic in three parts: the relative source file path, line number and column.
getLocationStr 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".
getMsg
getPassName
getRemarkName
getSeverity
insert
isAnalysis
isEnabled [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).
isLocationAvailable Return true if location information is available for this diagnostic.
isMissed
isPassed
isVerbose
print [virtual]
setHotness

Static Member Functions

Name
classof

Protected Data Members

NameDescription
Args Arguments collected via the streaming interface.
FirstExtraArgIndex 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.
Hotness If profile information is available, this is the number of times the corresponding code was executed in a profile instrumentation run.
IsVerbose The remark is expected to be noisy.
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.
RemarkName Textual identifier for the remark (single-word, CamelCase). Can be used by external tools reading the output file for optimization remarks to identify the remark.

Derived Classes

NameDescription
DiagnosticInfoIROptimization Common features for diagnostics dealing with optimization remarks that are used by IR passes.
DiagnosticInfoMIROptimization Common features for diagnostics dealing with optimization remarks that are used by machine passes.