[llvm] [Lit] Introduce a new IO interface for in-process built-ins (PR #194664)

Benjamin Stott via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 02:22:17 PDT 2026


================
@@ -5,77 +5,158 @@
 import shutil
 import stat
 import subprocess
-from io import BytesIO, StringIO
+from dataclasses import dataclass
+from io import BytesIO
+from typing import Any, Callable, Dict, List, Optional
 
 import lit.util
+from lit.ShCommands import Command
 from lit.ShellEnvironment import (
     InternalShellError,
-    ShellCommandResult,
-    expand_glob_expressions,
+    ShellEnvironment,
     kIsWindows,
-    processRedirects,
     updateEnv,
 )
 
 
-def executeBuiltinCd(cmd, shenv):
+class InprocBuiltinIO:
+    """
+    Holds IO streams for an inproc builtin invocation.
+
+    NB: If stderr is redirected to be the same stream as stdout, then
+    `stder == stdout` is True.
+    """
+
+    stdin: Any
----------------
BStott6 wrote:

This is perfect, I didn't know this existed. Thanks!

https://github.com/llvm/llvm-project/pull/194664


More information about the llvm-commits mailing list