[PATCH] D28299: Module: use PCMCache to manage memory buffers for pcm files.

Ben Langmuir via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 15:56:49 PST 2017


benlangmuir added a comment.

Can we test the already-validated diagnostics?



================
Comment at: include/clang/Basic/FileManager.h:176
+  /// Manage memory buffers associated with pcm files.
+  std::unique_ptr<PCMCache> BufferMgr;
+
----------------
Why is this inside the FileManager? It isn't used by the FileManager.


================
Comment at: include/clang/Basic/FileManager.h:308
+  /// a thread, we pop a ThreadContext.
+  struct ThreadContext {
+    /// Keep track of all module files that have been validated in this thread
----------------
Can we call this something like "ModuleLoadContext" or maybe "ModuleCompilationContext"?  The word thread is misleading, since the threads are not run concurrently, and are only an implementation detail of our crash recovery.

Also, can you explain why it is only necessary to keep information about the the current stack of contexts?  In a situation like

A imports B imports C
A imports D imports C

We would no longer have information about C being validated, right?  What happens if there's a mismatch there?  Can this never happen?


https://reviews.llvm.org/D28299





More information about the cfe-commits mailing list