[llvm] c40ce0d - [ORC] Add an early out for MachOPlatform's init-scraper plugin setup.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 1 20:12:36 PDT 2020
Author: Lang Hames
Date: 2020-09-01T20:12:23-07:00
New Revision: c40ce0da7189bd2ada15725a79525da13a67f3e4
URL: https://github.com/llvm/llvm-project/commit/c40ce0da7189bd2ada15725a79525da13a67f3e4
DIFF: https://github.com/llvm/llvm-project/commit/c40ce0da7189bd2ada15725a79525da13a67f3e4.diff
LOG: [ORC] Add an early out for MachOPlatform's init-scraper plugin setup.
If there's no initializer symbol in the current MaterializationResponsibility
then bail out without installing JITLink passes: they're going to be no-ops
anyway.
Added:
Modified:
llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
index 9ad2577d4174..098e870c7118 100644
--- a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
@@ -299,6 +299,9 @@ void MachOPlatform::InitScraperPlugin::modifyPassConfig(
MaterializationResponsibility &MR, const Triple &TT,
jitlink::PassConfiguration &Config) {
+ if (!MR.getInitializerSymbol())
+ return;
+
Config.PrePrunePasses.push_back([this, &MR](jitlink::LinkGraph &G) -> Error {
JITLinkSymbolVector InitSectionSymbols;
preserveInitSectionIfPresent(InitSectionSymbols, G, "__mod_init_func");
More information about the llvm-commits
mailing list