[PATCH] D37299: [Modules] Add ability to specify module name to module file mapping in a file
Boris Kolpackov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 25 05:04:14 PDT 2017
boris added a comment.
Yes, the main "feature" of this approach compared to @file is the ability to reuse an already existing file to store this information. Most build systems that support C/C++ compilation have to store auxiliary dependency information at least for the extracted header dependencies (those .d files generated by the -M option family, for example) but some also store hashes of options, compiler version/signature, etc. So instead of creating a yet another file (per translation unit), the idea is to reuse the already existing one by storing the mapping with some "distinguishing" prefix. As a concrete example, a make-based build system could append it to the .d file (which is a makefile fragment) as comments. How exactly this information is extracted is still an open question but I think this approach is generic enough to accommodate a wide range of possibilities (for example, -M could produce this information or the build system could append it itself after the -M is done).
More information about the cfe-commits