https://bugs.llvm.org/show_bug.cgi?id=52505
Bug ID: 52505
Summary: Add libclang API to set temporary directory location
(especially for preamble-*.pch files)
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: libclang
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
preamble-*.pch files generated by libclang can occupy a lot of disk space. So
it is important for an IDE, which uses libclang, to prevent accumulation of
these files after a crash. This can be done by setting libclang's temporary
directory to a per-session value and removing this directory with all leftover
files after a possible previous crash when the session starts.
It is possible to configure clang's temporary directory location via
platform-dependent environment variables (e.g. TMPDIR, TMP). Setting the
environment variables works well if libclang lives in a separate process (e.g.
in Qt Creator). But when libclang runs in the same process as the rest of the
IDE (like in KDevelop), setting the environment variables is problematic,
because they are inherited by the IDE's code and all child processes it spawns
(compiler, build system and user-provided executables). The IDE must then
remove the temporary directory environment variable from each child process
where it can cause undesirable behavior. A libclang API function to configure
the temporary directory location would greatly simplify cleanup implementation
in this case. Here is the discussion of a rejected implementation of this
feature in KDevelop:
https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/283.
Related bug reports: Bug 52489, Bug 30673.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs