Allow searching for prebuilt implicit modules.This reverts commit c67656b994c87224e0b33e2c4b09093986a5cfa6, and addresses thebuild issue.
Revert "Allow searching for prebuilt implicit modules."This reverts commit 71e108cd86e70b06c5fa3a63689dcb3555c3d13f.This change caused a build failure on Windows:http://lab.llvm.org:8011/#/build
Revert "Allow searching for prebuilt implicit modules."This reverts commit 71e108cd86e70b06c5fa3a63689dcb3555c3d13f.This change caused a build failure on Windows:http://lab.llvm.org:8011/#/builders/83/builds/570
show more ...
Allow searching for prebuilt implicit modules.The behavior is controlled by the `-fprebuilt-implicit-modules` option, andallows searching for implicit modules in the prebuilt module cache paths.
Allow searching for prebuilt implicit modules.The behavior is controlled by the `-fprebuilt-implicit-modules` option, andallows searching for implicit modules in the prebuilt module cache paths.The current command-line options for prebuilt modules do not allow to easilymaintain and use multiple versions of modules. Both the producer and users ofprebuilt modules are required to know the relationships between compilationoptions and module file paths. Using a particular version of a prebuilt modulerequires passing a particular option on the command line (e.g.`-fmodule-file=[<name>=]<file>` or `-fprebuilt-module-path=<directory>`).However the compiler already knows how to distinguish and automatically locateimplicit modules. Hence this proposal to introduce the`-fprebuilt-implicit-modules` option. When set, it enables searching forimplicit modules in the prebuilt module paths (specified via`-fprebuilt-module-path`). To not modify existing behavior, this search takesplace after the standard search for prebuilt modules. If notHere is a workflow illustrating how both the producer and consumer of prebuiltmodules would need to know what versions of prebuilt modules are available andwhere they are located. clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules_v1 <config 1 options> clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules_v2 <config 2 options> clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules_v3 <config 3 options> clang -cc1 -x c use.c -fmodules fmodule-map-file=modulemap -fprebuilt-module-path=prebuilt_modules_v1 <config 1 options> clang -cc1 -x c use.c -fmodules fmodule-map-file=modulemap <non-prebuilt config options>With prebuilt implicit modules, the producer can generate prebuilt modules asusual, all in the same output directory. The same mechanisms as for implicitmodules take care of incorporating hashes in the path to distinguish betweenmodule versions.Note that we do not specify the output module filename, so `-o` implicit modules are generated in the cache path `prebuilt_modules`. clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules <config 1 options> clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules <config 2 options> clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules <config 3 options>The user can now simply enable prebuilt implicit modules and point to theprebuilt modules cache. No need to "parse" command-line options to decidewhat prebuilt modules (paths) to use. clang -cc1 -x c use.c -fmodules fmodule-map-file=modulemap -fprebuilt-module-path=prebuilt_modules -fprebuilt-implicit-modules <config 1 options> clang -cc1 -x c use.c -fmodules fmodule-map-file=modulemap -fprebuilt-module-path=prebuilt_modules -fprebuilt-implicit-modules <non-prebuilt config options>This is for example particularly useful in a use-case where compilation isexpensive, and the configurations expected to be used are predictable, but notcontrolled by the producer of prebuilt modules. Modules for the set ofpredictable configurations can be prebuilt, and using them does not require"parsing" the configuration (command-line options).Reviewed By: BigcheeseDifferential Revision: https://reviews.llvm.org/D68997