[llvm] Minimal unwinding information (DWARF CFI) checker (PR #145633)

Simon Tatham via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 06:47:08 PDT 2025


================
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 CFIFunctionFrameReceiver class.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DWARFCFICHECKER_DWARFCFIFUNCTIONFRAMERECEIVER_H
+#define LLVM_DWARFCFICHECKER_DWARFCFIFUNCTIONFRAMERECEIVER_H
+
+#include "llvm/ADT/ArrayRef.h"
+
+namespace llvm {
+
+class MCCFIInstruction;
+class MCContext;
+class MCInst;
+
+class CFIFunctionFrameReceiver {
+private:
+  MCContext &Context;
+
+public:
+  CFIFunctionFrameReceiver(const CFIFunctionFrameReceiver &) = delete;
+  CFIFunctionFrameReceiver &
+  operator=(const CFIFunctionFrameReceiver &) = delete;
+  virtual ~CFIFunctionFrameReceiver();
+
+  CFIFunctionFrameReceiver(MCContext &Context) : Context(Context) {}
+
+  MCContext &getContext() const { return Context; }
+
+  virtual void startFunctionUnit(bool IsEH,
----------------
statham-arm wrote:

I notice that in the associated source file, you've defined these three virtual methods with empty function bodies. Wouldn't that have been just as good to do right here, so that nobody has to go and look at the separate source file at all?

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


More information about the llvm-commits mailing list