LLVM 20.0.0git
|
A class to collect and print dropped debug information due to LLVM IR optimization passes. More...
#include "llvm/Passes/DroppedVariableStatsIR.h"
Public Member Functions | |
DroppedVariableStatsIR (bool DroppedVarStatsEnabled) | |
void | runBeforePass (Any IR) |
void | runAfterPass (StringRef P, Any IR) |
void | registerCallbacks (PassInstrumentationCallbacks &PIC) |
Public Member Functions inherited from llvm::DroppedVariableStats | |
DroppedVariableStats (bool DroppedVarStatsEnabled) | |
virtual | ~DroppedVariableStats () |
DroppedVariableStats (const DroppedVariableStats &)=delete | |
void | operator= (const DroppedVariableStats &)=delete |
bool | getPassDroppedVariables () |
Additional Inherited Members | |
Protected Member Functions inherited from llvm::DroppedVariableStats | |
void | setup () |
void | cleanup () |
void | calculateDroppedStatsAndPrint (DebugVariables &DbgVariables, StringRef FuncName, StringRef PassID, StringRef FuncOrModName, StringRef PassLevel, const Function *Func) |
Calculate the number of dropped variables in an llvm::Function or llvm::MachineFunction and print the relevant information to stdout. | |
bool | updateDroppedCount (DILocation *DbgLoc, const DIScope *Scope, const DIScope *DbgValScope, DenseMap< VarID, DILocation * > &InlinedAtsMap, VarID Var, unsigned &DroppedCount) |
Check if a Var has been dropped or is a false positive. | |
void | run (DebugVariables &DbgVariables, StringRef FuncName, bool Before) |
Run code to populate relevant data structures over an llvm::Function or llvm::MachineFunction. | |
void | populateVarIDSetAndInlinedMap (const DILocalVariable *DbgVar, DebugLoc DbgLoc, DenseSet< VarID > &VarIDSet, DenseMap< StringRef, DenseMap< VarID, DILocation * > > &InlinedAtsMap, StringRef FuncName, bool Before) |
Populate the VarIDSet and InlinedAtMap with the relevant information needed for before and after pass analysis to determine dropped variable status. | |
virtual void | visitEveryInstruction (unsigned &DroppedCount, DenseMap< VarID, DILocation * > &InlinedAtsMap, VarID Var)=0 |
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. | |
virtual void | visitEveryDebugRecord (DenseSet< VarID > &VarIDSet, DenseMap< StringRef, DenseMap< VarID, DILocation * > > &InlinedAtsMap, StringRef FuncName, bool Before)=0 |
Visit every debug record in an llvm::Function or llvm::MachineFunction and call populateVarIDSetAndInlinedMap on it. | |
Protected Attributes inherited from llvm::DroppedVariableStats | |
bool | DroppedVariableStatsEnabled = false |
SmallVector< DenseMap< const Function *, DebugVariables > > | DebugVariablesStack |
A stack of a DenseMap, that maps DebugVariables for every pass to an llvm::Function. | |
DenseSet< const DIScope * > | VisitedScope |
A DenseSet tracking whether a scope was visited before. | |
SmallVector< DenseMap< StringRef, DenseMap< VarID, DILocation * > > > | 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. | |
A class to collect and print dropped debug information due to LLVM IR optimization passes.
After every LLVM IR pass is run, it will print how many #dbg_values were dropped due to that pass.
Definition at line 26 of file DroppedVariableStatsIR.h.
|
inline |
Definition at line 28 of file DroppedVariableStatsIR.h.
void DroppedVariableStatsIR::registerCallbacks | ( | PassInstrumentationCallbacks & | PIC | ) |
Definition at line 48 of file DroppedVariableStatsIR.cpp.
References llvm::DroppedVariableStats::cleanup(), llvm::DroppedVariableStats::DroppedVariableStatsEnabled, IR, P, PIC, llvm::PassInstrumentationCallbacks::registerAfterPassCallback(), llvm::PassInstrumentationCallbacks::registerAfterPassInvalidatedCallback(), llvm::PassInstrumentationCallbacks::registerBeforeNonSkippedPassCallback(), runAfterPass(), and runBeforePass().
Referenced by llvm::StandardInstrumentations::registerCallbacks().
Definition at line 39 of file DroppedVariableStatsIR.h.
References llvm::DroppedVariableStats::cleanup(), F, IR, and P.
Referenced by registerCallbacks().
|
inline |
Definition at line 31 of file DroppedVariableStatsIR.h.
References F, IR, and llvm::DroppedVariableStats::setup().
Referenced by registerCallbacks().