[PATCH] D139774: [libclang] Add API to set temporary directory location

Igor Kushnir via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 20:43:21 PST 2023


vedgy added a comment.

In D139774#4094619 <https://reviews.llvm.org/D139774#4094619>, @aaron.ballman wrote:

> Is there a middle ground where, instead of #2 for general temporary storage, we went with #2 but with compiler-specific directories instead of system directories. e.g., don't let the caller set the temp directory, but do let the caller set the preamble directory (which defaults to the temp directory) so long as it's set before invoking the compiler? This still won't let you change options mid-run, but it also seems like it should have less risk of affecting other components while still solving the thread safety issues. I'm not certain if it's any easier to implement, but I think it does save you from modifying `FileSystemOptions`. As a separate item, we could then consider adding a new C API to let you toggle the in-memory vs on-disk functionality after exploring that it won't cause other problems because nobody considered the possibility that it's not a stable value for the compiler invocation.

OK, so I'm going to implement overriding the preamble directory in `clang_createIndexWithPreambleStoragePath` (or `clang_createIndex2` or `clang_createIndexExt` or?); try to keep it simple and not modify `FileSystemOptions`; deal with the in-memory option separately later. Abandon this revision now and create another one once ready?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139774/new/

https://reviews.llvm.org/D139774



More information about the llvm-commits mailing list