<div dir="ltr">Hello Benjamin,<br><br>It looks like this commit added warnings to the builder:<br><br><a href="http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/3596">http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/3596</a><br><br>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\ppltasks.h(1531): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc<br>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\ppltasks.h(1531): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc<br>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\ppltasks.h(1531): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc<br>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\ppltasks.h(1531): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc<br>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\ppltasks.h(1531): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc<br><br>Please have a look at this?<br><br>Thanks<br><br>Galina<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 9, 2017 at 7:18 AM, Benjamin Kramer via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: d0k<br>
Date: Mon Jan  9 09:18:28 2017<br>
New Revision: 291446<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=291446&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=291446&view=rev</a><br>
Log:<br>
[include-fixer] Load symbol index asynchronously.<br>
<br>
We don't actually need the index until parse time, so fetch it in the<br>
background and start parsing. By the time it is actually needed it's<br>
likely that the loading phase has completed in the background.<br>
<br>
Modified:<br>
    clang-tools-extra/trunk/<wbr>include-fixer/<wbr>SymbolIndexManager.cpp<br>
    clang-tools-extra/trunk/<wbr>include-fixer/<wbr>SymbolIndexManager.h<br>
    clang-tools-extra/trunk/<wbr>include-fixer/plugin/<wbr>IncludeFixerPlugin.cpp<br>
    clang-tools-extra/trunk/<wbr>include-fixer/tool/<wbr>ClangIncludeFixer.cpp<br>
    clang-tools-extra/trunk/<wbr>unittests/include-fixer/<wbr>IncludeFixerTest.cpp<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>include-fixer/<wbr>SymbolIndexManager.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/SymbolIndexManager.cpp?rev=291446&r1=291445&r2=291446&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/include-fixer/<wbr>SymbolIndexManager.cpp?rev=<wbr>291446&r1=291445&r2=291446&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>include-fixer/<wbr>SymbolIndexManager.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>include-fixer/<wbr>SymbolIndexManager.cpp Mon Jan  9 09:18:28 2017<br>
