[PATCH] D69328: [clangd] Propogate context in TUScheduler::run

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 23 01:23:38 PDT 2019


kadircet created this revision.
kadircet added a reviewer: sammccall.
Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, javed.absar, ilya-biryukov.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69328

Files:
  clang-tools-extra/clangd/TUScheduler.cpp


Index: clang-tools-extra/clangd/TUScheduler.cpp
===================================================================
--- clang-tools-extra/clangd/TUScheduler.cpp
+++ clang-tools-extra/clangd/TUScheduler.cpp
@@ -919,7 +919,9 @@
                       llvm::unique_function<void()> Action) {
   if (!PreambleTasks)
     return Action();
-  PreambleTasks->runAsync(Name, std::move(Action));
+  auto ActionWithCtx = [Ctx = Context::current().clone(),
+                        Action = std::move(Action)]() mutable { Action(); };
+  PreambleTasks->runAsync(Name, std::move(ActionWithCtx));
 }
 
 void TUScheduler::runWithAST(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69328.226099.patch
Type: text/x-patch
Size: 620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191023/42ccca87/attachment.bin>


More information about the cfe-commits mailing list