[llvm] [NFC] Move DroppedVariableStats to its own file and redesign it to be extensible. (PR #115563)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 01:50:05 PST 2024


================
@@ -0,0 +1,216 @@
+///===- DroppedVariableStats.h - Opt Diagnostics -*- C++ -*----------------===//
+///
+/// Part of the LLVM Project, under the Apache License v2.0 with LLVM
+/// Exceptions. See https://llvm.org/LICENSE.txt for license information.
+/// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+///
+///===---------------------------------------------------------------------===//
+/// \file
+/// Dropped Variable Statistics for Debug Information. Reports any number
+/// of #dbg_value that get dropped due to an optimization pass.
+///
+///===---------------------------------------------------------------------===//
+
+#ifndef LLVM_CODEGEN_DROPPEDVARIABLESTATS_H
+#define LLVM_CODEGEN_DROPPEDVARIABLESTATS_H
+
+#include "llvm/CodeGen/MachinePassManager.h"
+#include "llvm/IR/DebugInfoMetadata.h"
+#include "llvm/IR/DiagnosticInfo.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/Module.h"
+#include "llvm/IR/PassInstrumentation.h"
+
+namespace llvm {
+
+/// A unique key that represents a #dbg_value.
+using VarID =
+    std::tuple<const DIScope *, const DIScope *, const DILocalVariable *>;
----------------
OCHyams wrote:

Can you please include what each of the fields represents in the comment, and nit: should this be "A unique key that represents a debug variable"?

https://github.com/llvm/llvm-project/pull/115563


More information about the llvm-commits mailing list