aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
diff options
context:
space:
mode:
authorPrem Chintalapudi <prem.chintalapudi@gmail.com>2023-09-28 14:40:43 -0700
committerLang Hames <lhames@gmail.com>2023-09-28 16:13:49 -0700
commit7ddf7d87831a90164fd125589850fcf48d24f33f (patch)
treec6ee0c53c9e56947d181318987b8ade317836afc /llvm/tools/llvm-jitlink/llvm-jitlink.cpp
parent2f3b7d33f421b723728262a6978041d93f1f8c5c (diff)
downloadllvm-7ddf7d87831a90164fd125589850fcf48d24f33f.zip
llvm-7ddf7d87831a90164fd125589850fcf48d24f33f.tar.gz
llvm-7ddf7d87831a90164fd125589850fcf48d24f33f.tar.bz2
[ORC] Add DWARFContext generation from LinkGraphs, use in perf support.
This patch adds line numbers to perf jitdump records emitted by the PerfSupportPlugin, by parsing and using a DWARFContext from preserved debug sections. To avoid making the OrcJIT library depend on DebugInfoDWARF this patch introduces a new OrcDebugging library. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D146391
Diffstat (limited to 'llvm/tools/llvm-jitlink/llvm-jitlink.cpp')
-rw-r--r--llvm/tools/llvm-jitlink/llvm-jitlink.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index c1354ee..17aeb30 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -19,6 +19,8 @@
#include "llvm/ExecutionEngine/Orc/COFFVCRuntimeSupport.h"
#include "llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h"
#include "llvm/ExecutionEngine/Orc/DebuggerSupportPlugin.h"
+#include "llvm/ExecutionEngine/Orc/Debugging/DebugInfoSupport.h"
+#include "llvm/ExecutionEngine/Orc/Debugging/PerfSupportPlugin.h"
#include "llvm/ExecutionEngine/Orc/ELFNixPlatform.h"
#include "llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h"
#include "llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h"
@@ -28,7 +30,6 @@
#include "llvm/ExecutionEngine/Orc/MachOPlatform.h"
#include "llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h"
#include "llvm/ExecutionEngine/Orc/ObjectFileInterface.h"
-#include "llvm/ExecutionEngine/Orc/PerfSupportPlugin.h"
#include "llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h"
#include "llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h"
#include "llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.h"
@@ -990,9 +991,11 @@ Session::Session(std::unique_ptr<ExecutorProcessControl> EPC, Error &Err)
ObjLayer.addPlugin(ExitOnErr(
GDBJITDebugInfoRegistrationPlugin::Create(this->ES, *MainJD, TT)));
- if (PerfSupport && TT.isOSBinFormatELF())
+ if (PerfSupport && TT.isOSBinFormatELF()) {
+ ObjLayer.addPlugin(ExitOnErr(DebugInfoPreservationPlugin::Create()));
ObjLayer.addPlugin(ExitOnErr(PerfSupportPlugin::Create(
- this->ES.getExecutorProcessControl(), *MainJD, true)));
+ this->ES.getExecutorProcessControl(), *MainJD, true, true)));
+ }
// Set up the platform.
if (TT.isOSBinFormatMachO() && !OrcRuntime.empty()) {