@@ -64,7 +64,7 @@ SymbolIndexManager::search(<wbr>llvm::StringR<br>
   do {<br>
     std::vector<clang::find_all_<wbr>symbols::SymbolInfo> Symbols;<br>
     for (const auto &DB : SymbolIndices) {<br>
-      auto Res = DB->search(Names.back().str())<wbr>;<br>
+      auto Res = DB.get()->search(Names.back())<wbr>;<br>
       Symbols.insert(Symbols.end(), Res.begin(), Res.end());<br>
     }<br>
<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>include-fixer/<wbr>SymbolIndexManager.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/SymbolIndexManager.h?rev=291446&r1=291445&r2=291446&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/include-fixer/<wbr>SymbolIndexManager.h?rev=<wbr>291446&r1=291445&r2=291446&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>include-fixer/<wbr>SymbolIndexManager.h (original)<br>
+++ clang-tools-extra/trunk/<wbr>include-fixer/<wbr>SymbolIndexManager.h Mon Jan  9 09:18:28 2017<br>
@@ -13,6 +13,7 @@<br>
 #include "SymbolIndex.h"<br>
 #include "find-all-symbols/SymbolInfo.<wbr>h"<br>
 #include "llvm/ADT/StringRef.h"<br>
+#include <future><br>
<br>
 namespace clang {<br>
 namespace include_fixer {<br>
@@ -21,8 +22,8 @@ namespace include_fixer {<br>
 /// to an indentifier in the source code from multiple symbol databases.<br>
 class SymbolIndexManager {<br>
 public:<br>
-  void addSymbolIndex(std::unique_<wbr>ptr<SymbolIndex> DB) {<br>
-    SymbolIndices.push_back(std::<wbr>move(DB));<br>
+  void addSymbolIndex(std::function<<wbr>std::unique_ptr<SymbolIndex>()<wbr>> F) {<br>
+    SymbolIndices.push_back(std::<wbr>async(std::launch::async, F));<br>
   }<br>
<br>
   /// Search for header files to be included for an identifier.<br>
@@ -39,7 +40,7 @@ public:<br>
   search(llvm::StringRef Identifier, bool IsNestedSearch = true) const;<br>
<br>
 private:<br>
-  std::vector<std::unique_ptr<<wbr>SymbolIndex>> SymbolIndices;<br>
+  std::vector<std::shared_<wbr>future<std::unique_ptr<<wbr>SymbolIndex>>> SymbolIndices;<br>
 };<br>
<br>
 } // namespace include_fixer<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>include-fixer/plugin/<wbr>IncludeFixerPlugin.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/plugin/IncludeFixerPlugin.cpp?rev=291446&r1=291445&r2=291446&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/include-fixer/plugin/<wbr>IncludeFixerPlugin.cpp?rev=<wbr>291446&r1=291445&r2=291446&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>include-fixer/plugin/<wbr>IncludeFixerPlugin.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>include-fixer/plugin/<wbr>IncludeFixerPlugin.cpp Mon Jan  9 09:18:28 2017<br>
@@ -61,23 +61,26 @@ public:<br>
         Input = Arg.substr(strlen("-input="));<br>
     }<br>
<br>
-    llvm::ErrorOr<std::unique_ptr<<wbr>include_fixer::<wbr>YamlSymbolIndex>> SymbolIdx(<br>
-        nullptr);<br>
-    if (DB == "yaml") {<br>
-      if (!Input.empty()) {<br>
-        SymbolIdx = include_fixer::<wbr>YamlSymbolIndex::<wbr>createFromFile(Input);<br>
-      } else {<br>
-        // If we don't have any input file, look in the directory of the first<br>
-        // file and its parents.<br>
-        const FrontendOptions &FO = CI.getFrontendOpts();<br>
-        SmallString<128> AbsolutePath(<br>
-            tooling::getAbsolutePath(FO.<wbr>Inputs[0].getFile()));<br>
-        StringRef Directory = llvm::sys::path::parent_path(<wbr>AbsolutePath);<br>
-        SymbolIdx = include_fixer::<wbr>YamlSymbolIndex::<wbr>createFromDirectory(<br>
-            Directory, "find_all_symbols_db.yaml");<br>
+    std::string InputFile = CI.getFrontendOpts().Inputs[0]<wbr>.getFile();<br>
+    auto CreateYamlIdx = [=]() -> std::unique_ptr<include_fixer:<wbr>:SymbolIndex> {<br>
+      llvm::ErrorOr<std::unique_ptr<<wbr>include_fixer::<wbr>YamlSymbolIndex>> SymbolIdx(<br>
+          nullptr);<br>
+      if (DB == "yaml") {<br>
+        if (!Input.empty()) {<br>
+          SymbolIdx = include_fixer::<wbr>YamlSymbolIndex::<wbr>createFromFile(Input);<br>
+        } else {<br>
+          // If we don't have any input file, look in the directory of the first<br>
+          // file and its parents.<br>
+          SmallString<128> AbsolutePath(tooling::<wbr>getAbsolutePath(InputFile));<br>
+          StringRef Directory = llvm::sys::path::parent_path(<wbr>AbsolutePath);<br>
+          SymbolIdx = include_fixer::<wbr>YamlSymbolIndex::<wbr>createFromDirectory(<br>
+              Directory, "find_all_symbols_db.yaml");<br>
+        }<br>
       }<br>
-    }<br>
-    SymbolIndexMgr-><wbr>addSymbolIndex(std::move(*<wbr>SymbolIdx));<br>
+      return std::move(*SymbolIdx);<br>
+    };<br>
+<br>
+    SymbolIndexMgr-><wbr>addSymbolIndex(std::move(<wbr>CreateYamlIdx));<br>
     return true;<br>
   }<br>
<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>include-fixer/tool/<wbr>ClangIncludeFixer.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp?rev=291446&r1=291445&r2=291446&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/include-fixer/tool/<wbr>ClangIncludeFixer.cpp?rev=<wbr>291446&r1=291445&r2=291446&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>include-fixer/tool/<wbr>ClangIncludeFixer.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>include-fixer/tool/<wbr>ClangIncludeFixer.cpp Mon Jan  9 09:18:28 2017<br>
@@ -179,30 +179,36 @@ createSymbolIndexManager(<wbr>StringRef FileP<br>
             find_all_symbols::SymbolInfo::<wbr>SymbolKind::Unknown,<br>
             CommaSplits[I].trim(), 1, {}, /*NumOccurrences=*/E - I));<br>
     }<br>
-    SymbolIndexMgr-><wbr>addSymbolIndex(<br>
-        llvm::make_unique<include_<wbr>fixer::InMemorySymbolIndex>(<wbr>Symbols));<br>
+    SymbolIndexMgr-><wbr>addSymbolIndex([=]() {<br>
+      return llvm::make_unique<include_<wbr>fixer::InMemorySymbolIndex>(<wbr>Symbols);<br>
+    });<br>
     break;<br>
   }<br>
   case yaml: {<br>
-    llvm::ErrorOr<std::unique_ptr<<wbr>include_fixer::<wbr>YamlSymbolIndex>> DB(nullptr);<br>
-    if (!Input.empty()) {<br>
-      DB = include_fixer::<wbr>YamlSymbolIndex::<wbr>createFromFile(Input);<br>
-    } else {<br>
-      // If we don't have any input file, look in the directory of the first<br>
-      // file and its parents.<br>
-      SmallString<128> AbsolutePath(tooling::<wbr>getAbsolutePath(FilePath));<br>
-      StringRef Directory = llvm::sys::path::parent_path(<wbr>AbsolutePath);<br>
-      DB = include_fixer::<wbr>YamlSymbolIndex::<wbr>createFromDirectory(<br>
-          Directory, "find_all_symbols_db.yaml");<br>
-    }<br>
+    auto CreateYamlIdx = [=]() -> std::unique_ptr<include_fixer:<wbr>:SymbolIndex> {<br>
+      llvm::ErrorOr<std::unique_ptr<<wbr>include_fixer::<wbr>YamlSymbolIndex>> DB(<br>
+          nullptr);<br>
+      if (!Input.empty()) {<br>
+        DB = include_fixer::<wbr>YamlSymbolIndex::<wbr>createFromFile(Input);<br>
+      } else {<br>
+        // If we don't have any input file, look in the directory of the<br>
+        // first<br>
+        // file and its parents.<br>
+        SmallString<128> AbsolutePath(tooling::<wbr>getAbsolutePath(FilePath));<br>
+        StringRef Directory = llvm::sys::path::parent_path(<wbr>AbsolutePath);<br>
+        DB = include_fixer::<wbr>YamlSymbolIndex::<wbr>createFromDirectory(<br>
+            Directory, "find_all_symbols_db.yaml");<br>
+      }<br>
<br>
-    if (!DB) {<br>
-      llvm::errs() << "Couldn't find YAML db: " << DB.getError().message()<br>
-                   << '\n';<br>
-      return nullptr;<br>
-    }<br>
+      if (!DB) {<br>
+        llvm::errs() << "Couldn't find YAML db: " << DB.getError().message()<br>
+                     << '\n';<br>
+        return nullptr;<br>
+      }<br>
+      return std::move(*DB);<br>
+    };<br>
<br>
-    SymbolIndexMgr-><wbr>addSymbolIndex(std::move(*DB))<wbr>;<br>
+    SymbolIndexMgr-><wbr>addSymbolIndex(std::move(<wbr>CreateYamlIdx));<br>
     break;<br>
   }<br>
   }<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>unittests/include-fixer/<wbr>IncludeFixerTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/include-fixer/IncludeFixerTest.cpp?rev=291446&r1=291445&r2=291446&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/unittests/include-fixer/<wbr>IncludeFixerTest.cpp?rev=<wbr>291446&r1=291445&r2=291446&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>unittests/include-fixer/<wbr>IncludeFixerTest.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>unittests/include-fixer/<wbr>IncludeFixerTest.cpp Mon Jan  9 09:18:28 2017<br>
@@ -85,8 +85,9 @@ static std::string runIncludeFixer(<br>
                  1, {}),<br>
   };<br>
   auto SymbolIndexMgr = llvm::make_unique<include_<wbr>fixer::SymbolIndexManager>();<br>
-  SymbolIndexMgr-><wbr>addSymbolIndex(<br>
-      llvm::make_unique<include_<wbr>fixer::InMemorySymbolIndex>(<wbr>Symbols));<br>
+  SymbolIndexMgr-><wbr>addSymbolIndex([=]() {<br>
+    return llvm::make_unique<include_<wbr>fixer::InMemorySymbolIndex>(<wbr>Symbols);<br>
+  });<br>
<br>
   std::vector<<wbr>IncludeFixerContext> FixerContexts;<br>
   IncludeFixerActionFactory Factory(*SymbolIndexMgr, FixerContexts, "llvm");<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>