<div dir="ltr">Digging this thread back up, I'm starting to work on deterministic output of modules. This is *really* important. Unfortunately, it's almost impossible to make progress as long as this code is actually firing because it kind of makes things definitively non-deterministic. ;]<div><br></div><div>Ben, do you have any concerns about only emitting the signature record for implicit modules? This would omit it for explicit modules (where I'm working), PCH files, etc. Based on your commit message and explanation, it doesn't really make sense outside of implicit modules AFAICT, and we're hoping it will go away completely.</div><div><br></div><div><br></div><div>Also, I have one question here which may just be my ignorance:</div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 23, 2014 at 11:05 AM, Ben Langmuir <span dir="ltr"><<a href="mailto:blangmuir@apple.com" target="_blank">blangmuir@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+                            ASTFileSignature ExpectedSignature,<br>
+                            std::function<ASTFileSignature(llvm::BitstreamReader &)><br>
+                                ReadSignature,<br></blockquote><div><br></div><div>Wow, a std::function? Is this really necessary? Seems super heavy weight.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
+static ASTFileSignature readASTFileSignature(llvm::BitstreamReader &StreamFile){<br>
+  BitstreamCursor Stream(StreamFile);<br>
+  if (Stream.Read(8) != 'C' ||<br>
+      Stream.Read(8) != 'P' ||<br>
+      Stream.Read(8) != 'C' ||<br>
+      Stream.Read(8) != 'H') {<br>
+    return 0;<br>
+  }<br></blockquote><div><br></div><div>This is truly magical. I assume this is checking for some magic string? Comments or something would be really nice here. Sharing the code would be even more nice.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+  // Scan for the CONTROL_BLOCK_ID block.<br>
+  if (SkipCursorToBlock(Stream, CONTROL_BLOCK_ID))<br>
+    return 0;<br></blockquote><div><br></div><div>Why would it ever be reasonable to call this for a module file without such a block?</div><div><br></div><div><br></div></div></div></div></div>