[PATCH] Module use declarations (II)

Doug Gregor dgregor at apple.com
Tue Sep 10 21:14:55 PDT 2013



================
Comment at: lib/Serialization/ASTReader.cpp:3032
@@ -3031,1 +3031,3 @@
+
+  //FIXME: How do we load the 'use'd modules?  They may not be submodules.
   
----------------
Daniel Jasper wrote:
> Doug Gregor wrote:
> > You can read/write global "submodule IDs". The "sub" is misleading in this case; it means that one might be referring to either a top-level module or to a submodule.
> I don't understand where the ID of a global module would come from. As far as I understand, all the (sub)modules within a single top-level module are numbered and then referred to by this number. How would that work for global modules?
The writer conjures up (sub)module IDs when you call getSubmoduleID. Then the reader can turn that number into a reference to an actual Module* using getGlobalSubmoduleID/getSubmodule.

================
Comment at: docs/Modules.rst:198
@@ +197,3 @@
+``-fmodules-indirect-check``
+  Extend checking of module imports and includes to indirect uses of modules.
+
----------------
Daniel Jasper wrote:
> Doug Gregor wrote:
> > I wonder... do we have to have this as an option, or can we simply say that there is one right answer and implement only that?
> We can try without. I think only direct checking makes sense at the moment. Everything else was untested anyway ..
WFM!

================
Comment at: lib/Basic/Module.cpp:271
@@ +270,3 @@
+  }
+  // FIXME: Add handling of wildcard module specifications.
+}
----------------
Daniel Jasper wrote:
> Doug Gregor wrote:
> > Why do we even have wildcards for uses? It seems that one would have to enumerate all of the uses separately for this feature to be useful.
> I had the same initial thought. However, I think this might be useful e.g. because a project's internal modules might be treated differently from system modules. Internally, a project might want to specify all dependencies clearly. However, it could e.g. be useful to say "uses std.*" because including any header from std is always ok. (I don't feel certain about this, though).
Interesting. Would simply saying

  uses std;

mean the same thing as 

  uses std.*;

?

Anyway, I'm okay with this, it just feels unnecessary.


http://llvm-reviews.chandlerc.com/D1546



More information about the cfe-commits mailing list