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_DEBUGINFOSUPPORT_H
0014 #define LLVM_EXECUTIONENGINE_ORC_DEBUGINFOSUPPORT_H
0015
0016 #include "llvm/ExecutionEngine/Orc/Core.h"
0017 #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
0018
0019 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
0020
0021 namespace llvm {
0022
0023 namespace orc {
0024
0025 Error preserveDebugSections(jitlink::LinkGraph &G);
0026
0027 Expected<std::pair<std::unique_ptr<DWARFContext>,
0028 StringMap<std::unique_ptr<MemoryBuffer>>>>
0029 createDWARFContext(jitlink::LinkGraph &G);
0030
0031
0032 class DebugInfoPreservationPlugin : public ObjectLinkingLayer::Plugin {
0033 public:
0034 void modifyPassConfig(MaterializationResponsibility &MR,
0035 jitlink::LinkGraph &LG,
0036 jitlink::PassConfiguration &PassConfig) override {
0037 PassConfig.PrePrunePasses.push_back(preserveDebugSections);
0038 }
0039
0040 Error notifyRemovingResources(JITDylib &JD, ResourceKey K) override {
0041
0042 return Error::success();
0043 }
0044 Error notifyFailed(MaterializationResponsibility &MR) override {
0045
0046 return Error::success();
0047 }
0048 void notifyTransferringResources(JITDylib &JD, ResourceKey DstKey,
0049 ResourceKey SrcKey) override {
0050
0051 }
0052
0053 static Expected<std::unique_ptr<DebugInfoPreservationPlugin>> Create() {
0054 return std::make_unique<DebugInfoPreservationPlugin>();
0055 }
0056 };
0057
0058 }
0059
0060 }
0061
0062 #endif