[llvm-jitlink] Sink getPageSize call in Session::Create.

The page size for the host process is only needed in the in-process use case.
This commit is contained in:
Lang Hames 2021-10-02 11:28:14 -07:00
parent 7cae0daee6
commit d9152a8571
1 changed files with 3 additions and 4 deletions

View File

@ -813,10 +813,6 @@ public:
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.
@ -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());