File indexing completed on 2026-05-10 08:43:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef LLVM_EXECUTIONENGINE_ORC_PERFSUPPORTPLUGIN_H
0014 #define LLVM_EXECUTIONENGINE_ORC_PERFSUPPORTPLUGIN_H
0015
0016 #include "llvm/ExecutionEngine/Orc/Shared/PerfSharedStructs.h"
0017
0018 #include "llvm/ExecutionEngine/Orc/Core.h"
0019 #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
0020
0021 namespace llvm {
0022 namespace orc {
0023
0024
0025
0026
0027 class PerfSupportPlugin : public ObjectLinkingLayer::Plugin {
0028 public:
0029 PerfSupportPlugin(ExecutorProcessControl &EPC,
0030 ExecutorAddr RegisterPerfStartAddr,
0031 ExecutorAddr RegisterPerfEndAddr,
0032 ExecutorAddr RegisterPerfImplAddr, bool EmitDebugInfo,
0033 bool EmitUnwindInfo);
0034 ~PerfSupportPlugin();
0035
0036 void modifyPassConfig(MaterializationResponsibility &MR,
0037 jitlink::LinkGraph &G,
0038 jitlink::PassConfiguration &Config) override;
0039
0040 Error notifyFailed(MaterializationResponsibility &MR) override {
0041 return Error::success();
0042 }
0043
0044 Error notifyRemovingResources(JITDylib &JD, ResourceKey K) override {
0045 return Error::success();
0046 }
0047
0048 void notifyTransferringResources(JITDylib &JD, ResourceKey DstKey,
0049 ResourceKey SrcKey) override {}
0050
0051 static Expected<std::unique_ptr<PerfSupportPlugin>>
0052 Create(ExecutorProcessControl &EPC, JITDylib &JD, bool EmitDebugInfo,
0053 bool EmitUnwindInfo);
0054
0055 private:
0056 ExecutorProcessControl &EPC;
0057 ExecutorAddr RegisterPerfStartAddr;
0058 ExecutorAddr RegisterPerfEndAddr;
0059 ExecutorAddr RegisterPerfImplAddr;
0060 std::atomic<uint64_t> CodeIndex;
0061 bool EmitDebugInfo;
0062 bool EmitUnwindInfo;
0063 };
0064
0065 }
0066 }
0067
0068 #endif