AMDGPU: Mark test as XFAIL in expensive_checks builds
[llvm-project.git] / llvm / lib / ExecutionEngine / Orc / EPCEHFrameRegistrar.cpp
blobf15315260ab01119fd8aa33a69e186b87436e205
1 //===------ EPCEHFrameRegistrar.cpp - EPC-based eh-frame registration -----===//
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 //===----------------------------------------------------------------------===//
9 #include "llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h"
11 #include "llvm/ExecutionEngine/Orc/Core.h"
12 #include "llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h"
14 using namespace llvm::orc::shared;
16 namespace llvm {
17 namespace orc {
19 Expected<std::unique_ptr<EPCEHFrameRegistrar>>
20 EPCEHFrameRegistrar::Create(ExecutionSession &ES) {
22 // Lookup addresseses of the registration/deregistration functions in the
23 // bootstrap map.
24 ExecutorAddr RegisterEHFrameSectionWrapper;
25 ExecutorAddr DeregisterEHFrameSectionWrapper;
26 if (auto Err = ES.getExecutorProcessControl().getBootstrapSymbols(
27 {{RegisterEHFrameSectionWrapper,
28 rt::RegisterEHFrameSectionWrapperName},
29 {DeregisterEHFrameSectionWrapper,
30 rt::DeregisterEHFrameSectionWrapperName}}))
31 return std::move(Err);
33 return std::make_unique<EPCEHFrameRegistrar>(
34 ES, RegisterEHFrameSectionWrapper, DeregisterEHFrameSectionWrapper);
37 Error EPCEHFrameRegistrar::registerEHFrames(ExecutorAddrRange EHFrameSection) {
38 return ES.callSPSWrapper<void(SPSExecutorAddrRange)>(
39 RegisterEHFrameSectionWrapper, EHFrameSection);
42 Error EPCEHFrameRegistrar::deregisterEHFrames(
43 ExecutorAddrRange EHFrameSection) {
44 return ES.callSPSWrapper<void(SPSExecutorAddrRange)>(
45 DeregisterEHFrameSectionWrapper, EHFrameSection);
48 } // end namespace orc
49 } // end namespace llvm