[cfe-dev] Intros, C++ modules, and Facebook

Vedant Kumar via cfe-dev cfe-dev at lists.llvm.org
Fri Oct 23 12:24:52 PDT 2015


Hello,

I couldn't find existing module maps for the libraries you mentioned, but you might be able to reuse parts of the modulemap for libc++:

    libcxx/include/module.modulemap

I'm interested in your second question as well. There's a line in "CompilerInstance::loadModule" that updates LastModuleImportLoc. Do you think it'd be worthwhile to dump the module name there, to get an idea of what's been loaded? 

I've played around with the "modularize" utility but it's results aren't always usable. If you have the time, I'd love to read a writeup about modularizing large codebases.

vedant

> On Oct 23, 2015, at 10:28 AM, Louis Brandy via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
> Hi cfe-dev,
> 
> My name is Louis Brandy and I work at Facebook. I’ve begun working on
> getting clang modules setup in our C++ codebase. Mostly the purpose of
> this email is just to introduce myself and let people know what we’re
> doing and our motivation, but I’ve also brought a handful of newbie
> questions. I’ve gotten the basic integrations into the build system and
> have some core projects building modularly. To get this far, I hacked
> together a highly unprincipled set of module maps for glibc, libstdc++.
> I’m at the point, now, where I need “real” module maps for our std/system
> headers. 
> 
> First, is there any prior art re: glibc and libstdc++ module maps? I don’t
> want to repeat any work that’s already been done, and my google-fu failed.
> 
> Second, I’m interested in the workflow of actually incrementally adding
> module maps to a large codebase. I do understand the need to start at the
> bottom but I’m worried about proper coverage, and then prioritizing what
> to do next. In particular, I find myself really wanting a “summary” of
> what #includes did and did not magically become imports so I can use that
> to make sure 1) I’ve not missed anything “below” and 2) to prioritize what
> to do next (by e.g. aggregating over a build the most textually included
> headers). I don’t think such a diagnostic/remark exists? I’ve not looked
> too deeply, yet, at clang-modularize, so perhaps my answers lie over
> there? 
> 
> On a final note, it’s been remarkably easy to get modules up and running
> so kudos to everyone who’s gotten it this far.
> 
> -Louis
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list