[PATCH] D33045: [libclang] Avoid more stats than necessary for reparse.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 19 07:32:38 PDT 2017


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





More information about the cfe-commits mailing list