clang-tools 20.0.0git
Functions | Variables
ModuleAssistant.cpp File Reference
#include "Modularize.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/ToolOutputFile.h"
#include <vector>

Go to the source code of this file.

Functions

static std::string ensureNoCollisionWithReservedName (llvm::StringRef MightBeReservedName)
 
static std::string ensureVaidModuleName (llvm::StringRef MightBeInvalidName)
 
static bool addModuleDescription (Module *RootModule, llvm::StringRef HeaderFilePath, llvm::StringRef HeaderPrefix, DependencyMap &Dependencies, bool IsProblemFile)
 
static Module * loadModuleDescriptions (llvm::StringRef RootModuleName, llvm::ArrayRef< std::string > HeaderFileNames, llvm::ArrayRef< std::string > ProblemFileNames, DependencyMap &Dependencies, llvm::StringRef HeaderPrefix)
 
static bool writeModuleMap (llvm::StringRef ModuleMapPath, llvm::StringRef HeaderPrefix, Module *RootModule)
 
bool createModuleMap (llvm::StringRef ModuleMapPath, llvm::ArrayRef< std::string > HeaderFileNames, llvm::ArrayRef< std::string > ProblemFileNames, DependencyMap &Dependencies, llvm::StringRef HeaderPrefix, llvm::StringRef RootModuleName)
 Create the module map file.
 

Variables

static const char *const ReservedNames []
 

Function Documentation

◆ addModuleDescription()

static bool addModuleDescription ( Module *  RootModule,
llvm::StringRef  HeaderFilePath,
llvm::StringRef  HeaderPrefix,
DependencyMap Dependencies,
bool  IsProblemFile 
)
static

◆ createModuleMap()

bool createModuleMap ( llvm::StringRef  ModuleMapPath,
llvm::ArrayRef< std::string >  HeaderFileNames,
llvm::ArrayRef< std::string >  ProblemFileNames,
DependencyMap Dependencies,
llvm::StringRef  HeaderPrefix,
llvm::StringRef  RootModuleName 
)

Create the module map file.

Parameters
ModuleMapPathThe path to the module map file to be generated.
HeaderFileNamesThe list of header files, absolute native paths.
ProblemFileNamesThe list of problem header files.
DependenciesMap of headers that depend on other headers.
HeaderPrefixTells the code where the headers are, if they aren's in the current directory, allowing the generator to strip the leading, non-relative beginning of the header paths. RootModuleName If not empty, specifies that a root module should be created with this name.
Returns
True if successful.

Definition at line 298 of file ModuleAssistant.cpp.

References HeaderPrefix(), loadModuleDescriptions(), ModuleMapPath(), RootModule(), and writeModuleMap().

Referenced by main().

◆ ensureNoCollisionWithReservedName()

static std::string ensureNoCollisionWithReservedName ( llvm::StringRef  MightBeReservedName)
static

Definition at line 141 of file ModuleAssistant.cpp.

References ReservedNames.

Referenced by addModuleDescription().

◆ ensureVaidModuleName()

static std::string ensureVaidModuleName ( llvm::StringRef  MightBeInvalidName)
static

Definition at line 155 of file ModuleAssistant.cpp.

Referenced by addModuleDescription().

◆ loadModuleDescriptions()

static Module * loadModuleDescriptions ( llvm::StringRef  RootModuleName,
llvm::ArrayRef< std::string >  HeaderFileNames,
llvm::ArrayRef< std::string >  ProblemFileNames,
DependencyMap Dependencies,
llvm::StringRef  HeaderPrefix 
)
static

Definition at line 216 of file ModuleAssistant.cpp.

References addModuleDescription(), E, HeaderPrefix(), and RootModule().

Referenced by createModuleMap().

◆ writeModuleMap()

static bool writeModuleMap ( llvm::StringRef  ModuleMapPath,
llvm::StringRef  HeaderPrefix,
Module *  RootModule 
)
static

Definition at line 252 of file ModuleAssistant.cpp.

References Argv0, CommandLine, HeaderPrefix(), ModuleMapPath(), OS, Out, and RootModule().

Referenced by createModuleMap().

Variable Documentation

◆ ReservedNames

const char* const ReservedNames[]
static
Initial value:
= {
"config_macros", "export", "module", "conflict", "framework",
"requires", "exclude", "header", "private", "explicit",
"link", "umbrella", "extern", "use", nullptr
}

Definition at line 132 of file ModuleAssistant.cpp.

Referenced by ensureNoCollisionWithReservedName().