<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi John,<div><br><div><div>On Sep 17, 2013, at 1:53 PM, Thompson, John <<a href="mailto:John_Thompson@playstation.sony.com">John_Thompson@playstation.sony.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">(I originally posted this on cfe-commits, but I learned cfe-dev would be more appropriate.)<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">Hi,<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">The page for modules (<a href="http://clang.llvm.org/docs/Modules.html#future-directions" style="color: purple; text-decoration: underline;"><span style="color: purple;">http://clang.llvm.org/docs/Modules.html#future-directions</span></a>) mentions in the future directions section enhancing modularize with an assistant mode for generating a module.map file.  I’m starting to think about that, so before I plow ahead and possibly do something wrong, I wanted to open up a discussion for ideas and feedback, particularly since modules are new, and I might not have the correct understanding about them yet.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> <o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">First off, do you think having modularize optionally generate a module.map file is even warranted?  If it is, how close can we get to producing a useable module.map file?  But perhaps the idea is just to create a starting point, to save some typing, since we would already have a list of header files.  I’ll proceed along those lines.</span></div></div></div></blockquote><div><br></div><div>I imagine it will only be a starting point, but simply enumerating all of the header files that get pulled in would be helpful.</div><br><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">Basically, as a starting point, I assume the header file name list is the basis for the headers included in the modules, except that these headers can still include other headers via #include, and are not listed because they are either internal, or they are part of a group but not independent and should not result in a separate submodule.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> <o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">Then at this point, that raises the question of how you figure out the module/submodule hierarchy.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> <o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">The simplest scheme is that all the files in the header file list pertain to just one outer module, named by a command-line option.  For example, “-root=std” would define one outer module called “std” and each header in the header file list would be a submodule inside “std”.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;"> <o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">The header file list might have headers that are in subdirectories.  Perhaps a modification of the above scheme could be that a submodule is created for the subdirectory name, and the headers in the subdirectory go inside that module, becoming sub-sub-modules and so on.</span></div></div></div></blockquote><div><br></div>This would be my suggestion. Assume that the directory structure implies a module structure, and go from there. I know I've seen a number of libraries where this heuristic would be a good start.</div><div><br><blockquote type="cite" dir="auto"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif;">As an alternative, perhaps namespace blocks could be used to determine modules.  The outermost namespace determines the root module, and nested namespaces become the submodule hierarchy.</span></div></div></div></blockquote><div><br></div><div>This is potentially interesting, but I suspect it won't help as much. At least, not in the namespacing structures I've seen.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">   </span>- Doug</div></div><br></div></body></html>