Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clang/lib/Interpreter/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,9 @@ llvm::Error Interpreter::CreateExecutor() {
auto JTMB = createJITTargetMachineBuilder(TT);
if (!JTMB)
return JTMB.takeError();
#if defined(_WIN32)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the common practice is for the JIT/interpreter side, but I would prefer to use a check in code, whether the target triple is windows, rather than using an ifdef. Most of clang is cross-compiling agnostic anyway. For the JIT that's obviously not the case, but by not using ifdefs, you get the code compile tested in all builds, not only the windows ones.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact the JIT supports cross-compiling too, and will happily run in cross-process mode targeting a process on different OS / architecture. :)

JTMB->getOptions().EmulatedTLS = false;
#endif
auto JB = IncrementalExecutor::createDefaultJITBuilder(std::move(*JTMB));
if (!JB)
return JB.takeError();
Expand Down