LLVM 22.0.0git
DWARFCFIState.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 DWARFCFIState class.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_DWARFCFICHECKER_UNWINDINFOSTATE_H
15#define LLVM_DWARFCFICHECKER_UNWINDINFOSTATE_H
16
18#include "llvm/MC/MCContext.h"
19#include "llvm/MC/MCDwarf.h"
21#include <optional>
22
23namespace llvm {
24
26
27/// This class is used to maintain a CFI state, referred to as an unwinding row,
28/// during CFI analysis. The only way to modify the state is by updating it with
29/// a CFI directive.
31public:
32 DWARFCFIState(MCContext *Context) : Context(Context), IsInitiated(false) {};
33
34 LLVM_ABI std::optional<dwarf::UnwindRow> getCurrentUnwindRow() const;
35
36 /// This method updates the state by applying \p Directive to the current
37 /// state. If the directive is not supported by the checker or any error
38 /// happens while applying the CFI directive, a warning or error is reported
39 /// to the user, and the directive is ignored, leaving the state unchanged.
41
42private:
44
45private:
47 MCContext *Context;
48 bool IsInitiated;
49};
50
51} // namespace llvm
52
53#endif
#define LLVM_ABI
Definition Compiler.h:213
LLVM_ABI std::optional< dwarf::UnwindRow > getCurrentUnwindRow() const
DWARFCFIState(MCContext *Context)
LLVM_ABI void update(const MCCFIInstruction &Directive)
This method updates the state by applying Directive to the current state.
Context object for machine code objects.
Definition MCContext.h:83
Represent a sequence of Call Frame Information instructions that, when read in order,...
A class that represents a single row in the unwind table that is decoded by parsing the DWARF Call Fr...
This is an optimization pass for GlobalISel generic memory operations.
uint32_t DWARFRegNum