Path: blob/main/contrib/llvm-project/llvm/lib/ExecutionEngine/Orc/EPCEHFrameRegistrar.cpp
35268 views
//===------ EPCEHFrameRegistrar.cpp - EPC-based eh-frame registration -----===//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/ExecutionEngine/Orc/EPCEHFrameRegistrar.h"910#include "llvm/ExecutionEngine/Orc/Core.h"11#include "llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h"1213using namespace llvm::orc::shared;1415namespace llvm {16namespace orc {1718Expected<std::unique_ptr<EPCEHFrameRegistrar>>19EPCEHFrameRegistrar::Create(ExecutionSession &ES) {2021// Lookup addresseses of the registration/deregistration functions in the22// bootstrap map.23ExecutorAddr RegisterEHFrameSectionWrapper;24ExecutorAddr DeregisterEHFrameSectionWrapper;25if (auto Err = ES.getExecutorProcessControl().getBootstrapSymbols(26{{RegisterEHFrameSectionWrapper,27rt::RegisterEHFrameSectionWrapperName},28{DeregisterEHFrameSectionWrapper,29rt::DeregisterEHFrameSectionWrapperName}}))30return std::move(Err);3132return std::make_unique<EPCEHFrameRegistrar>(33ES, RegisterEHFrameSectionWrapper, DeregisterEHFrameSectionWrapper);34}3536Error EPCEHFrameRegistrar::registerEHFrames(ExecutorAddrRange EHFrameSection) {37return ES.callSPSWrapper<void(SPSExecutorAddrRange)>(38RegisterEHFrameSectionWrapper, EHFrameSection);39}4041Error EPCEHFrameRegistrar::deregisterEHFrames(42ExecutorAddrRange EHFrameSection) {43return ES.callSPSWrapper<void(SPSExecutorAddrRange)>(44DeregisterEHFrameSectionWrapper, EHFrameSection);45}4647} // end namespace orc48} // end namespace llvm495051