clang  14.0.0git
Public Member Functions | Public Attributes | List of all members
clang::tooling::dependencies::ModuleDeps Struct Reference

#include "clang/Tooling/DependencyScanning/ModuleDepCollector.h"

Collaboration diagram for clang::tooling::dependencies::ModuleDeps:
Collaboration graph
[legend]

Public Member Functions

std::vector< std::stringgetCanonicalCommandLine (std::function< StringRef(ModuleID)> LookupPCMPath, std::function< const ModuleDeps &(ModuleID)> LookupModuleDeps) const
 Gets the canonical command line suitable for passing to clang. More...
 
std::vector< std::stringgetCanonicalCommandLineWithoutModulePaths () const
 Gets the canonical command line suitable for passing to clang, excluding arguments containing modules-related paths: "-fmodule-file=", "-o", "-fmodule-map-file=". More...
 

Public Attributes

ModuleID ID
 The identifier of the module. More...
 
bool IsSystem
 Whether this is a "system" module. More...
 
std::string ClangModuleMapFile
 The path to the modulemap file which defines this module. More...
 
std::string ImplicitModulePCMPath
 The path to where an implicit build would put the PCM for this module. More...
 
llvm::StringSet FileDeps
 A collection of absolute paths to files that this module directly depends on, not including transitive dependencies. More...
 
std::vector< PrebuiltModuleDepPrebuiltModuleDeps
 A collection of prebuilt modular dependencies this module directly depends on, not including transitive dependencies. More...
 
std::vector< ModuleIDClangModuleDeps
 A list of module identifiers this module directly depends on, not including transitive dependencies. More...
 
bool ImportedByMainFile = false
 
CompilerInvocation BuildInvocation
 Compiler invocation that can be used to build this module (without paths). More...
 

Detailed Description

Definition at line 68 of file ModuleDepCollector.h.

Member Function Documentation

◆ getCanonicalCommandLine()

std::vector< std::string > ModuleDeps::getCanonicalCommandLine ( std::function< StringRef(ModuleID)>  LookupPCMPath,
std::function< const ModuleDeps &(ModuleID)>  LookupModuleDeps 
) const

Gets the canonical command line suitable for passing to clang.

Parameters
LookupPCMPathThis function is called to fill in "-fmodule-file=" arguments and the "-o" argument. It needs to return a path for where the PCM for the given module is to be located.
LookupModuleDepsThis function is called to collect the full transitive set of dependencies for this compilation and fill in "-fmodule-map-file=" arguments.

Definition at line 82 of file ModuleDepCollector.cpp.

References BuildInvocation, ClangModuleDeps, ClangModuleMapFile, clang::tooling::dependencies::detail::collectPCMAndModuleMapPaths(), clang::FrontendOptions::DashX, clang::CompilerInvocationValueBase::getFrontendOpts(), clang::InputKind::getLanguage(), ID, clang::FrontendOptions::Inputs, clang::FrontendOptions::ModuleFiles, clang::FrontendOptions::ModuleMapFiles, clang::FrontendOptions::OutputFile, serializeCompilerInvocation(), and string().

◆ getCanonicalCommandLineWithoutModulePaths()

std::vector< std::string > ModuleDeps::getCanonicalCommandLineWithoutModulePaths ( ) const

Gets the canonical command line suitable for passing to clang, excluding arguments containing modules-related paths: "-fmodule-file=", "-o", "-fmodule-map-file=".

Definition at line 101 of file ModuleDepCollector.cpp.

References BuildInvocation, and serializeCompilerInvocation().

Member Data Documentation

◆ BuildInvocation

CompilerInvocation clang::tooling::dependencies::ModuleDeps::BuildInvocation

Compiler invocation that can be used to build this module (without paths).

Definition at line 104 of file ModuleDepCollector.h.

Referenced by getCanonicalCommandLine(), and getCanonicalCommandLineWithoutModulePaths().

◆ ClangModuleDeps

std::vector<ModuleID> clang::tooling::dependencies::ModuleDeps::ClangModuleDeps

A list of module identifiers this module directly depends on, not including transitive dependencies.

This may include modules with a different context hash when it can be determined that the differences are benign for this compilation.

Definition at line 97 of file ModuleDepCollector.h.

Referenced by getCanonicalCommandLine().

◆ ClangModuleMapFile

std::string clang::tooling::dependencies::ModuleDeps::ClangModuleMapFile

The path to the modulemap file which defines this module.

This can be used to explicitly build this module. This file will additionally appear in FileDeps as a dependency.

Definition at line 79 of file ModuleDepCollector.h.

Referenced by getCanonicalCommandLine().

◆ FileDeps

llvm::StringSet clang::tooling::dependencies::ModuleDeps::FileDeps

A collection of absolute paths to files that this module directly depends on, not including transitive dependencies.

Definition at line 86 of file ModuleDepCollector.h.

◆ ID

ModuleID clang::tooling::dependencies::ModuleDeps::ID

The identifier of the module.

Definition at line 70 of file ModuleDepCollector.h.

Referenced by getCanonicalCommandLine(), and clang::tooling::dependencies::DependencyScanningTool::getFullDependencies().

◆ ImplicitModulePCMPath

std::string clang::tooling::dependencies::ModuleDeps::ImplicitModulePCMPath

The path to where an implicit build would put the PCM for this module.

Definition at line 82 of file ModuleDepCollector.h.

◆ ImportedByMainFile

bool clang::tooling::dependencies::ModuleDeps::ImportedByMainFile = false

◆ IsSystem

bool clang::tooling::dependencies::ModuleDeps::IsSystem

Whether this is a "system" module.

Definition at line 73 of file ModuleDepCollector.h.

◆ PrebuiltModuleDeps

std::vector<PrebuiltModuleDep> clang::tooling::dependencies::ModuleDeps::PrebuiltModuleDeps

A collection of prebuilt modular dependencies this module directly depends on, not including transitive dependencies.

Definition at line 90 of file ModuleDepCollector.h.


The documentation for this struct was generated from the following files: