[cfe-commits] r146158 - in /cfe/trunk: include/clang/Basic/Module.h lib/Basic/Module.cpp lib/Frontend/FrontendActions.cpp lib/Lex/ModuleMap.cpp lib/Serialization/ASTReader.cpp lib/Serialization/ASTWriter.cpp

Douglas Gregor dgregor at apple.com
Thu Dec 8 11:58:53 PST 2011


On Dec 8, 2011, at 10:28 AM, Francois Pichet wrote:

> On Thu, Dec 8, 2011 at 12:39 PM, Douglas Gregor <dgregor at apple.com> wrote:
>> Author: dgregor
>> Date: Thu Dec  8 11:39:04 2011
>> New Revision: 146158
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=146158&view=rev
>> Log:
>> Within the module representation, generalize the notion of an umbrella
>> header to also support umbrella directories. The umbrella directory
>> for an umbrella header is the directory in which the umbrella header
>> resides.
>> 
> 
> Hi Doug,
> I am curious, what is this whole module thing about?

Essentially what Matthieu said. Modules are an attempt to replace headers with something that is less fragile (can't be broken by #defines and is not sensitive to import ordering) and more scalable (a module needs to be parsed once, and is cheap to import, whereas a header has to be parsed every time it is included). 

The major challenge for modules isn't the design of the system itself; it's the transition problem from today's headers-only world to a modular world. Most of my recent work has been in that area, defining the "module map" sub-language that maps between headers and modules, so that one can flip the switch (currently, -fauto-import-modules) and remap all of the #includes to module imports.

> Is it objc/objc++
> only or some clang C++ extension?


It's intended to cover all of Clang's dialects. As always, C++ has more challenges than C/Objective-C, due to template instantiations and argument-dependent lookup, among many other things.

	- Doug



More information about the cfe-commits mailing list