Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-18 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL279096: Module: add -fprebuilt-module-path to support loading prebuilt modules. (authored by mren). Changed prior to commit: https://reviews.llvm.org/D23125?vs=68456=68570#toc Repository: rL LLVM

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-17 Thread Manman Ren via cfe-commits
manmanren added inline comments. Comment at: lib/Frontend/CompilerInstance.cpp:1503 @@ +1502,3 @@ +if (!Module || !Module->getASTFile() || +std::string(Module->getASTFile()->getName()) != ModuleFileName) { + // Error out if Module does not refer to

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-17 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/Frontend/CompilerInstance.cpp:1503 @@ +1502,3 @@ +if (!Module || !Module->getASTFile() || +std::string(Module->getASTFile()->getName()) != ModuleFileName) { + // Error out if Module does not refer to the

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-17 Thread Manman Ren via cfe-commits
manmanren added a comment. Cheers, Manman Comment at: lib/Frontend/CompilerInstance.cpp:1502 @@ +1501,3 @@ +Module = PP->getHeaderSearchInfo().lookupModule(ModuleName); +if (!Module || !Module->getASTFile() || +

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-17 Thread Manman Ren via cfe-commits
manmanren updated this revision to Diff 68456. https://reviews.llvm.org/D23125 Files: docs/Modules.rst include/clang/Basic/DiagnosticCommonKinds.td include/clang/Driver/Options.td include/clang/Lex/HeaderSearch.h include/clang/Lex/HeaderSearchOptions.h

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-17 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/Frontend/CompilerInstance.cpp:1502 @@ +1501,3 @@ +Module = PP->getHeaderSearchInfo().lookupModule(ModuleName); +if (!Module) { + getDiagnostics().Report(ModuleNameLoc, diag::err_module_prebuilt)

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-17 Thread Manman Ren via cfe-commits
manmanren added a comment. Thanks, Manman Comment at: lib/Frontend/CompilerInstance.cpp:1502 @@ +1501,3 @@ +Module = PP->getHeaderSearchInfo().lookupModule(ModuleName); +if (!Module) { + getDiagnostics().Report(ModuleNameLoc, diag::err_module_prebuilt)

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-17 Thread Manman Ren via cfe-commits
manmanren updated this revision to Diff 68442. https://reviews.llvm.org/D23125 Files: docs/Modules.rst include/clang/Basic/DiagnosticCommonKinds.td include/clang/Driver/Options.td include/clang/Lex/HeaderSearch.h include/clang/Lex/HeaderSearchOptions.h

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-17 Thread Richard Smith via cfe-commits
rsmith added a comment. Just a couple of things, but this basically LGTM. Comment at: docs/Modules.rst:217 @@ +216,3 @@ +``-fprebuilt-module-path=`` + Specify the path to the prebuilt modules. If specified, we will look for modules in this directory for a given top-level

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-16 Thread Manman Ren via cfe-commits
manmanren added a comment. Richard, Are you okay with the patch now? Thanks, Manman https://reviews.llvm.org/D23125 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-11 Thread Manman Ren via cfe-commits
manmanren added inline comments. Comment at: lib/Frontend/CompilerInstance.cpp:1438-1450 @@ -1437,3 +1437,15 @@ // Search for a module with the given name. Module = PP->getHeaderSearchInfo().lookupModule(ModuleName); -if (!Module) { +HeaderSearchOptions = +

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-10 Thread Bruno Cardoso Lopes via cfe-commits
bruno added inline comments. Comment at: lib/Frontend/CompilerInstance.cpp:1438-1450 @@ -1437,3 +1437,15 @@ // Search for a module with the given name. Module = PP->getHeaderSearchInfo().lookupModule(ModuleName); -if (!Module) { +HeaderSearchOptions = +

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-10 Thread Manman Ren via cfe-commits
manmanren added a comment. Thanks, Manman Comment at: include/clang/Lex/HeaderSearchOptions.h:96-97 @@ -95,1 +95,4 @@ + /// \brief The directory used to load prebuilt module files. + std::string PrebuiltModulePath; + rsmith wrote: > It would seem preferable

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-10 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: include/clang/Lex/HeaderSearchOptions.h:96-97 @@ -95,1 +95,4 @@ + /// \brief The directory used to load prebuilt module files. + std::string PrebuiltModulePath; + It would seem preferable to allow multiple of these,

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-10 Thread Manman Ren via cfe-commits
manmanren updated this revision to Diff 67621. manmanren added a comment. Addressing Richard's comments. https://reviews.llvm.org/D23125 Files: docs/Modules.rst include/clang/Driver/Options.td include/clang/Lex/HeaderSearch.h include/clang/Lex/HeaderSearchOptions.h

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-10 Thread Manman Ren via cfe-commits
manmanren added a comment. In https://reviews.llvm.org/D23125#510632, @rsmith wrote: > This doesn't seem like quite the right user interface for this feature. The > module cache is volatile, and it's not really reasonable for people to assume > they know what is and isn't within it. Instead,

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-09 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/Frontend/CompilerInstance.cpp:1483 @@ +1482,3 @@ + HSOpts.ModulesUsePrebuiltModules ? + ASTReader::ARR_ConfigurationMismatch : +

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-09 Thread Richard Smith via cfe-commits
rsmith added a subscriber: rsmith. rsmith added a comment. This doesn't seem like quite the right user interface for this feature. The module cache is volatile, and it's not really reasonable for people to assume they know what is and isn't within it. Instead, it seems like what we want to

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-09 Thread Manman Ren via cfe-commits
manmanren added a comment. In https://reviews.llvm.org/D23125#504942, @benlangmuir wrote: > How about -fmodules-use-prebuilt-**module-cache** for the flag name? Saying > "prebuilt-modules" is confusing to me, since -fmodule-file can also be used > to load a prebuilt module, but doesn't use

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-09 Thread Ben Langmuir via cfe-commits
benlangmuir accepted this revision. benlangmuir added a comment. This revision is now accepted and ready to land. Still missing the change for `if (IsPrebuilt) {`, but otherwise LGTM. https://reviews.llvm.org/D23125 ___ cfe-commits mailing list

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-09 Thread Manman Ren via cfe-commits
manmanren updated this revision to Diff 67431. manmanren added a comment. Add comments for setting IsSystem to true. https://reviews.llvm.org/D23125 Files: include/clang/Basic/DiagnosticDriverKinds.td include/clang/Driver/Options.td include/clang/Lex/HeaderSearchOptions.h

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-09 Thread Ben Langmuir via cfe-commits
benlangmuir added a comment. Sorry for the delay, I apparently forgot to hit submit. Replied inline. Comment at: lib/Frontend/CompilerInstance.cpp:1491 @@ +1490,3 @@ +false/*IsExplicit*/).first; +Module->IsSystem = true; +Module->IsFromModuleFile =

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-03 Thread Ben Langmuir via cfe-commits
benlangmuir added a comment. How about -fmodules-use-prebuilt-**module-cache** for the flag name? Saying "prebuilt-modules" is confusing to me, since -fmodule-file can also be used to load a prebuilt module, but doesn't use a cache. Comment at: lib/Driver/Tools.cpp:5416 @@

Re: [PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-03 Thread Manman Ren via cfe-commits
manmanren added inline comments. Comment at: lib/Driver/Tools.cpp:5416 @@ -5408,1 +5415,3 @@ + if (Args.getLastArg(options::OPT_fmodules_use_prebuilt_modules)) { +// When using prebuilt modules, we disable module hash. benlangmuir wrote: > ``` > if

[PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

2016-08-03 Thread Manman Ren via cfe-commits
manmanren created this revision. manmanren added a reviewer: benlangmuir. manmanren added a subscriber: cfe-commits. We add -fmodules-use-prebuilt-modules to support using prebuilt modules. In this mode, there is no need to load any module map and the programmer can simply use "@import" syntax