[PATCH] D33415: [clangd] Replaced WorkerRequest with std::function...

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 04:55:15 PDT 2017


ilya-biryukov marked 2 inline comments as done.
ilya-biryukov added inline comments.


================
Comment at: clangd/ClangdServer.cpp:85
+        Request = std::move(RequestQueue.front());
+        RequestQueue.pop_front();
       } // unlock Mutex
----------------
krasimir wrote:
> Why are we taking it from the front and not from the back? Maybe at least add a comment about this behavior.
Added comments here and at the addToEnd/addToFront methods.


================
Comment at: clangd/ClangdServer.cpp:230
+        Unit.dumpAST(ResultOS);
+      }
+      DumpPromise.set_value(std::move(Result));
----------------
krasimir wrote:
> Maybe an explicit flush and no block?
Ok.


================
Comment at: clangd/ClangdUnitStore.h:62
+
+    Action(It->second);
+  }
----------------
krasimir wrote:
> Why can't we use `runOnUnitImpl` here?
runOnUnitImpl does parsing/reparsing if the ASTFile is not there, which this function doesn't do specifically.


https://reviews.llvm.org/D33415





More information about the cfe-commits mailing list