[llvm] aedeb8d - [LLJIT] Default to EPCEHFrameRegistrar rather than InProcessEHFrameRegistrar.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 9 21:58:23 PDT 2022
Author: Lang Hames
Date: 2022-10-09T21:58:10-07:00
New Revision: aedeb8d55705ad78fb9ec8a7e6316ce5d77f8a6d
URL: https://github.com/llvm/llvm-project/commit/aedeb8d55705ad78fb9ec8a7e6316ce5d77f8a6d
DIFF: https://github.com/llvm/llvm-project/commit/aedeb8d55705ad78fb9ec8a7e6316ce5d77f8a6d.diff
LOG: [LLJIT] Default to EPCEHFrameRegistrar rather than InProcessEHFrameRegistrar.
Now that ExecutionSession objects alway have ExecutorProcessControl (EPC)
objects attached we can use EPCEHFrameRegistrar by default, rather than
InProcessEHFrameRegistrar. This allows LLJIT to work out-of-the-box with remote
EPCs on platforms that use JITLink, without requiring a custom
ObjectLinkingLayerCreator to override the eh-frame registrar.
Added:
Modified:
llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
index 18f287a91d589..342651dd81965 100644
--- a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
@@ -9,6 +9,7 @@
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/ExecutionEngine/JITLink/EHFrameSupport.h"
#include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
+#include "llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h"
#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
#include "llvm/ExecutionEngine/Orc/MachOPlatform.h"
#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
@@ -723,8 +724,12 @@ Error LLJITBuilderState::prepareForConstruction() {
[](ExecutionSession &ES,
const Triple &) -> Expected<std::unique_ptr<ObjectLayer>> {
auto ObjLinkingLayer = std::make_unique<ObjectLinkingLayer>(ES);
- ObjLinkingLayer->addPlugin(std::make_unique<EHFrameRegistrationPlugin>(
- ES, std::make_unique<jitlink::InProcessEHFrameRegistrar>()));
+ if (auto EHFrameRegistrar = EPCEHFrameRegistrar::Create(ES))
+ ObjLinkingLayer->addPlugin(
+ std::make_unique<EHFrameRegistrationPlugin>(
+ ES, std::move(*EHFrameRegistrar)));
+ else
+ return EHFrameRegistrar.takeError();
return std::move(ObjLinkingLayer);
};
}
More information about the llvm-commits
mailing list