[llvm] [NFC] Extract Printing portions of DWARFCFIProgram to new files (PR #143762)
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 11 17:49:16 PDT 2025
================
@@ -0,0 +1,41 @@
+//===- DWARFCFIPrinter.h ----------------------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_DWARF_DWARFCFIPRINTER_H
+#define LLVM_DEBUGINFO_DWARF_DWARFCFIPRINTER_H
+
+#include "llvm/DebugInfo/DWARF/DWARFCFIProgram.h"
+
+namespace llvm {
+
+struct DIDumpOptions;
+
+namespace dwarf {
+
+// This class is separate from CFIProgram to decouple CFIPrograms from the
+// enclosing DWARF dies and type units, which allows using them in lower-level
+// places without build dependencies.
+
+class CFIPrinter {
+public:
+ static void print(const CFIProgram &P, raw_ostream &OS,
+ DIDumpOptions DumpOpts, unsigned IndentLevel,
----------------
igorkudrin wrote:
Do we really need to pass around a new copy of the whole struct? Can't `DumpOpts` be passed as constant reference?
https://github.com/llvm/llvm-project/pull/143762
More information about the llvm-commits
mailing list