[libclang] Add index option to store preambles in memory
authorIgor Kushnir <igorkuo@gmail.com>
Wed, 15 Mar 2023 13:21:41 +0000 (09:21 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Wed, 15 Mar 2023 13:21:41 +0000 (09:21 -0400)
commit55f7e00afc56c68421220d60d29c079b58fe9c79
treea17833891c04630995bdc4627e08252c5ca369ff
parent506fd6725166d2688b7d15b09f00da1abaa1f157
[libclang] Add index option to store preambles in memory

This commit allows libclang API users to opt into storing PCH in memory
instead of temporary files. The option can be set only during CXIndex
construction to avoid multithreading issues and confusion or bugs if
some preambles are stored in temporary files and others - in memory.

The added API works as expected in KDevelop:
https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/283

Differential Revision: https://reviews.llvm.org/D145974
clang/docs/ReleaseNotes.rst
clang/include/clang-c/Index.h
clang/include/clang/Frontend/ASTUnit.h
clang/lib/Frontend/ASTUnit.cpp
clang/tools/libclang/CIndex.cpp
clang/tools/libclang/CIndexer.h
clang/unittests/Frontend/ASTUnitTest.cpp
clang/unittests/libclang/LibclangTest.cpp