llvm-project
llvm-project copied to clipboard
[llvm-lit] sub-issues: Runtime path string processing issues
The command call chain for deleting files in llvm-lit starts from the TestRunner.py module. First, start with the _executeShCmd() function. There is a variable called inproc_builtins under this function. Which contains the rm command, and then execute the rm command to call the executeBuiltinRm() function under the file InprocBuiltin.py.
If you need to handle ANSI character escaping, you need to start with the ShLexer class in ShUtil.py.
Of course, in Windows systems, path handling is handled in the util.py file, where there is a function called get_windows_extended_path() specifically for formatting Windows paths. This function is referenced by the files ShellEnvirorment.py and InprocBuiltins.py.
def get_windows_extended_path(path: str) -> str:
# ......
if not platform.system() == "Windows":
return path
path = os.path.abspath(path)
if path.startswith("\\\\"):
return "\\\\?\\UNC\\{0}".format(path[2:])
return "\\\\?\\{0}".format(path)