#include "llvm/ExecutionEngine/Orc/Debugging/PerfSupportPlugin.h"
#include "llvm/ExecutionEngine/JITLink/x86_64.h"
#include "llvm/ExecutionEngine/Orc/Debugging/DebugInfoSupport.h"
#include "llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h"
#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
#define DEBUG_TYPE …
usingnamespacellvm;
usingnamespacellvm::orc;
usingnamespacellvm::jitlink;
namespace {
Expected<std::string> createX64EHFrameHeader(Section &EHFrame,
llvm::endianness endianness,
bool absolute) { … }
constexpr StringRef RegisterPerfStartSymbolName = …;
constexpr StringRef RegisterPerfEndSymbolName = …;
constexpr StringRef RegisterPerfImplSymbolName = …;
static PerfJITCodeLoadRecord
getCodeLoadRecord(const Symbol &Sym, std::atomic<uint64_t> &CodeIndex) { … }
static std::optional<PerfJITDebugInfoRecord>
getDebugInfoRecord(const Symbol &Sym, DWARFContext &DC) { … }
static Expected<PerfJITCodeUnwindingInfoRecord>
getUnwindingRecord(LinkGraph &G) { … }
static PerfJITRecordBatch getRecords(ExecutionSession &ES, LinkGraph &G,
std::atomic<uint64_t> &CodeIndex,
bool EmitDebugInfo, bool EmitUnwindInfo) { … }
}
PerfSupportPlugin::PerfSupportPlugin(ExecutorProcessControl &EPC,
ExecutorAddr RegisterPerfStartAddr,
ExecutorAddr RegisterPerfEndAddr,
ExecutorAddr RegisterPerfImplAddr,
bool EmitDebugInfo, bool EmitUnwindInfo)
: … { … }
PerfSupportPlugin::~PerfSupportPlugin() { … }
void PerfSupportPlugin::modifyPassConfig(MaterializationResponsibility &MR,
LinkGraph &G,
PassConfiguration &Config) { … }
Expected<std::unique_ptr<PerfSupportPlugin>>
PerfSupportPlugin::Create(ExecutorProcessControl &EPC, JITDylib &JD,
bool EmitDebugInfo, bool EmitUnwindInfo) { … }