[PATCH] D44960: Prevent llvm-cov from hanging when a symblink doesn't exist.

Yuke Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 29 14:33:25 PDT 2018


liaoyuke added a comment.

Of course! I'll look at it later, sorry about the inconvenience.



================
Comment at: include/llvm/Support/FileSystem.h:959
         *State, path.toStringRef(path_storage), FollowSymlinks);
+    if (!ec)
+      check_current_entry(ec);
----------------
vsk wrote:
> Why not sink the "!ec" test into check_current_entry?
Good idea!


================
Comment at: unittests/Support/Path.cpp:914
+    std::string CurrentFileName = path::filename(i->path());
+    if (std::find(NamesOfBrokenSymlinks.begin(), NamesOfBrokenSymlinks.end(),
+                  CurrentFileName) == NamesOfBrokenSymlinks.end()) {
----------------
vsk wrote:
> You can just write: "find(NamesOfBrokenSymlinks, CurrentFileName)". LLVM defines range-based algorithms in llvm/ADT/STLExtras.h.
This is definitely more concise, thanks for letting me know!


Repository:
  rL LLVM

https://reviews.llvm.org/D44960





More information about the llvm-commits mailing list