[PATCH] D143418: [libclang] Add API to override preamble storage path
Igor Kushnir via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 7 08:03:41 PST 2023
vedgy added a comment.
I am implementing the `StorePreamblesInMemory` bool option discussed earlier. It would be nice to be able to modify it at any time, because it can be an option in an IDE's UI and requiring to restart an IDE for the option change to take effect is undesirable. In order to make the setter thread-safe, the option can be stored as `std::atomic<bool> StorePreamblesInMemory` in `class CIndexer` and stored/loaded with `memory_order_relaxed`. Setting this option would apply only to subsequent `clang_parseTranslationUnit_Impl()` calls. The option can also be added to `CXIndexOptions` in order to allow setting its initial value reliably (not worrying whether it could be used before the setter gets called after index construction).
Is adding both the setter and the `CXIndexOptions` member OK or would you prefer only one of these two?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143418/new/
https://reviews.llvm.org/D143418
More information about the cfe-commits
mailing list