forked from OSchip/llvm-project
[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.
This commit is contained in:
parent
7ff335a25f
commit
c40ce0da71
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue