@@ -272,26 +272,23 @@ createClangInterpreter(std::vector<const char*>& args, int stdin_fd = 0,
272272 std::string SlabAllocateSizeString = " " ;
273273 std::unique_ptr<llvm::orc::ExecutorProcessControl> EPC;
274274
275- auto DefaultForkRedirection = [=] {
276- auto redirect = [](int from, int to) {
277- if (from != to) {
278- dup2 (from, to);
279- close (from);
280- }
281- };
282-
283- // TODO: stdin and stderr redirection is not necessary.
284- redirect (0 , STDIN_FILENO);
285- redirect (stdout_fd, STDOUT_FILENO);
286- redirect (2 , STDERR_FILENO);
287-
288- setvbuf (stdout, nullptr , _IONBF, 0 );
289- setvbuf (stderr, nullptr , _IONBF, 0 );
290- };
291-
292275 EPC = ExitOnError (launchExecutor (OOPExecutor, UseSharedMemory,
293276 SlabAllocateSizeString,
294- DefaultForkRedirection));
277+ [=] { // Lambda defined inline
278+ auto redirect = [](int from, int to) {
279+ if (from != to) {
280+ dup2 (from, to);
281+ close (from);
282+ }
283+ };
284+
285+ redirect (0 , STDIN_FILENO);
286+ redirect (stdout_fd, STDOUT_FILENO);
287+ redirect (2 , STDERR_FILENO);
288+
289+ setvbuf (stdout, nullptr , _IONBF, 0 );
290+ setvbuf (stderr, nullptr , _IONBF, 0 );
291+ }));
295292
296293#ifdef __APPLE__
297294 std::string OrcRuntimePath =
0 commit comments