// Options:
//
// -I(include path) Look at headers only in this directory tree.
-// Must be a path relative to the module.map file.
+// Must be a path relative to the module.modulemap file.
// There can be multiple -I options, for when the
// module map covers multiple directories, and
// excludes higher or sibling directories not
//
// Warning message have the form:
//
-// warning: module.map does not account for file: Level3A.h
+// warning: module.modulemap does not account for file: Level3A.h
//
// Note that for the case of the module map referencing a file that does
// not exist, the module map parser in Clang will (at the time of this
// Option for include paths.
static cl::list<std::string>
IncludePaths("I", cl::desc("Include path."
- " Must be relative to module.map file."),
+ " Must be relative to module.modulemap file."),
cl::ZeroOrMore, cl::value_desc("path"));
// Option for dumping the parsed module map.
DumpModuleMap("dump-module-map", cl::init(false),
cl::desc("Dump the parsed module map information."));
-// Option for module.map path.
+// Option for module.modulemap path.
static cl::opt<std::string>
-ModuleMapPath(cl::Positional, cl::init("module.map"),
- cl::desc("<The module.map file path."
- " Uses module.map in current directory if omitted.>"));
+ModuleMapPath(cl::Positional, cl::init("module.modulemap"),
+ cl::desc("<The module.modulemap file path."
+ " Uses module.modulemap in current directory if omitted.>"));
// Collect all other arguments, which will be passed to the front end.
static cl::list<std::string>
}
// Do checks.
-// Starting from the directory of the module.map file,
+// Starting from the directory of the module.modulemap file,
// Find all header files, optionally looking only at files
// covered by the include path options, and compare against
-// the headers referenced by the module.map file.
+// the headers referenced by the module.modulemap file.
// Display warnings for unaccounted-for header files.
// Returns error_code of 0 if there were no errors or warnings, 1 if there
// were warnings, 2 if any other problem, such as if a bad
// The following functions are called by doChecks.
// Load module map.
-// Returns true if module.map file loaded successfully.
+// Returns true if module.modulemap file loaded successfully.
bool ModuleMapChecker::loadModuleMap() {
- // Get file entry for module.map file.
+ // Get file entry for module.modulemap file.
const FileEntry *ModuleMapEntry =
SourceMgr->getFileManager().getFile(ModuleMapPath);
assert(Dir && "parent must exist");
}
- // Parse module.map file into module map.
+ // Parse module.modulemap file into module map.
if (ModMap->parseModuleMapFile(ModuleMapEntry, false, Dir))
return false;
// Collect file system header files.
// This function scans the file system for header files,
-// starting at the directory of the module.map file,
+// starting at the directory of the module.modulemap file,
// optionally filtering out all but the files covered by
// the include path options.
// Returns true if no errors.
bool ModuleMapChecker::collectFileSystemHeaders() {
- // Get directory containing the module.map file.
+ // Get directory containing the module.modulemap file.
// Might be relative to current directory, absolute, or empty.
ModuleMapDirectory = getDirectoryFromPath(ModuleMapPath);
// If no include paths specified, we do the whole tree starting
- // at the module.map directory.
+ // at the module.modulemap directory.
if (IncludePaths.size() == 0) {
if (!collectFileSystemHeaders(StringRef("")))
return false;
// Collect file system header files from the given path.
// This function scans the file system for header files,
// starting at the given directory, which is assumed to be
-// relative to the directory of the module.map file.
+// relative to the directory of the module.modulemap file.
// \returns True if no errors.
bool ModuleMapChecker::collectFileSystemHeaders(StringRef IncludePath) {
class ModuleMapChecker {
// Checker arguments.
- /// The module.map file path. Can be relative or absolute.
+ /// The module.modulemap file path. Can be relative or absolute.
llvm::StringRef ModuleMapPath;
/// The include paths to check for files.
/// (Note that other directories above these paths are ignored.
- /// To expect all files to be accounted for from the module.map
+ /// To expect all files to be accounted for from the module.modulemap
/// file directory on down, leave this empty.)
std::vector<std::string> IncludePaths;
/// Flag to dump the module map information during check.
/// Constructor.
/// You can use the static createModuleMapChecker to create an instance
/// of this object.
- /// \param ModuleMapPath The module.map file path.
+ /// \param ModuleMapPath The module.modulemap file path.
/// Can be relative or absolute.
/// \param IncludePaths The include paths to check for files.
/// (Note that other directories above these paths are ignored.
- /// To expect all files to be accounted for from the module.map
+ /// To expect all files to be accounted for from the module.modulemap
/// file directory on down, leave this empty.)
/// \param DumpModuleMap Flag to dump the module map information
/// during check.
llvm::ArrayRef<std::string> CommandLine);
/// Create instance of ModuleMapChecker.
- /// \param ModuleMapPath The module.map file path.
+ /// \param ModuleMapPath The module.modulemap file path.
/// Can be relative or absolute.
/// \param IncludePaths The include paths to check for files.
/// (Note that other directories above these paths are ignored.
- /// To expect all files to be accounted for from the module.map
+ /// To expect all files to be accounted for from the module.modulemap
/// file directory on down, leave this empty.)
/// \param DumpModuleMap Flag to dump the module map information
/// during check.
bool DumpModuleMap, llvm::ArrayRef<std::string> CommandLine);
/// Do checks.
- /// Starting from the directory of the module.map file,
+ /// Starting from the directory of the module.modulemap file,
/// Find all header files, optionally looking only at files
/// covered by the include path options, and compare against
- /// the headers referenced by the module.map file.
+ /// the headers referenced by the module.modulemap file.
/// Display warnings for unaccounted-for header files.
/// \returns 0 if there were no errors or warnings, 1 if there
/// were warnings, 2 if any other problem, such as a bad
// The following functions are called by doChecks.
/// Load module map.
- /// \returns True if module.map file loaded successfully.
+ /// \returns True if module.modulemap file loaded successfully.
bool loadModuleMap();
/// Collect module headers.
/// Collect file system header files.
/// This function scans the file system for header files,
- /// starting at the directory of the module.map file,
+ /// starting at the directory of the module.modulemap file,
/// optionally filtering out all but the files covered by
/// the include path options.
/// \returns True if no errors.
/// Collect file system header files from the given path.
/// This function scans the file system for header files,
/// starting at the given directory, which is assumed to be
- /// relative to the directory of the module.map file.
+ /// relative to the directory of the module.modulemap file.
/// \returns True if no errors.
bool collectFileSystemHeaders(llvm::StringRef IncludePath);