Path: blob/main/contrib/llvm-project/llvm/lib/DWARFCFIChecker/DWARFCFIFunctionFrameAnalyzer.cpp
213766 views
//===----------------------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "llvm/DWARFCFIChecker/DWARFCFIFunctionFrameAnalyzer.h"910using namespace llvm;1112CFIFunctionFrameAnalyzer::~CFIFunctionFrameAnalyzer() {13assert(UIAs.empty() &&14"all frames should be closed before the analysis finishes");15}1617void CFIFunctionFrameAnalyzer::startFunctionFrame(18bool IsEH, ArrayRef<MCCFIInstruction> Prologue) {19UIAs.emplace_back(&getContext(), MCII, IsEH, Prologue);20}2122void CFIFunctionFrameAnalyzer::emitInstructionAndDirectives(23const MCInst &Inst, ArrayRef<MCCFIInstruction> Directives) {24assert(!UIAs.empty() && "if the instruction is in a frame, there should be "25"a analysis instantiated for it");26UIAs.back().update(Inst, Directives);27}2829void CFIFunctionFrameAnalyzer::finishFunctionFrame() {30assert(!UIAs.empty() && "there should be an analysis for each frame");31UIAs.pop_back();32}333435