<div style="font-family: arial, helvetica, sans-serif"><font size="2">Did this patch get review on the mailing list somewhere I missed? I have some serious concerns with the approach, but would rather focus the review somewhere productive....<div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Jun 27, 2012 at 2:17 AM, Axel Naumann <span dir="ltr"><<a href="mailto:Axel.Naumann@cern.ch" target="_blank">Axel.Naumann@cern.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: axel<br>
Date: Wed Jun 27 04:17:42 2012<br>
New Revision: 159256<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=159256&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=159256&view=rev</a><br>
Log:<br>
>From Vassil Vassilev:<br>
add interface for removing a FileEntry from the cache.<br>
Forces a re-read the contents from disk, e.g. because a tool (like cling) wants to pick up a modified file.<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/Basic/FileManager.h<br>
    cfe/trunk/lib/Basic/FileManager.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Basic/FileManager.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/FileManager.h?rev=159256&r1=159255&r2=159256&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/FileManager.h?rev=159256&r1=159255&r2=159256&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/Basic/FileManager.h (original)<br>
+++ cfe/trunk/include/clang/Basic/FileManager.h Wed Jun 27 04:17:42 2012<br>
@@ -222,6 +222,9 @@<br>
   /// FileManager's FileSystemOptions.<br>
   bool getNoncachedStatValue(StringRef Path, struct stat &StatBuf);<br>
<br>
+  /// \brief Remove the real file Entry from the cache.<br>
+  void InvalidateCache(const FileEntry* Entry);<br>
+<br>
   /// \brief If path is not absolute and FileSystemOptions set the working<br>
   /// directory, the path is modified to be relative to the given<br>
   /// working directory.<br>
<br>
Modified: cfe/trunk/lib/Basic/FileManager.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=159256&r1=159255&r2=159256&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=159256&r1=159255&r2=159256&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Basic/FileManager.cpp (original)<br>
+++ cfe/trunk/lib/Basic/FileManager.cpp Wed Jun 27 04:17:42 2012<br>
@@ -111,6 +111,8 @@<br>
   }<br>
<br>
   size_t size() const { return UniqueFiles.size(); }<br>
+<br>
+  friend class FileManager;<br>
 };<br>
<br>
 //===----------------------------------------------------------------------===//<br>
@@ -152,6 +154,8 @@<br>
   }<br>
<br>
   size_t size() const { return UniqueFiles.size(); }<br>
+<br>
+  friend class FileManager;<br>
 };<br>
<br>
 #endif<br>
@@ -559,6 +563,15 @@<br>
   return ::stat(FilePath.c_str(), &StatBuf) != 0;<br>
 }<br>
<br>
+void FileManager::InvalidateCache(const FileEntry* Entry) {<br>
+  if (!Entry)<br>
+    return;<br>
+<br>
+  SeenFileEntries.erase(Entry->getName());<br>
+  UniqueRealFiles.UniqueFiles.erase(*Entry);<br>
+}<br>
+<br>
+<br>
 void FileManager::GetUniqueIDMapping(<br>
                    SmallVectorImpl<const FileEntry *> &UIDToFiles) const {<br>
   UIDToFiles.clear();<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></font></div>