clang-tools  3.8.0
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>
Include dependency graph for ModuleAssistant.cpp:

Go to the source code of this file.

Functions

static std::string ensureNoCollisionWithReservedName (llvm::StringRef MightBeReservedName)
 
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. More...
 

Variables

static const char *const ReservedNames []
 

Function Documentation

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

Definition at line 161 of file ModuleAssistant.cpp.

References ensureNoCollisionWithReservedName(), and RootModule().

Referenced by loadModuleDescriptions().

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 293 of file ModuleAssistant.cpp.

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

Referenced by main().

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

Definition at line 149 of file ModuleAssistant.cpp.

Referenced by addModuleDescription().

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 211 of file ModuleAssistant.cpp.

References addModuleDescription(), and RootModule().

Referenced by createModuleMap().

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

Definition at line 247 of file ModuleAssistant.cpp.

References Argv0, CommandLine, HeaderPrefix(), and ModuleMapPath().

Referenced by createModuleMap().

Variable Documentation

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 140 of file ModuleAssistant.cpp.