A class to collect and print dropped debug information due to MIR optimization passes.

Synopsis

Declared in <llvm/CodeGen/DroppedVariableStatsMIR.h>

class DroppedVariableStatsMIR
    : public DroppedVariableStats

Description

After every MIR pass is run, it will print how many #DBG_VALUEs were dropped due to that pass.

Base Classes

Name

Description

DroppedVariableStats

A base class to collect and print dropped debug information variable statistics.

Member Functions

Name

Description

DroppedVariableStatsMIR [constructor]

Create a collector for dropped MIR debug variable statistics.

operator= [deleted]

Copy assignment is deleted; this class is unique per compilation.

getPassDroppedVariables

Return true if the most recent pass dropped any debug variables.

runAfterPass

Collect debug variable state after a MIR pass runs and report drops.

runBeforePass

Collect debug variable state before a MIR pass runs.

Protected Types

Name

Description

DebugVariables

Per‐function debug variable sets recorded before and after a pass.

Protected Member Functions

Name

Description

calculateDroppedStatsAndPrint

Calculate the number of dropped variables in an llvm::Function or llvm::MachineFunction and print the relevant information to stdout.

cleanup

Pop the most recent level from the per‐pass tracking stacks.

populateVarIDSetAndInlinedMap

Populate the VarIDSet and InlinedAtMap with the relevant information needed for before and after pass analysis to determine dropped variable status.

run

Run code to populate relevant data structures over an llvm::Function or llvm::MachineFunction.

setup

Push a new empty level onto the per‐pass tracking stacks.

updateDroppedCount

Check if a Var has been dropped or is a false positive. Also update the DroppedCount if a debug variable is dropped.

visitEveryDebugRecord [virtual]

Visit every debug record in an llvm::Function or llvm::MachineFunction and call populateVarIDSetAndInlinedMap on it.

visitEveryInstruction [virtual]

Visit every llvm::Instruction or llvm::MachineInstruction and check if the debug variable denoted by its ID Var may have been dropped by an optimization pass.

Protected Data Members

Name

Description

DebugVariablesStack

A stack of a DenseMap, that maps DebugVariables for every pass to an llvm::Function. A stack is used because an optimization pass can call other passes.

DroppedVariableStatsEnabled

True when dropped‐variable statistics collection is enabled.

InlinedAts

A stack of DenseMaps, which map the name of an llvm::Function to a DenseMap of VarIDs and their inlinedAt locations before an optimization pass has run.

VisitedScope

A DenseSet tracking whether a scope was visited before.

Created with MrDocs