Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion clang/lib/Interpreter/IncrementalExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
#include "llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h"
#include "llvm/ExecutionEngine/Orc/Debugging/DebuggerSupport.h"
#include "llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h"
#include "llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
#include "RemoteJITUtils.h"

#include "llvm/ADT/StringExtras.h"
#include "llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h"
#include "llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h"
#include "llvm/ExecutionEngine/Orc/Debugging/ELFDebugObjectPlugin.h"
#include "llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h"
#include "llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h"
#include "llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace orc {
/// For each object containing debug info, installs JITLink passes to synthesize
/// a debug object and then register it via the GDB JIT-registration interface.
///
/// Currently MachO only. For ELF use DebugObjectManagerPlugin. These two
/// Currently MachO only. For ELF use ELFDebugObjectPlugin. These two
/// plugins will be merged in the near future.
class LLVM_ABI GDBJITDebugInfoRegistrationPlugin
: public ObjectLinkingLayer::Plugin {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===---- DebugObjectManagerPlugin.h - JITLink debug objects ---*- C++ -*-===//
//===------ ELFDebugObjectPlugin.h - JITLink debug objects ------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -10,8 +10,8 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_EXECUTIONENGINE_ORC_DEBUGOBJECTMANAGERPLUGIN_H
#define LLVM_EXECUTIONENGINE_ORC_DEBUGOBJECTMANAGERPLUGIN_H
#ifndef LLVM_EXECUTIONENGINE_ORC_ELFDEBUGOBJECTPLUGIN_H
#define LLVM_EXECUTIONENGINE_ORC_ELFDEBUGOBJECTPLUGIN_H

#include "llvm/ExecutionEngine/JITLink/JITLink.h"
#include "llvm/ExecutionEngine/Orc/Core.h"
Expand Down Expand Up @@ -46,7 +46,7 @@ class DebugObject;
/// DebugObjectRegistrar is notified. Ownership of DebugObjects remains with the
/// plugin.
///
class LLVM_ABI DebugObjectManagerPlugin : public ObjectLinkingLayer::Plugin {
class LLVM_ABI ELFDebugObjectPlugin : public ObjectLinkingLayer::Plugin {
public:
/// Create the plugin to submit DebugObjects for JITLink artifacts. For all
/// options the recommended setting is true.
Expand All @@ -63,9 +63,9 @@ class LLVM_ABI DebugObjectManagerPlugin : public ObjectLinkingLayer::Plugin {
/// sequence. When turning this off, the user has to issue the call to
/// __jit_debug_register_code() on the executor side manually.
///
DebugObjectManagerPlugin(ExecutionSession &ES, bool RequireDebugSections,
bool AutoRegisterCode, Error &Err);
~DebugObjectManagerPlugin() override;
ELFDebugObjectPlugin(ExecutionSession &ES, bool RequireDebugSections,
bool AutoRegisterCode, Error &Err);
~ELFDebugObjectPlugin() override;

void notifyMaterializing(MaterializationResponsibility &MR,
jitlink::LinkGraph &G, jitlink::JITLinkContext &Ctx,
Expand Down Expand Up @@ -99,4 +99,4 @@ class LLVM_ABI DebugObjectManagerPlugin : public ObjectLinkingLayer::Plugin {
} // namespace orc
} // namespace llvm

#endif // LLVM_EXECUTIONENGINE_ORC_DEBUGOBJECTMANAGERPLUGIN_H
#endif // LLVM_EXECUTIONENGINE_ORC_ELFDEBUGOBJECTPLUGIN_H
1 change: 0 additions & 1 deletion llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ add_llvm_component_library(LLVMOrcJIT
CompileOnDemandLayer.cpp
CompileUtils.cpp
Core.cpp
DebugObjectManagerPlugin.cpp
DebugUtils.cpp
EHFrameRegistrationPlugin.cpp
EPCDynamicLibrarySearchGenerator.cpp
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/ExecutionEngine/Orc/Debugging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ add_llvm_component_library(LLVMOrcDebugging
DebugInfoSupport.cpp
DebuggerSupport.cpp
DebuggerSupportPlugin.cpp
ELFDebugObjectPlugin.cpp
LLJITUtilsCBindings.cpp
PerfSupportPlugin.cpp
VTuneSupportPlugin.cpp
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/ExecutionEngine/Orc/Debugging/DebuggerSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//

#include "llvm/ExecutionEngine/Orc/Debugging/DebuggerSupport.h"
#include "llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h"
#include "llvm/ExecutionEngine/Orc/Debugging/DebuggerSupportPlugin.h"
#include "llvm/ExecutionEngine/Orc/Debugging/ELFDebugObjectPlugin.h"
#include "llvm/ExecutionEngine/Orc/LLJIT.h"

#define DEBUG_TYPE "orc"
Expand Down Expand Up @@ -36,8 +36,8 @@ Error enableDebuggerSupport(LLJIT &J) {
switch (TT.getObjectFormat()) {
case Triple::ELF: {
Error TargetSymErr = Error::success();
ObjLinkingLayer->addPlugin(std::make_unique<DebugObjectManagerPlugin>(
ES, false, true, TargetSymErr));
ObjLinkingLayer->addPlugin(
std::make_unique<ELFDebugObjectPlugin>(ES, false, true, TargetSymErr));
return TargetSymErr;
}
case Triple::MachO: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===------- DebugObjectManagerPlugin.cpp - JITLink debug objects ---------===//
//===------- ELFDebugObjectPlugin.cpp - JITLink debug objects ---------===//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Header comment formatting. ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha thanks, fixed together with the shlibs fix

//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -11,7 +11,7 @@
//
//===----------------------------------------------------------------------===//

#include "llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h"
#include "llvm/ExecutionEngine/Orc/Debugging/ELFDebugObjectPlugin.h"

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringMap.h"
Expand Down Expand Up @@ -406,10 +406,9 @@ createDebugObjectFromBuffer(ExecutionSession &ES, LinkGraph &G,
}
}

DebugObjectManagerPlugin::DebugObjectManagerPlugin(ExecutionSession &ES,
bool RequireDebugSections,
bool AutoRegisterCode,
Error &Err)
ELFDebugObjectPlugin::ELFDebugObjectPlugin(ExecutionSession &ES,
bool RequireDebugSections,
bool AutoRegisterCode, Error &Err)
: ES(ES), RequireDebugSections(RequireDebugSections),
AutoRegisterCode(AutoRegisterCode) {
// Pass bootstrap symbol for registration function to enable debugging
Expand All @@ -418,9 +417,9 @@ DebugObjectManagerPlugin::DebugObjectManagerPlugin(ExecutionSession &ES,
{{RegistrationAction, rt::RegisterJITLoaderGDBAllocActionName}});
}

DebugObjectManagerPlugin::~DebugObjectManagerPlugin() = default;
ELFDebugObjectPlugin::~ELFDebugObjectPlugin() = default;

void DebugObjectManagerPlugin::notifyMaterializing(
void ELFDebugObjectPlugin::notifyMaterializing(
MaterializationResponsibility &MR, LinkGraph &G, JITLinkContext &Ctx,
MemoryBufferRef ObjBuffer) {
std::lock_guard<std::mutex> Lock(PendingObjsLock);
Expand All @@ -443,9 +442,9 @@ void DebugObjectManagerPlugin::notifyMaterializing(
}
}

void DebugObjectManagerPlugin::modifyPassConfig(
MaterializationResponsibility &MR, LinkGraph &G,
PassConfiguration &PassConfig) {
void ELFDebugObjectPlugin::modifyPassConfig(MaterializationResponsibility &MR,
LinkGraph &G,
PassConfiguration &PassConfig) {
// Not all link artifacts have associated debug objects.
std::lock_guard<std::mutex> Lock(PendingObjsLock);
auto It = PendingObjs.find(&MR);
Expand Down Expand Up @@ -507,16 +506,15 @@ void DebugObjectManagerPlugin::modifyPassConfig(
}
}

Error DebugObjectManagerPlugin::notifyFailed(
MaterializationResponsibility &MR) {
Error ELFDebugObjectPlugin::notifyFailed(MaterializationResponsibility &MR) {
std::lock_guard<std::mutex> Lock(PendingObjsLock);
PendingObjs.erase(&MR);
return Error::success();
}

void DebugObjectManagerPlugin::notifyTransferringResources(JITDylib &JD,
ResourceKey DstKey,
ResourceKey SrcKey) {
void ELFDebugObjectPlugin::notifyTransferringResources(JITDylib &JD,
ResourceKey DstKey,
ResourceKey SrcKey) {
// Debug objects are stored by ResourceKey only after registration.
// Thus, pending objects don't need to be updated here.
std::lock_guard<std::mutex> Lock(RegisteredObjsLock);
Expand All @@ -530,8 +528,8 @@ void DebugObjectManagerPlugin::notifyTransferringResources(JITDylib &JD,
}
}

Error DebugObjectManagerPlugin::notifyRemovingResources(JITDylib &JD,
ResourceKey Key) {
Error ELFDebugObjectPlugin::notifyRemovingResources(JITDylib &JD,
ResourceKey Key) {
// Removing the resource for a pending object fails materialization, so they
// get cleaned up in the notifyFailed() handler.
std::lock_guard<std::mutex> Lock(RegisteredObjsLock);
Expand Down
6 changes: 3 additions & 3 deletions llvm/tools/llvm-jitlink/llvm-jitlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX, LLVM_ENABLE_THREADS
#include "llvm/ExecutionEngine/Orc/AbsoluteSymbols.h"
#include "llvm/ExecutionEngine/Orc/COFFPlatform.h"
#include "llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h"
#include "llvm/ExecutionEngine/Orc/Debugging/DebugInfoSupport.h"
#include "llvm/ExecutionEngine/Orc/Debugging/DebuggerSupportPlugin.h"
#include "llvm/ExecutionEngine/Orc/Debugging/ELFDebugObjectPlugin.h"
#include "llvm/ExecutionEngine/Orc/Debugging/PerfSupportPlugin.h"
#include "llvm/ExecutionEngine/Orc/Debugging/VTuneSupportPlugin.h"
#include "llvm/ExecutionEngine/Orc/EHFrameRegistrationPlugin.h"
Expand Down Expand Up @@ -1299,8 +1299,8 @@ Session::Session(std::unique_ptr<ExecutorProcessControl> EPC, Error &Err)
ObjLayer.addPlugin(ExitOnErr(EHFrameRegistrationPlugin::Create(ES)));
if (DebuggerSupport) {
Error TargetSymErr = Error::success();
auto Plugin = std::make_unique<DebugObjectManagerPlugin>(ES, true, true,
TargetSymErr);
auto Plugin =
std::make_unique<ELFDebugObjectPlugin>(ES, true, true, TargetSymErr);
if (!TargetSymErr)
ObjLayer.addPlugin(std::move(Plugin));
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static_library("Orc") {
"CompileOnDemandLayer.cpp",
"CompileUtils.cpp",
"Core.cpp",
"DebugObjectManagerPlugin.cpp",
"ELFDebugObjectPlugin.cpp",
"DebugUtils.cpp",
"EHFrameRegistrationPlugin.cpp",
"ELFNixPlatform.cpp",
Expand Down
Loading