ilya-biryukov added a comment.

Sorry, didn't get a chance to look into it very thoroughly yet.

Are there any other callers to getMainBufferWithPrecompiledPreamble?
Maybe they cause LibclangReparseTest.ReparseWithModule to fail?



================
Comment at: lib/Frontend/ASTUnit.cpp:1395
+        const FileEntry *fileEntry = FileMgr->getFile(R.second);
+        if (!fileEntry) {
           // If we can't stat the file we're remapping to, assume that 
something
----------------
Are we relying on the caller to create new FileMgr before calling 
getMainBufferWithPrecompiledPreamble?
Otherwise we'll hit a cached entry and possibly miss an update to the file?

This deserves a comment if that's the case.


================
Comment at: lib/Frontend/ASTUnit.cpp:2074
   // Clear out the diagnostics state.
-  FileMgr.reset();
   getDiagnostics().Reset();
----------------
Parse method used to recreate FileMgr from CompilerInvocation, because it was 
reset() at this point.
Won't something break because we're reusing the FileMgr now?
Maybe the code creating FileMgr in Parse should be deleted?


https://reviews.llvm.org/D33045



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to