[cfe-dev] Module progress?

Douglas Gregor dgregor at apple.com
Thu Jan 17 11:37:01 PST 2013


On Jan 17, 2013, at 11:36 AM, Kosztka Imre Dávid <kosztkaid at gmail.com> wrote:

> Where are the source and tests for the already existing part?

Everything is in the Clang repository, with tests in the traditional test/Modules subdirectory.

	- Doug

> 
> 2013/1/17 Douglas Gregor <dgregor at apple.com>
> 
> On Jan 7, 2013, at 10:42 AM, Kosztka Imre Dávid <kosztkaid at gmail.com> wrote:
> 
>> How can we help?
> 
> Modules is a big feature, and there are a few places where one could help. Some ideas:
> 
>   - Diagnostics: when we produce diagnostics that point to a source location within a module (e.g., in a note or macro expansion), the "imported from" backtrace only mentions module names (e.g., "std") rather than submodule names ("std.tgmath"). We should provide better granularity here.
> 
>   - Fix-Its: we may know about a module that has not yet been imported, in which case we should provide a Fix-It to import the module if that would cause ill-formed code to work. For example,
> 
> 	Foo bar(); // error: unknown type name 'Foo'
> 
>     could turn into; // error: unknown type name 'Foo' is available by importing the module 'MyLib.Foo'
> 
>    with a Fix-It that adds 'import MyLib.Foo' or '#include <MyLib/Foo.h>" in a reasonable place.
> 
>   - Track which explicitly-imported modules have not had any of their declarations used, and produce "unused import" warnings at the end of a translation unit. For example:
> 
> 	import std.tgmath;
> 	import std.io;
> 
> 	int main() {
> 	  printf("Hello\n");
> 	}
> 
> 	// warn about unused import 'std.tgmath'.
> 
>     The same should work for #includes that have automatically be translated into imports.
> 
>   - Fix NamespaceAliasDecl so that it is "redeclarable". In other words, given
> 
> 	namespace filesystem { }
> 	namespace fs = filesystem;
> 	namespace fs = filesystem;
> 
>     make sure that the two 'fs' declarations are properly chained together, like we do for all other redeclarations.
> 
>   - Improve the 'modularize' tool I hacked up (sources attached), which attempts to find non-modular behavior in a set of header files. This tool is going to be really important when trying to take an existing (probably horrible) set of system headers and figuring out how to tweak them to be modular enough.
> 
> 	- Doug
> 
> 
> 
>> 
>> 2013/1/7 Douglas Gregor <dgregor at apple.com>
>> 
>> On Jan 6, 2013, at 11:13 AM, Traktor Toni <trustthesky at gmail.com> wrote:
>> 
>> > Referring to: http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf
>> >
>> > When is this ready?
>> 
>> 
>> Not yet. There's still a ton of work to do for C++, as well as performance work and a ton of debugging. It will be a while; this feature is, unfortunately, quite complicated.
>> 
>>         - Doug
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>> 
>> 
>> 
>> -- 
>> Name : Kosztka Imre Dávid
>> E-mail: kosztkaid at gmail.com
>> Phone number: +36309213462
>> Mailing address: H-3700, Hungary Kazincbarcika Szeder utca 2.
> 
> 
> 
> 
> 
> -- 
> Name : Kosztka Imre Dávid
> E-mail: kosztkaid at gmail.com
> Phone number: +36309213462
> Mailing address: H-3700, Hungary Kazincbarcika Szeder utca 2.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130117/ac38494f/attachment.html>


More information about the cfe-dev mailing list