<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;"><div><div>+def fmodules_skip_verify_if_validated_after : Joined<["-"], "fmodules-skip-verify-if-validated-after=">,</div></div><div><br></div><div>Should we use a more general name, like “-fbuild-session-timestamp” or something, this seems like it could have other uses in the future.</div><div><br></div><div><div>+static void updateModuleTimestamp(ModuleFile &MF) {</div><div>+  // Overwrite the timestamp file contents so that file's mtime changes.</div><div>+  std::string TimestampFilename = MF.getTimestampFilename();</div><div>+  std::string ErrorInfo;</div><div>+  llvm::raw_fd_ostream OS(TimestampFilename.c_str(), ErrorInfo);</div><div>+  if (!ErrorInfo.empty())</div><div>+    return;</div><div>+  OS << "Timestamp file\n";</div><div>+}</div></div><div><br></div><div><div>+    New->InputFilesValidationTimestamp = 0;</div><div>+    if (New->Kind == MK_Module) {</div><div>+      std::string TimestampFilename = New->getTimestampFilename();</div><div>+      llvm::sys::fs::file_status Status;</div><div>+      // A cached stat value would be fine as well.</div><div>+      if (!FileMgr.getNoncachedStatValue(TimestampFilename, Status)) {</div><div>+        llvm::sys::TimeValue MTime = Status.getLastModificationTime();</div><div>+        New->InputFilesValidationTimestamp =</div><div>+            MTime.toEpochTime() * 1000 + MTime.milliseconds();</div><div>+      }</div><div>+    }</div><div>+</div></div><div><br></div><div>I’m concerned that we are depending on being in-sync with the modification time given by the file system and the builder that provided the original timestamp.</div><div><br></div><div>I think we should only use the timestamp the builder is providing. For example:</div><div><br></div><div>— "-timestamp=123"</div><div>— No timestamp file</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>- verify the module</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>- once done, write out “123” to the timestamp file</div><div>— Timestamp file</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>- read timestamp file and compare the timestamp given in command-line with the one written to the timestamp file.</div><div><br></div><div>What do you think ?</div><div><br></div><div><br></div>On Feb 7, 2014, at 10:18 AM, Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="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;">On Fri, Feb 7, 2014 at 6:14 PM, Ben Langmuir <<a href="mailto:blangmuir@apple.com">blangmuir@apple.com</a>> wrote:<br><blockquote type="cite">Hi Dmitri,<br><br>+        // If we are reading a module, we will create a verification timestamp,<br>+        // so we verify all input files.  Otherwise, verify only user input<br>+        // files.<br>+        unsigned LastFileToValidate =<br>+            F.Kind == MK_Module ? F.InputFilesLoaded.size() : Record[1];<br>+        for (unsigned I = 0; I < LastFileToValidate; ++I) {<br>           InputFile IF = getInputFile(F, I+1, Complain);<br>           if (!IF.getFile() || IF.isOutOfDate())<br><br><br>Should that be<br><br>MK_Module && SkipVerifyIfValidatedAfter ?<br><br>or is it intentional to stat the system files even if this new command line option is missing?<br></blockquote><br>Indeed, that was not intended.  Thanks!  Updated and rebased patch attached.<br><br>Dmitri<br><br>--<span class="Apple-converted-space"> </span><br>main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br>(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>>*/<br><span><optimize-module-verification-v3.patch></span></div></blockquote></div><br></body></html>