hokein updated this revision to Diff 181502.
hokein added a comment.

remove unrelated blank changes.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56655/new/

https://reviews.llvm.org/D56655

Files:
  clangd/index/Background.cpp


Index: clangd/index/Background.cpp
===================================================================
--- clangd/index/Background.cpp
+++ clangd/index/Background.cpp
@@ -484,7 +484,7 @@
   // Goes over each dependency.
   for (size_t CurrentDependency = 0; CurrentDependency < Dependencies.size();
        CurrentDependency++) {
-    llvm::StringRef CurDependencyPath = Dependencies[CurrentDependency].Path;
+    std::string CurDependencyPath = Dependencies[CurrentDependency].Path;
     // If we have already seen this shard before(either loaded or failed) don't
     // re-try again. Since the information in the shard won't change from one 
TU
     // to another.
@@ -504,11 +504,16 @@
     // These are the edges in the include graph for current dependency.
     for (const auto &I : *Shard->Sources) {
       auto U = URI::parse(I.getKey());
-      if (!U)
+      if (!U) {
+        elog("Failed to parse URI {0}: {1}", I.getKey(), U.takeError());
         continue;
+      }
       auto AbsolutePath = URI::resolve(*U, CurDependencyPath);
-      if (!AbsolutePath)
+      if (!AbsolutePath) {
+        elog("Failed to resolve URI {0}: {1}", I.getKey(),
+             AbsolutePath.takeError());
         continue;
+      }
       // Add file as dependency if haven't seen before.
       if (InQueue.try_emplace(*AbsolutePath).second)
         Dependencies.emplace_back(*AbsolutePath, true);


Index: clangd/index/Background.cpp
===================================================================
--- clangd/index/Background.cpp
+++ clangd/index/Background.cpp
@@ -484,7 +484,7 @@
   // Goes over each dependency.
   for (size_t CurrentDependency = 0; CurrentDependency < Dependencies.size();
        CurrentDependency++) {
-    llvm::StringRef CurDependencyPath = Dependencies[CurrentDependency].Path;
+    std::string CurDependencyPath = Dependencies[CurrentDependency].Path;
     // If we have already seen this shard before(either loaded or failed) don't
     // re-try again. Since the information in the shard won't change from one TU
     // to another.
@@ -504,11 +504,16 @@
     // These are the edges in the include graph for current dependency.
     for (const auto &I : *Shard->Sources) {
       auto U = URI::parse(I.getKey());
-      if (!U)
+      if (!U) {
+        elog("Failed to parse URI {0}: {1}", I.getKey(), U.takeError());
         continue;
+      }
       auto AbsolutePath = URI::resolve(*U, CurDependencyPath);
-      if (!AbsolutePath)
+      if (!AbsolutePath) {
+        elog("Failed to resolve URI {0}: {1}", I.getKey(),
+             AbsolutePath.takeError());
         continue;
+      }
       // Add file as dependency if haven't seen before.
       if (InQueue.try_emplace(*AbsolutePath).second)
         Dependencies.emplace_back(*AbsolutePath, true);
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to