[LLVMdev] sys::path::system_temp_directory vs. sys::fs::createTemporaryFile

Jordan Rose jordan_rose at apple.com
Wed Jul 23 15:26:20 PDT 2014


Hi, all. I noticed recently that llvm::sys::fs::createTemporaryFile does not use llvm::sys::path::system_temp_directory, instead relying on its platform-specific helper TempFile. Is there any reason for this disparity?

The two implementations are not in sync, either:

- TempDir honors TMPDIR, TMP, TEMP, TEMPDIR, and a configuration-settable P_tmpdir on Unix-y systems. system_temp_directory just honors TMPDIR.
- TempDir calls ::GetTempPathW on Windows, while system_temp_directory honors TEMP and falls back to C:\\TEMP.
- system_temp_directory prefers DARWIN_USER_TEMP_DIR on Darwin.
- system_temp_directory has an option for "temporary directory that persists past reboot", while TempDir is never used for anything but transient files and directories

Does anyone mind if I merge the platform-specific bits of TempDir into system_temp_directory? Does anyone have other opinions here?

Jordan



More information about the llvm-dev mailing list