Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:52

0001 //===----- EHFrameRegistrationPlugin.h - Register eh-frames -----*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // Register eh-frame sections with a registrar.
0010 //
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_EXECUTIONENGINE_ORC_EHFRAMEREGISTRATIONPLUGIN_H
0014 #define LLVM_EXECUTIONENGINE_ORC_EHFRAMEREGISTRATIONPLUGIN_H
0015 
0016 #include "llvm/ExecutionEngine/Orc/LinkGraphLinkingLayer.h"
0017 
0018 #include <memory>
0019 #include <mutex>
0020 #include <vector>
0021 
0022 namespace llvm {
0023 
0024 namespace jitlink {
0025 class EHFrameRegistrar;
0026 } // namespace jitlink
0027 
0028 namespace orc {
0029 
0030 class EHFrameRegistrationPlugin : public LinkGraphLinkingLayer::Plugin {
0031 public:
0032   EHFrameRegistrationPlugin(
0033       ExecutionSession &ES,
0034       std::unique_ptr<jitlink::EHFrameRegistrar> Registrar);
0035   void modifyPassConfig(MaterializationResponsibility &MR,
0036                         jitlink::LinkGraph &G,
0037                         jitlink::PassConfiguration &PassConfig) override;
0038   Error notifyEmitted(MaterializationResponsibility &MR) override;
0039   Error notifyFailed(MaterializationResponsibility &MR) override;
0040   Error notifyRemovingResources(JITDylib &JD, ResourceKey K) override;
0041   void notifyTransferringResources(JITDylib &JD, ResourceKey DstKey,
0042                                    ResourceKey SrcKey) override;
0043 
0044 private:
0045   std::mutex EHFramePluginMutex;
0046   ExecutionSession &ES;
0047   std::unique_ptr<jitlink::EHFrameRegistrar> Registrar;
0048   DenseMap<MaterializationResponsibility *, ExecutorAddrRange> InProcessLinks;
0049   DenseMap<ResourceKey, std::vector<ExecutorAddrRange>> EHFrameRanges;
0050 };
0051 
0052 } // end namespace orc
0053 } // end namespace llvm
0054 
0055 #endif // LLVM_EXECUTIONENGINE_ORC_EHFRAMEREGISTRATIONPLUGIN_H