[clang-tools-extra] r228935 - Added support for multiple header list files, as a precursor for when we need to load multiple module maps.
John Thompson
John.Thompson.JTSoftware at gmail.com
Thu Feb 12 08:22:09 PST 2015
Author: jtsoftware
Date: Thu Feb 12 10:22:09 2015
New Revision: 228935
URL: http://llvm.org/viewvc/llvm-project?rev=228935&view=rev
Log:
Added support for multiple header list files, as a precursor for when we need to load multiple module maps.
Added:
clang-tools-extra/trunk/test/modularize/NoProblemsList.modularize
Modified:
clang-tools-extra/trunk/docs/ModularizeUsage.rst
clang-tools-extra/trunk/modularize/Modularize.cpp
Modified: clang-tools-extra/trunk/docs/ModularizeUsage.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/ModularizeUsage.rst?rev=228935&r1=228934&r2=228935&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/ModularizeUsage.rst (original)
+++ clang-tools-extra/trunk/docs/ModularizeUsage.rst Thu Feb 12 10:22:09 2015
@@ -2,7 +2,8 @@
Modularize Usage
================
-``modularize [<modularize-options>] <include-files-list> [<front-end-options>...]``
+``modularize [<modularize-options>] <include-files-list>[,<include-files-list>]*
+[<front-end-options>...]``
``<modularize-options>`` is a place-holder for options
specific to modularize, which are described below in
Modified: clang-tools-extra/trunk/modularize/Modularize.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/Modularize.cpp?rev=228935&r1=228934&r2=228935&view=diff
==============================================================================
--- clang-tools-extra/trunk/modularize/Modularize.cpp (original)
+++ clang-tools-extra/trunk/modularize/Modularize.cpp Thu Feb 12 10:22:09 2015
@@ -178,9 +178,10 @@ using namespace llvm::opt;
using namespace Modularize;
// Option to specify a file name for a list of header files to check.
-cl::opt<std::string>
-ListFileName(cl::Positional,
- cl::desc("<name of file containing list of headers to check>"));
+cl::list<std::string>
+ListFileNames(cl::Positional, cl::value_desc("list"),
+ cl::desc("<list of one or more header list files>"),
+ cl::CommaSeparated);
// Collect all other arguments, which will be passed to the front end.
cl::list<std::string>
@@ -700,7 +701,7 @@ int main(int Argc, const char **Argv) {
cl::ParseCommandLineOptions(Argc, Argv, "modularize.\n");
// No go if we have no header list file.
- if (ListFileName.size() == 0) {
+ if (ListFileNames.size() == 0) {
cl::PrintHelpMessage();
return 1;
}
@@ -708,11 +709,14 @@ int main(int Argc, const char **Argv) {
// Get header file names and dependencies.
SmallVector<std::string, 32> Headers;
DependencyMap Dependencies;
- if (std::error_code EC = getHeaderFileNames(Headers, Dependencies,
- ListFileName, HeaderPrefix)) {
- errs() << Argv[0] << ": error: Unable to get header list '" << ListFileName
- << "': " << EC.message() << '\n';
- return 1;
+ typedef std::vector<std::string>::iterator Iter;
+ for (Iter I = ListFileNames.begin(), E = ListFileNames.end(); I != E; ++I) {
+ if (std::error_code EC = getHeaderFileNames(Headers, Dependencies,
+ *I, HeaderPrefix)) {
+ errs() << Argv[0] << ": error: Unable to get header list '" << *I
+ << "': " << EC.message() << '\n';
+ return 1;
+ }
}
// If we are in assistant mode, output the module map and quit.
Added: clang-tools-extra/trunk/test/modularize/NoProblemsList.modularize
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/NoProblemsList.modularize?rev=228935&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/modularize/NoProblemsList.modularize (added)
+++ clang-tools-extra/trunk/test/modularize/NoProblemsList.modularize Thu Feb 12 10:22:09 2015
@@ -0,0 +1,2 @@
+# RUN: modularize NoProblems.modularize,NoProblemsAnonymous.modularize -x c++
+# RUN: modularize -prefix=%p NoProblems.modularize,NoProblemsAnonymous.modularize -x c++
More information about the cfe-commits
mailing list