Skip to content

Commit e1e8bba

Browse files
author
kr-2003
committed
Revert "[clang-repl] Enable extending launchExecutor (llvm#152562)"
This reverts commit eccc6e2.
1 parent 5d099c2 commit e1e8bba

File tree

5 files changed

+3
-221
lines changed

5 files changed

+3
-221
lines changed

clang/include/clang/Interpreter/RemoteJITUtils.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626

2727
llvm::Expected<std::unique_ptr<llvm::orc::SimpleRemoteEPC>>
2828
launchExecutor(llvm::StringRef ExecutablePath, bool UseSharedMemory,
29-
llvm::StringRef SlabAllocateSizeString,
30-
std::function<void()> CustomizeFork = nullptr);
29+
llvm::StringRef SlabAllocateSizeString);
3130

3231
/// Create a JITLinkExecutor that connects to the given network address
3332
/// through a TCP socket. A valid NetworkAddress provides hostname and port,
@@ -36,13 +35,4 @@ llvm::Expected<std::unique_ptr<llvm::orc::SimpleRemoteEPC>>
3635
connectTCPSocket(llvm::StringRef NetworkAddress, bool UseSharedMemory,
3736
llvm::StringRef SlabAllocateSizeString);
3837

39-
#ifdef LLVM_ON_UNIX
40-
/// Returns PID of last launched executor.
41-
pid_t getLastLaunchedExecutorPID();
42-
43-
/// Returns PID of nth launched executor.
44-
/// 1-based indexing.
45-
pid_t getNthLaunchedExecutorPID(int n);
46-
#endif
47-
4838
#endif // LLVM_CLANG_INTERPRETER_REMOTEJITUTILS_H

clang/lib/Interpreter/RemoteJITUtils.cpp

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333
using namespace llvm;
3434
using namespace llvm::orc;
3535

36-
#if LLVM_ON_UNIX
37-
static std::vector<pid_t> LaunchedExecutorPID;
38-
#endif
39-
4036
Expected<uint64_t> getSlabAllocSize(StringRef SizeString) {
4137
SizeString = SizeString.trim();
4238

@@ -93,14 +89,9 @@ createSharedMemoryManager(SimpleRemoteEPC &SREPC,
9389
SlabSize, SREPC, SAs);
9490
}
9591

