PreFixupPasses better reflects when these passes will run.
A future patch will (re)introduce a PostAllocationPasses list that will run
after allocation, but before JITLinkContext::notifyResolved is called to notify
the rest of the JIT about the resolved symbol addresses.
///
/// These passes are called on the graph after memory has been allocated,
/// content copied into working memory, and nodes have been assigned their
- /// final addresses.
+ /// final addresses, but before any fixups have been applied.
///
/// Notable use cases: Late link-time optimizations like GOT and stub
/// elimination.
- LinkGraphPassList PostAllocationPasses;
+ LinkGraphPassList PreFixupPasses;
/// Post-fixup passes.
///
});
// Add GOT/Stubs optimizer pass.
- Config.PostAllocationPasses.push_back(optimizeELF_x86_64_GOTAndStubs);
+ Config.PreFixupPasses.push_back(optimizeELF_x86_64_GOTAndStubs);
if (auto Err = Ctx->modifyPassConfig(G->getTargetTriple(), Config))
return Ctx->notifyFailed(std::move(Err));
dumpGraph(dbgs());
});
- if (auto Err = runPasses(Passes.PostAllocationPasses))
+ if (auto Err = runPasses(Passes.PreFixupPasses))
return deallocateAndBailOut(std::move(Err));
LLVM_DEBUG({
});
// Add GOT/Stubs optimizer pass.
- Config.PostAllocationPasses.push_back(optimizeMachO_x86_64_GOTAndStubs);
+ Config.PreFixupPasses.push_back(optimizeMachO_x86_64_GOTAndStubs);
}
if (auto Err = Ctx->modifyPassConfig(G->getTargetTriple(), Config))