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

Igor Kushnir via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 18 11:23:40 PST 2023


vedgy added a comment.

After a discussion under the corresponding KDevelop merge request, I can see 4-6 alternative ways to address the temporary directory issue:

1. Add an option to store the //preamble-*.pch// files in RAM instead of /tmp and add a corresponding option in KDevelop configuration UI. This would work perfectly for me, provided I don't change my mind and decide to turn this option off, in which case I'll be back to square one.
2. Add an option to store the //preamble-*.pch// files in a custom directory instead of a general temporary directory. The option could be named generally (2a: overrideTemporaryDirectory) or specially (2b: setPreambleStoragePath). If the option is named generally, other temporary files created by libclang could be identified in the future and placed in the same directory without changing the API.
3. 1 and 2 - the options can be propagated between identical end points together, so this combination is natural.
4. The current patch. This is the easiest (already implemented) and most reliable (the temporary directory is definitely and completely overridden) approach. But there are thread safety concerns due to the introduction of global state.

If the 4th option is unacceptable, I lean towards the option 3a (1 and 2a), because the amount of implementation work should not be much greater than 1 alone or 2a alone. If the 4th option is unacceptable, I suppose a separate review request based on the current LLVM main branch should be created and this one closed, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139774



More information about the cfe-commits mailing list