96-
// Launches an out-of-process executor for remote JIT. The calling program can
97-
// provide a CustomizeFork callback, which allows it to run custom code in the
98-
// child process before exec. This enables sending custom setup or code to be
99-
// executed in the child (out-of-process) executor.
10092
Expected<std::unique_ptr<SimpleRemoteEPC>>
10193
launchExecutor(StringRef ExecutablePath, bool UseSharedMemory,
102-
llvm::StringRef SlabAllocateSizeString,
103-
std::function<void()> CustomizeFork) {
94+
llvm::StringRef SlabAllocateSizeString) {
10495
#ifndef LLVM_ON_UNIX
10596
// FIXME: Add support for Windows.
10697
return make_error<StringError>("-" + ExecutablePath +
@@ -143,9 +134,6 @@ launchExecutor(StringRef ExecutablePath, bool UseSharedMemory,
143134
close(ToExecutor[WriteEnd]);
144135
close(FromExecutor[ReadEnd]);
145136

146-
if (CustomizeFork)
147-
CustomizeFork();
148-
149137
// Execute the child process.
150138
std::unique_ptr<char[]> ExecutorPath, FDSpecifier;
151139
{
@@ -170,8 +158,6 @@ launchExecutor(StringRef ExecutablePath, bool UseSharedMemory,
170158
}
171159
// else we're the parent...
172160

173-
LaunchedExecutorPID.push_back(ChildPID);
174-
175161
// Close the child ends of the pipes
176162
close(ToExecutor[ReadEnd]);
177163
close(FromExecutor[WriteEnd]);
@@ -279,18 +265,3 @@ connectTCPSocket(StringRef NetworkAddress, bool UseSharedMemory,
279265
std::move(S), *SockFD, *SockFD);
280266
#endif
281267
}
282-
283-
#if LLVM_ON_UNIX
284-
285-
pid_t getLastLaunchedExecutorPID() {
286-
if (!LaunchedExecutorPID.size())
287-
return -1;
288-
return LaunchedExecutorPID.back();
289-
}
290-
291-
pid_t getNthLaunchedExecutorPID(int n) {
292-
if (n - 1 < 0 || n - 1 >= static_cast<int>(LaunchedExecutorPID.size()))
293-
return -1;
294-
return LaunchedExecutorPID.at(n - 1);
295-
}
296-
#endif

clang/unittests/Interpreter/CMakeLists.txt

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
1-
set(CLANG_REPL_TEST_SOURCES
1+
add_distinct_clang_unittest(ClangReplInterpreterTests
22
IncrementalCompilerBuilderTest.cpp
33
IncrementalProcessingTest.cpp
44
InterpreterTest.cpp
55
InterpreterExtensionsTest.cpp
66
CodeCompletionTest.cpp
7-
)
87

9-
if(TARGET compiler-rt)
10-
list(APPEND CLANG_REPL_TEST_SOURCES
11-
OutOfProcessInterpreterTests.cpp
12-
)
13-
message(STATUS "Compiler-RT found, enabling out of process JIT tests")
14-
endif()
15-
16-
add_distinct_clang_unittest(ClangReplInterpreterTests
17-
${CLANG_REPL_TEST_SOURCES}
18-
19-
PARTIAL_SOURCES_INTENDED
208
EXPORT_SYMBOLS
219

2210
CLANG_LIBS
@@ -38,14 +26,6 @@ add_distinct_clang_unittest(ClangReplInterpreterTests
3826
TargetParser
3927
)
4028

41-
if(TARGET compiler-rt)
42-
add_dependencies(ClangReplInterpreterTests
43-
llvm-jitlink-executor
44-
compiler-rt
45-
)
46-
message(STATUS "Adding dependency on compiler-rt for out of process JIT tests")
47-
endif()
48-
4929
# Exceptions on Windows are not yet supported.
5030
if(NOT WIN32)
5131
add_subdirectory(ExceptionTests)

clang/unittests/Interpreter/InterpreterTest.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@
1515
#include "clang/AST/Decl.h"
1616
#include "clang/AST/DeclGroup.h"
1717
#include "clang/AST/Mangle.h"
18-
#include "clang/Basic/Version.h"
19-
#include "clang/Config/config.h"
2018
#include "clang/Frontend/CompilerInstance.h"
2119
#include "clang/Frontend/TextDiagnosticPrinter.h"
2220
#include "clang/Interpreter/Interpreter.h"
23-
#include "clang/Interpreter/RemoteJITUtils.h"
2421
#include "clang/Interpreter/Value.h"
2522
#include "clang/Sema/Lookup.h"
2623
#include "clang/Sema/Sema.h"
27-
#include "llvm/Support/Error.h"
28-
#include "llvm/TargetParser/Host.h"
2924

3025
#include "llvm/TargetParser/Host.h"
3126

@@ -39,12 +34,6 @@ int Global = 42;
3934
REPL_EXTERNAL_VISIBILITY int getGlobal() { return Global; }
4035
REPL_EXTERNAL_VISIBILITY void setGlobal(int val) { Global = val; }
4136

42-
#ifdef _WIN32
43-
#define STDIN_FILENO 0
44-
#define STDOUT_FILENO 1
45-
#define STDERR_FILENO 2
46-
#endif
47-
4837
namespace {
4938

5039
class InterpreterTest : public InterpreterTestBase {

clang/unittests/Interpreter/OutOfProcessInterpreterTests.cpp

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

0 commit comments

Comments
 (0)