[llvm] Minimal unwinding information (DWARF CFI) checker (PR #145633)
Paul Kirth via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 25 12:49:48 PDT 2025
================
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+/// This file declares FunctionUnitStreamer class.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_UNWINDINFOCHECKER_FUNCTIONUNITSTREAMER_H
+#define LLVM_UNWINDINFOCHECKER_FUNCTIONUNITSTREAMER_H
+
+#include "FunctionUnitAnalyzer.h"
+#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCDwarf.h"
+#include "llvm/MC/MCInstrInfo.h"
+#include "llvm/MC/MCStreamer.h"
+#include <cstdio>
+#include <memory>
+#include <optional>
+
+namespace llvm {
+
+class FunctionUnitStreamer : public MCStreamer {
+ std::vector<unsigned> FrameIndices;
+
+ unsigned LastDirectiveIndex;
+ std::optional<MCInst> LastInstruction;
+ std::unique_ptr<FunctionUnitAnalyzer> Analyzer;
----------------
ilovepi wrote:
We normally put private fields at the bottom of the class. Also please consider field ordering. using unsigned as the second field is probably going to end up w/ padding bytes.
https://github.com/llvm/llvm-project/pull/145633
More information about the llvm-commits
mailing list