Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/contrib/llvm-project/llvm/lib/DWARFCFIChecker/DWARFCFIFunctionFrameAnalyzer.cpp
213766 views
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
#include "llvm/DWARFCFIChecker/DWARFCFIFunctionFrameAnalyzer.h"
10
11
using namespace llvm;
12
13
CFIFunctionFrameAnalyzer::~CFIFunctionFrameAnalyzer() {
14
assert(UIAs.empty() &&
15
"all frames should be closed before the analysis finishes");
16
}
17
18
void CFIFunctionFrameAnalyzer::startFunctionFrame(
19
bool IsEH, ArrayRef<MCCFIInstruction> Prologue) {
20
UIAs.emplace_back(&getContext(), MCII, IsEH, Prologue);
21
}
22
23
void CFIFunctionFrameAnalyzer::emitInstructionAndDirectives(
24
const MCInst &Inst, ArrayRef<MCCFIInstruction> Directives) {
25
assert(!UIAs.empty() && "if the instruction is in a frame, there should be "
26
"a analysis instantiated for it");
27
UIAs.back().update(Inst, Directives);
28
}
29
30
void CFIFunctionFrameAnalyzer::finishFunctionFrame() {
31
assert(!UIAs.empty() && "there should be an analysis for each frame");
32
UIAs.pop_back();
33
}
34
35