|
LLVM 24.0.0git
|
A base class to collect and print dropped debug information variable statistics. More...
#include "llvm/IR/DroppedVariableStats.h"
Classes | |
| struct | DebugVariables |
Public Member Functions | |
| LLVM_ABI | DroppedVariableStats (bool DroppedVarStatsEnabled) |
| virtual | ~DroppedVariableStats ()=default |
| DroppedVariableStats (const DroppedVariableStats &)=delete | |
| void | operator= (const DroppedVariableStats &)=delete |
| bool | getPassDroppedVariables () |
Protected Member Functions | |
| LLVM_ABI void | setup () |
| LLVM_ABI void | cleanup () |
| LLVM_ABI void | calculateDroppedStatsAndPrint (DebugVariables &DbgVariables, 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. | |
| LLVM_ABI bool | updateDroppedCount (const DILocation *DbgLoc, VarID Var, unsigned &DroppedCount) |
Check if a Var has been dropped or is a false positive. | |
| LLVM_ABI void | run (DebugVariables &DbgVariables, bool Before) |
| Run code to populate relevant data structures over an llvm::Function or llvm::MachineFunction. | |
| LLVM_ABI void | populateVarIDSet (const DILocalVariable *DbgVar, DebugLoc DbgLoc, DenseSet< VarID > &VarIDSet) |
Add the VarID of the debug record of DbgVar at DbgLoc to VarIDSet. | |
| virtual void | visitEveryInstruction (unsigned &DroppedCount, 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)=0 |
| Visit every debug record in an llvm::Function or llvm::MachineFunction and call populateVarIDSet on it. | |
Protected Attributes | |
| bool | DroppedVariableStatsEnabled = false |
| SmallVector< DenseMap< const Function *, DebugVariables > > | DebugVariablesStack |
| A stack of a DenseMap, that maps DebugVariables for every pass to an llvm::Function. | |
A base class to collect and print dropped debug information variable statistics.
Definition at line 33 of file DroppedVariableStats.h.
| DroppedVariableStats::DroppedVariableStats | ( | bool | DroppedVarStatsEnabled | ) |
Definition at line 21 of file DroppedVariableStats.cpp.
References DroppedVariableStatsEnabled, and llvm::outs().
Referenced by DroppedVariableStats(), llvm::DroppedVariableStatsIR::DroppedVariableStatsIR(), llvm::DroppedVariableStatsMIR::DroppedVariableStatsMIR(), and operator=().
|
virtualdefault |
|
delete |
References DroppedVariableStats().
|
protected |
Calculate the number of dropped variables in an llvm::Function or llvm::MachineFunction and print the relevant information to stdout.
Definition at line 38 of file DroppedVariableStats.cpp.
References llvm::detail::DenseSetImpl< ValueT, MapTy >::contains(), llvm::DroppedVariableStats::DebugVariables::DebugVariablesAfter, llvm::DroppedVariableStats::DebugVariables::DebugVariablesBefore, llvm::outs(), and visitEveryInstruction().
|
protected |
Definition at line 32 of file DroppedVariableStats.cpp.
References assert(), and DebugVariablesStack.
Referenced by llvm::DroppedVariableStatsIR::registerCallbacks(), llvm::DroppedVariableStatsIR::runAfterPass(), and llvm::DroppedVariableStatsMIR::runAfterPass().
|
inline |
Definition at line 43 of file DroppedVariableStats.h.
|
delete |
References DroppedVariableStats().
|
protected |
Add the VarID of the debug record of DbgVar at DbgLoc to VarIDSet.
Definition at line 78 of file DroppedVariableStats.cpp.
References llvm::DebugLoc::getInlinedAt(), and llvm::detail::DenseSetImpl< ValueT, MapTy >::insert().
|
protected |
Run code to populate relevant data structures over an llvm::Function or llvm::MachineFunction.
Definition at line 71 of file DroppedVariableStats.cpp.
References llvm::DroppedVariableStats::DebugVariables::DebugVariablesAfter, llvm::DroppedVariableStats::DebugVariables::DebugVariablesBefore, and visitEveryDebugRecord().
|
protected |
Definition at line 28 of file DroppedVariableStats.cpp.
References DebugVariablesStack.
Referenced by llvm::DroppedVariableStatsIR::runBeforePass(), and llvm::DroppedVariableStatsMIR::runBeforePass().
|
protected |
Check if a Var has been dropped or is a false positive.
Also update the DroppedCount if a debug variable is dropped.
Definition at line 60 of file DroppedVariableStats.cpp.
|
protectedpure virtual |
Visit every debug record in an llvm::Function or llvm::MachineFunction and call populateVarIDSet on it.
References F.
Referenced by run().
|
protectedpure 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.
Referenced by calculateDroppedStatsAndPrint().
|
protected |
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.
Definition at line 61 of file DroppedVariableStats.h.
|
protected |
Definition at line 50 of file DroppedVariableStats.h.
Referenced by DroppedVariableStats(), and llvm::DroppedVariableStatsIR::registerCallbacks().