clang-tools 22.0.0git
clang::clangd::ProjectModules Class Referenceabstract

An interface to query the modules information in the project. More...

#include <ProjectModules.h>

Inheritance diagram for clang::clangd::ProjectModules:
[legend]

Public Types

using CommandMangler

Public Member Functions

virtual std::vector< std::string > getRequiredModules (PathRef File)=0
virtual std::string getModuleNameForSource (PathRef File)=0
virtual std::string getSourceForModuleName (llvm::StringRef ModuleName, PathRef RequiredSrcFile)=0
virtual void setCommandMangler (CommandMangler Mangler)
virtual ~ProjectModules ()=default

Detailed Description

An interface to query the modules information in the project.

Users should get instances of ProjectModules from GlobalCompilationDatabase::getProjectModules(PathRef).

Currently, the modules information includes:

  • Given a source file, what are the required modules.
  • Given a module name and a required source file, what is the corresponding source file.

Note that there can be multiple source files declaring the same module in a valid project. Although the language specification requires that every module unit's name must be unique in valid program, there can be multiple program in a project. And it is technically valid if these program doesn't interfere with each other.

A module name should be in the format: <primary-module-name>[:partition-name]. So module names covers partitions.

Definition at line 39 of file ProjectModules.h.

Member Typedef Documentation

◆ CommandMangler

Initial value:
llvm::unique_function<void(tooling::CompileCommand &, PathRef) const>
llvm::StringRef PathRef
A typedef to represent a ref to file path.
Definition Path.h:29

Definition at line 41 of file ProjectModules.h.

Constructor & Destructor Documentation

◆ ~ProjectModules()

virtual clang::clangd::ProjectModules::~ProjectModules ( )
virtualdefault

Member Function Documentation

◆ getModuleNameForSource()

virtual std::string clang::clangd::ProjectModules::getModuleNameForSource ( PathRef File)
pure virtual

◆ getRequiredModules()

virtual std::vector< std::string > clang::clangd::ProjectModules::getRequiredModules ( PathRef File)
pure virtual

◆ getSourceForModuleName()

virtual std::string clang::clangd::ProjectModules::getSourceForModuleName ( llvm::StringRef ModuleName,
PathRef RequiredSrcFile )
pure virtual

◆ setCommandMangler()

virtual void clang::clangd::ProjectModules::setCommandMangler ( CommandMangler Mangler)
inlinevirtual

Reimplemented in clang::clangd::ScanningAllProjectModules.

Definition at line 49 of file ProjectModules.h.


The documentation for this class was generated from the following file: