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:405

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:

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)

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:446

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)

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:479

Parameters

const llvm::DiagnosticInfo* DI

ArrayRef<llvm::DiagnosticInfoOptimizationBase::
             Argument>
getArgs() const

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:477

Optional<uint64_t> getHotness() const

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:472

std::string getMsg() const

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:471

llvm::StringRef getPassName() const

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:469

llvm::StringRef getRemarkName() const

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:470

void insert(llvm::StringRef S)

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:454

Parameters

llvm::StringRef S

void insert(llvm::DiagnosticInfoOptimizationBase::
                setExtraArgs EA)

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:457

Parameters

llvm::DiagnosticInfoOptimizationBase::setExtraArgs EA

void insert(llvm::DiagnosticInfoOptimizationBase::
                setIsVerbose V)

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:456

Parameters

llvm::DiagnosticInfoOptimizationBase::setIsVerbose V

void insert(
    llvm::DiagnosticInfoOptimizationBase::Argument
        A)

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:455

Parameters

llvm::DiagnosticInfoOptimizationBase::Argument A

bool isAnalysis() const

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:496

virtual bool isEnabled() const

Description

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:467

bool isMissed() const

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:491

bool isPassed() const

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:486

bool isVerbose() const

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:475

void print(llvm::DiagnosticPrinter& DP) const

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:460

Parameters

llvm::DiagnosticPrinter& DP

void setHotness(Optional<uint64_t> H)

Declared at: llvm/include/llvm/IR/DiagnosticInfo.h:473

Parameters

Optional<uint64_t> H