|
18 | 18 | #include "llvm/IR/DebugInfoMetadata.h" |
19 | 19 | #include "llvm/IR/DiagnosticInfo.h" |
20 | 20 | #include "llvm/IR/Function.h" |
21 | | -#include "llvm/IR/InstIterator.h" |
22 | 21 | #include "llvm/IR/Module.h" |
23 | 22 | #include "llvm/IR/PassInstrumentation.h" |
24 | 23 |
|
@@ -207,33 +206,12 @@ class DroppedVariableStatsIR : public DroppedVariableStats { |
207 | 206 | virtual void |
208 | 207 | visitEveryInstruction(unsigned &DroppedCount, |
209 | 208 | DenseMap<VarID, DILocation *> &InlinedAtsMap, |
210 | | - VarID Var) override { |
211 | | - const DIScope *DbgValScope = std::get<0>(Var); |
212 | | - for (const auto &I : instructions(Func)) { |
213 | | - auto *DbgLoc = I.getDebugLoc().get(); |
214 | | - if (!DbgLoc) |
215 | | - continue; |
216 | | - if (updateDroppedCount(DbgLoc, DbgLoc->getScope(), DbgValScope, |
217 | | - InlinedAtsMap, Var, DroppedCount)) |
218 | | - break; |
219 | | - } |
220 | | - } |
| 209 | + VarID Var) override; |
221 | 210 | /// Override base class method to run on #dbg_values specifically. |
222 | 211 | virtual void visitEveryDebugRecord( |
223 | 212 | DenseSet<VarID> &VarIDSet, |
224 | 213 | DenseMap<StringRef, DenseMap<VarID, DILocation *>> &InlinedAtsMap, |
225 | | - StringRef FuncName, bool Before) override { |
226 | | - for (const auto &I : instructions(Func)) { |
227 | | - for (DbgRecord &DR : I.getDbgRecordRange()) { |
228 | | - if (auto *Dbg = dyn_cast<DbgVariableRecord>(&DR)) { |
229 | | - auto *DbgVar = Dbg->getVariable(); |
230 | | - auto DbgLoc = DR.getDebugLoc(); |
231 | | - populateVarIDSetAndInlinedMap(DbgVar, DbgLoc, VarIDSet, InlinedAtsMap, |
232 | | - FuncName, Before); |
233 | | - } |
234 | | - } |
235 | | - } |
236 | | - } |
| 214 | + StringRef FuncName, bool Before) override; |
237 | 215 |
|
238 | 216 | template <typename IRUnitT> static const IRUnitT *unwrapIR(Any IR) { |
239 | 217 | const IRUnitT **IRPtr = llvm::any_cast<const IRUnitT *>(&IR); |
|
0 commit comments