Files
llvm-project/llvm/lib/Support
Ben Dunbobbin e6f5e4910d [Windows][Support] Add helper to expand short 8.3 form paths (#178480)
Windows supports short 8.3 form filenames (for example,
`compile_commands.json` -> `COMPIL~1.JSO`) for legacy reasons. See:
https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#short-vs-long-names

Such paths are not unusual because, on Windows, the system temporary
directory is commonly derived from the `TMP`/`TEMP` environment
variables. For historical compatibility reasons, these variables are
often set to short 8.3 form paths on systems where user names exceed
eight characters.

Introduce `windows::makeLongFormPath()` to convert paths to their long
form by expanding any 8.3 components via `GetLongPathNameW`.

As part of this change:
- Extended-length path prefix handling is centralized by adding
`stripExtendedPrefix()` and reusing it in `realPathFromHandle()`.
- `widenPath()` is cleaned up to use shared prefix constants.

This was split out from #178303 at the request of the codeowner so that
the Windows support parts can be reviewed separately.
2026-02-10 16:44:02 +00:00
..
2026-01-02 18:48:17 +01:00