Skip to content

Commit 4793fb2

Browse files
author
git apple-llvm automerger
committed
Merge commit '7ebfcbd0ec52' from llvm.org/main into next
2 parents b652ff1 + 7ebfcbd commit 4793fb2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

clang/include/clang/Interpreter/Interpreter.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,13 @@ class Interpreter {
135135
std::string OrcRuntimePath = "";
136136
/// PID of the out-of-process JIT executor.
137137
uint32_t ExecutorPID = 0;
138+
/// An optional code model to provide to the JITTargetMachineBuilder
139+
std::optional<llvm::CodeModel::Model> CM = std::nullopt;
138140

139141
JITConfig()
140142
: IsOutOfProcess(false), OOPExecutor(""), OOPExecutorConnect(""),
141143
UseSharedMemory(false), SlabAllocateSize(0), OrcRuntimePath(""),
142-
ExecutorPID(0) {}
144+
ExecutorPID(0), CM(std::nullopt) {}
143145
};
144146

145147
protected:

clang/lib/Interpreter/Interpreter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,8 @@ llvm::Error Interpreter::CreateExecutor(JITConfig Config) {
647647
auto JTMB = createJITTargetMachineBuilder(TT);
648648
if (!JTMB)
649649
return JTMB.takeError();
650+
if (Config.CM)
651+
JTMB->setCodeModel(Config.CM);
650652
auto JB = IncrementalExecutor::createDefaultJITBuilder(std::move(*JTMB));
651653
if (!JB)
652654
return JB.takeError();

0 commit comments

Comments
 (0)