LLVM
22.0.0git
include
llvm
DWARFCFIChecker
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
17
#include "
llvm/DebugInfo/DWARF/LowLevel/DWARFUnwindTable.h
"
18
#include "
llvm/MC/MCContext.h
"
19
#include "
llvm/MC/MCDwarf.h
"
20
#include "
llvm/Support/Compiler.h
"
21
#include <optional>
22
23
namespace
llvm
{
24
25
using
DWARFRegNum
=
uint32_t
;
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.
30
class
DWARFCFIState
{
31
public
:
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.
40
LLVM_ABI
void
update
(
const
MCCFIInstruction
&
Directive
);
41
42
private
:
43
dwarf::CFIProgram
convert(
MCCFIInstruction
Directive
);
44
45
private
:
46
dwarf::UnwindRow
Row;
47
MCContext
*Context;
48
bool
IsInitiated;
49
};
50
51
}
// namespace llvm
52
53
#endif
Compiler.h
LLVM_ABI
#define LLVM_ABI
Definition
Compiler.h:213
DWARFUnwindTable.h
MCContext.h
MCDwarf.h
llvm::DWARFCFIState::getCurrentUnwindRow
LLVM_ABI std::optional< dwarf::UnwindRow > getCurrentUnwindRow() const
Definition
DWARFCFIState.cpp:21
llvm::DWARFCFIState::DWARFCFIState
DWARFCFIState(MCContext *Context)
Definition
DWARFCFIState.h:32
llvm::DWARFCFIState::update
LLVM_ABI void update(const MCCFIInstruction &Directive)
This method updates the state by applying Directive to the current state.
Definition
DWARFCFIState.cpp:27
llvm::Directive
Definition
DirectiveEmitter.h:232
llvm::MCCFIInstruction
Definition
MCDwarf.h:509
llvm::MCContext
Context object for machine code objects.
Definition
MCContext.h:83
llvm::dwarf::CFIProgram
Represent a sequence of Call Frame Information instructions that, when read in order,...
Definition
DWARFCFIProgram.h:34
llvm::dwarf::UnwindRow
A class that represents a single row in the unwind table that is decoded by parsing the DWARF Call Fr...
Definition
DWARFUnwindTable.h:231
uint32_t
false
Definition
MachinePipeliner.cpp:239
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
AddressRanges.h:18
llvm::DWARFRegNum
uint32_t DWARFRegNum
Definition
DWARFCFIState.h:25
Generated on
for LLVM by
1.14.0