LLVM 22.0.0git
DWARFCFIFunctionFrameAnalyzer.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file declares CFIFunctionFrameAnalyzer class.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_DWARFCFICHECKER_DWARFCFIFUNCTIONFRAMEANALYZER_H
15#define LLVM_DWARFCFICHECKER_DWARFCFIFUNCTIONFRAMEANALYZER_H
16
17#include "DWARFCFIAnalysis.h"
19#include "llvm/ADT/ArrayRef.h"
22
23namespace llvm {
24
25/// This class implements the `CFIFunctionFrameReceiver` interface to validate
26/// Call Frame Information in a stream of function frames. For validation, it
27/// instantiates a `DWARFCFIAnalysis` for each frame. The errors/warnings are
28/// emitted through the `MCContext` instance to the constructor. If a frame
29/// finishes without being started or if all the frames are not finished before
30/// this classes is destructed, the program fails through an assertion.
32public:
34 : CFIFunctionFrameReceiver(Context), MCII(MCII) {}
36
37 void startFunctionFrame(bool IsEH,
38 ArrayRef<MCCFIInstruction> Prologue) override;
39 void
40 emitInstructionAndDirectives(const MCInst &Inst,
41 ArrayRef<MCCFIInstruction> Directives) override;
42 void finishFunctionFrame() override;
43
44private:
45 MCInstrInfo const &MCII;
47};
48
49} // namespace llvm
50
51#endif
#define LLVM_ABI
Definition Compiler.h:213
This file declares DWARFCFIAnalysis class.
This file declares CFIFunctionFrameReceiver class.
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:41
This class implements the CFIFunctionFrameReceiver interface to validate Call Frame Information in a ...
CFIFunctionFrameAnalyzer(MCContext &Context, const MCInstrInfo &MCII)
CFIFunctionFrameReceiver(const CFIFunctionFrameReceiver &)=delete
Context object for machine code objects.
Definition MCContext.h:83
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
Interface to description of machine instruction set.
Definition MCInstrInfo.h:27
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This is an optimization pass for GlobalISel generic memory operations.