[Lldb-commits] [PATCH] D45977: Always normalize FileSpec paths.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 26 08:54:00 PDT 2018

labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Looks fine to me. Normalization, at least as it is implemented now in `remove_dots`, is a fairly heavy operation, so it makes sense to avoid it when possible. And the extra speedup is great.

Comment at: source/Utility/FileSpec.cpp:203
+namespace {
these can be just static functions. No need for a namespace.

Comment at: unittests/Utility/FileSpecTest.cpp:236-237
+      {R"(.)", R"()"},
+      // TODO: fix llvm::sys::path::remove_dots() to return "c:\" below.
+      {R"(c:..\..)", R"(c:\..\..)"},
       {R"(..\..)", R"(..\..)"},
Neither the present behavior, nor `c:\` is correct here. `c:..\..` is a path relative to the current directory on the C drive, `C:\` is the root of the C drive, and `c:\..\..` is equivalent to `c:\`. However, it seems nobody cares about corner cases like this, as there are bunch of them in the llvm path handling.


More information about the lldb-commits mailing list