Skip to content

Commit

Permalink
[llvm-jitlink] Sink getPageSize call in Session::Create.
Browse files Browse the repository at this point in the history
The page size for the host process is only needed in the in-process use case.
  • Loading branch information
lhames committed Oct 2, 2021
1 parent 7cae0da commit d9152a8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llvm/tools/llvm-jitlink/llvm-jitlink.cpp
Expand Up @@ -813,10 +813,6 @@ class PhonyExternalsGenerator : public DefinitionGenerator {

Expected<std::unique_ptr<Session>> Session::Create(Triple TT) {

auto PageSize = sys::Process::getPageSize();
if (!PageSize)
return PageSize.takeError();

std::unique_ptr<ExecutorProcessControl> EPC;
if (OutOfProcessExecutor.getNumOccurrences()) {
/// If -oop-executor is passed then launch the executor.
Expand All @@ -832,6 +828,9 @@ Expected<std::unique_ptr<Session>> Session::Create(Triple TT) {
return REPC.takeError();
} else {
/// Otherwise use SelfExecutorProcessControl to target the current process.
auto PageSize = sys::Process::getPageSize();
if (!PageSize)
return PageSize.takeError();
EPC = std::make_unique<SelfExecutorProcessControl>(
std::make_shared<SymbolStringPool>(), std::move(TT), *PageSize,
createMemoryManager());
Expand Down

0 comments on commit d9152a8

Please sign in to comment.