clang-tools  7.0.0
Modularize.h
Go to the documentation of this file.
1 //===--- Modularize.h - Common definitions for Modularize -*- C++ -*-----===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===--------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// \brief Common definitions for Modularize.
12 ///
13 //===--------------------------------------------------------------------===//
14 
15 #ifndef MODULARIZE_H
16 #define MODULARIZE_H
17 
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/SmallString.h"
20 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/ADT/StringMap.h"
22 #include "llvm/ADT/StringRef.h"
23 #include <string>
24 #include <vector>
25 
26 // Save the program name for error messages.
27 extern const char *Argv0;
28 // Save the command line for comments.
29 extern std::string CommandLine;
30 
31 // Dependency types.
32 typedef llvm::SmallVector<std::string, 4> DependentsVector;
33 typedef llvm::StringMap<DependentsVector> DependencyMap;
34 
35 // Global function declarations.
36 
37 /// Create the module map file.
38 /// \param ModuleMapPath The path to the module map file to be generated.
39 /// \param HeaderFileNames The list of header files, absolute native paths.
40 /// \param ProblemFileNames The list of problem header files.
41 /// \param Dependencies Map of headers that depend on other headers.
42 /// \param HeaderPrefix Tells the code where the headers are, if they
43 /// aren's in the current directory, allowing the generator to strip
44 /// the leading, non-relative beginning of the header paths.
45 /// \brief RootModuleName If not empty, specifies that a root module
46 /// should be created with this name.
47 /// \returns True if successful.
48 bool createModuleMap(llvm::StringRef ModuleMapPath,
49  llvm::ArrayRef<std::string> HeaderFileNames,
50  llvm::ArrayRef<std::string> ProblemFileNames,
51  DependencyMap &Dependencies, llvm::StringRef HeaderPrefix,
52  llvm::StringRef RootModuleName);
53 
54 #endif // MODULARIZE_H
std::string CommandLine
Definition: Modularize.cpp:336
llvm::SmallVector< std::string, 4 > DependentsVector
Definition: Modularize.h:32
static cl::opt< std::string > HeaderPrefix("prefix", cl::init(""), cl::desc("Prepend header file paths with this prefix." " If not specified," " the files are considered to be relative to the header list file."))
static cl::opt< std::string > ModuleMapPath("module-map-path", cl::init(""), cl::desc("Turn on module map output and specify output path or file name." " If no path is specified and if prefix option is specified," " use prefix for file path."))
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.
llvm::StringMap< DependentsVector > DependencyMap
Definition: Modularize.h:33
const char * Argv0
Definition: Modularize.cpp:334