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

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 31 00:32:29 PDT 2023


================
@@ -0,0 +1,55 @@
+//===------------------ ProjectModules.h -------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_PROJECTMODULES_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_PROJECTMODULES_H
+
+#include "ModuleDependencyScanner.h"
+
+namespace clang {
+namespace clangd {
+
+/// An interface to query the modules information in the project.
+/// This should be obtained by
+/// `GlobalCompilationDatabase::getProjectModules(PathRef)`.
+///
+/// TODO: The existing `ScanningAllProjectModules` is not efficient. See the
+/// comments in ModuleDependencyScanner for detail.
+class ProjectModules {
+public:
+  virtual std::vector<std::string> getRequiredModules(PathRef File) = 0;
+  virtual PathRef getSourceForModuleName(StringRef ModuleName) = 0;
+};
+
+class ScanningAllProjectModules : public ProjectModules {
----------------
ChuanqiXu9 wrote:

Done

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


More information about the cfe-commits mailing list