Skip to content

Commit 7d8fac3

Browse files
lhamesmemfrob
authored andcommitted
[llvm-jitlink] Sink getPageSize call in Session::Create.
The page size for the host process is only needed in the in-process use case.
1 parent 1f2683c commit 7d8fac3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/tools/llvm-jitlink/llvm-jitlink.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -813,10 +813,6 @@ class PhonyExternalsGenerator : public DefinitionGenerator {
813813

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

816-
auto PageSize = sys::Process::getPageSize();
817-
if (!PageSize)
818-
return PageSize.takeError();
819-
820816
std::unique_ptr<ExecutorProcessControl> EPC;
821817
if (OutOfProcessExecutor.getNumOccurrences()) {
822818
/// If -oop-executor is passed then launch the executor.
@@ -832,6 +828,9 @@ Expected<std::unique_ptr<Session>> Session::Create(Triple TT) {
832828
return REPC.takeError();
833829
} else {
834830
/// Otherwise use SelfExecutorProcessControl to target the current process.
831+
auto PageSize = sys::Process::getPageSize();
832+
if (!PageSize)
833+
return PageSize.takeError();
835834
EPC = std::make_unique<SelfExecutorProcessControl>(
836835
std::make_shared<SymbolStringPool>(), std::move(TT), *PageSize,
837836
createMemoryManager());

0 commit comments

Comments
 (0)