Skip to content

Commit ebb3508

Browse files
authored
Revert "[Clang-Repl] Add support for out-of-process execution." (#115854)
Reverts #110418 Buildbot encountered a failure.
1 parent 512208b commit ebb3508

File tree

8 files changed

+10
-553
lines changed

8 files changed

+10
-553
lines changed

clang/include/clang/Interpreter/Interpreter.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include "llvm/ADT/DenseMap.h"
2222
#include "llvm/ExecutionEngine/JITSymbol.h"
23-
#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
2423
#include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
2524
#include "llvm/Support/Error.h"
2625
#include <memory>
@@ -130,14 +129,10 @@ class Interpreter {
130129
public:
131130
virtual ~Interpreter();
132131
static llvm::Expected<std::unique_ptr<Interpreter>>
133-
create(std::unique_ptr<CompilerInstance> CI,
134-
std::unique_ptr<llvm::orc::LLJITBuilder> JITBuilder = nullptr);
132+
create(std::unique_ptr<CompilerInstance> CI);
135133
static llvm::Expected<std::unique_ptr<Interpreter>>
136134
createWithCUDA(std::unique_ptr<CompilerInstance> CI,
137135
std::unique_ptr<CompilerInstance> DCI);
138-
static llvm::Expected<std::unique_ptr<llvm::orc::LLJITBuilder>>
139-
createLLJITBuilder(std::unique_ptr<llvm::orc::ExecutorProcessControl> EPC,
140-
llvm::StringRef OrcRuntimePath);
141136
const ASTContext &getASTContext() const;
142137
ASTContext &getASTContext();
143138
const CompilerInstance *getCompilerInstance() const;

clang/include/clang/Interpreter/RemoteJITUtils.h

Lines changed: 0 additions & 38 deletions
This file was deleted.

clang/lib/Interpreter/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ add_clang_library(clangInterpreter
2525
Interpreter.cpp
2626
InterpreterValuePrinter.cpp
2727
InterpreterUtils.cpp
28-
RemoteJITUtils.cpp
2928
Value.cpp
3029
${WASM_SRC}
3130
PARTIAL_SOURCES_INTENDED

clang/lib/Interpreter/Interpreter.cpp

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include "clang/Sema/Lookup.h"
4545
#include "clang/Serialization/ObjectFilePCHContainerReader.h"
4646
#include "llvm/ExecutionEngine/JITSymbol.h"
47-
#include "llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h"
4847
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
4948
#include "llvm/IR/Module.h"
5049
#include "llvm/Support/Errc.h"
@@ -457,11 +456,10 @@ const char *const Runtimes = R"(
457456
)";
458457

459458
llvm::Expected<std::unique_ptr<Interpreter>>
460-
Interpreter::create(std::unique_ptr<CompilerInstance> CI,
461-
std::unique_ptr<llvm::orc::LLJITBuilder> JB) {
459+
Interpreter::create(std::unique_ptr<CompilerInstance> CI) {
462460
llvm::Error Err = llvm::Error::success();
463-
auto Interp = std::unique_ptr<Interpreter>(
464-
new Interpreter(std::move(CI), Err, JB ? std::move(JB) : nullptr));
461+
auto Interp =
462+
std::unique_ptr<Interpreter>(new Interpreter(std::move(CI), Err));
465463
if (Err)
466464
return std::move(Err);
467465

@@ -580,25 +578,6 @@ createJITTargetMachineBuilder(const std::string &TT) {
580578
return llvm::orc::JITTargetMachineBuilder(llvm::Triple(TT));
581579
}
582580

583-
llvm::Expected<std::unique_ptr<llvm::orc::LLJITBuilder>>
584-
Interpreter::createLLJITBuilder(
585-
std::unique_ptr<llvm::orc::ExecutorProcessControl> EPC,
586-
llvm::StringRef OrcRuntimePath) {
587-
const std::string &TT = EPC->getTargetTriple().getTriple();
588-
auto JTMB = createJITTargetMachineBuilder(TT);
589-
if (!JTMB)
590-
return JTMB.takeError();
591-
auto JB = IncrementalExecutor::createDefaultJITBuilder(std::move(*JTMB));
592-
if (!JB)
593-
return JB.takeError();
594-
595-
(*JB)->setExecutorProcessControl(std::move(EPC));
596-
(*JB)->setPlatformSetUp(
597-
llvm::orc::ExecutorNativePlatform(OrcRuntimePath.str()));
598-
599-
return std::move(*JB);
600-
}
601-
602581
llvm::Error Interpreter::CreateExecutor() {
603582
if (IncrExecutor)
604583
return llvm::make_error<llvm::StringError>("Operation failed. "
@@ -723,11 +702,11 @@ llvm::Error Interpreter::LoadDynamicLibrary(const char *name) {
723702
if (!EE)
724703
return EE.takeError();
725704

726-
if (auto DLSG = llvm::orc::EPCDynamicLibrarySearchGenerator::Load(
727-
EE->getExecutionSession(), name))
728-
// FIXME: Eventually we should put each library in its own JITDylib and
729-
// turn off process symbols by default.
730-
EE->getProcessSymbolsJITDylib()->addGenerator(std::move(*DLSG));
705+
auto &DL = EE->getDataLayout();
706+
707+
if (auto DLSG = llvm::orc::DynamicLibrarySearchGenerator::Load(
708+
name, DL.getGlobalPrefix()))
709+
EE->getMainJITDylib().addGenerator(std::move(*DLSG));
731710
else
732711
return DLSG.takeError();
733712

0 commit comments

Comments
 (0)