[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

kadir çetinkaya via cfe-commits cfe-commits at lists.llvm.org
Wed May 22 01:57:42 PDT 2024


================
@@ -0,0 +1,339 @@
+//===----------------- ModulesBuilder.cpp ------------------------*- C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "ModulesBuilder.h"
+#include "PrerequisiteModules.h"
+#include "support/Logger.h"
+
+#include "clang/Frontend/FrontendAction.h"
+#include "clang/Frontend/FrontendActions.h"
+
+namespace clang {
+namespace clangd {
+
+namespace {
+
+/// Get or create a path to store module files. Generally it should be:
+///
+///   project_root/.cache/clangd/module_files/{RequiredPrefixDir}/.
----------------
kadircet wrote:

as things stand today these are not really "cache" files, but rather "temporary" files, similar to clangd's preambles.

as a result, if clangd process dies unexpectedly, we'll just leak all of these pcms indefinitely, which is quite expensive for the user.

can you move this to `/tmp/` instead, until we start sharing pcms and have a reason to use a "persistent" storage?

https://github.com/llvm/llvm-project/pull/66462


More information about the cfe-commits mailing list