LLVM 22.0.0git
DroppedVariableStatsMIR.h
Go to the documentation of this file.
1///===- DroppedVariableStatsMIR.h - Opt Diagnostics -*- C++ -*-------------===//
2///
3/// Part of the LLVM Project, under the Apache License v2.0 with LLVM
4/// Exceptions. See https://llvm.org/LICENSE.txt for license information.
5/// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6///
7///===---------------------------------------------------------------------===//
8/// \file
9/// Dropped Variable Statistics for Debug Information. Reports any number
10/// of DBG_VALUEs that get dropped due to an optimization pass.
11///
12///===---------------------------------------------------------------------===//
13
14#ifndef LLVM_CODEGEN_DROPPEDVARIABLESTATSMIR_H
15#define LLVM_CODEGEN_DROPPEDVARIABLESTATSMIR_H
16
20
21namespace llvm {
22
23/// A class to collect and print dropped debug information due to MIR
24/// optimization passes. After every MIR pass is run, it will print how many
25/// #DBG_VALUEs were dropped due to that pass.
27public:
29
30 void runBeforePass(StringRef PassID, MachineFunction *MF);
31
32 void runAfterPass(StringRef PassID, MachineFunction *MF);
33
34private:
35 const MachineFunction *MFunc;
36 /// Populate DebugVariablesBefore, DebugVariablesAfter, InlinedAts before or
37 /// after a pass has run to facilitate dropped variable calculation for an
38 /// llvm::MachineFunction.
39 void runOnMachineFunction(const MachineFunction *MF, bool Before);
40 /// Iterate over all Instructions in a MachineFunction and report any dropped
41 /// debug information.
42 void calculateDroppedVarStatsOnMachineFunction(const MachineFunction *MF,
43 StringRef PassID,
44 StringRef FuncOrModName);
45 /// Override base class method to run on an llvm::MachineFunction
46 /// specifically.
47 virtual void
48 visitEveryInstruction(unsigned &DroppedCount,
49 DenseMap<VarID, DILocation *> &InlinedAtsMap,
50 VarID Var) override;
51 /// Override base class method to run on DBG_VALUEs specifically.
52 virtual void visitEveryDebugRecord(
53 DenseSet<VarID> &VarIDSet,
55 StringRef FuncName, bool Before) override;
56};
57
58} // namespace llvm
59
60#endif
#define LLVM_ABI
Definition Compiler.h:213
===- DroppedVariableStats.h - Opt Diagnostics -*- C++ -*-------------—===//
Implements a dense probed hash-table based set.
Definition DenseSet.h:261
LLVM_ABI DroppedVariableStats(bool DroppedVarStatsEnabled)
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
This is an optimization pass for GlobalISel generic memory operations.
std::tuple< const DIScope *, const DIScope *, const DILocalVariable * > VarID
A unique key that represents a debug variable.