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

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 23 14:37:44 PDT 2018


aprantl added inline comments.


================
Comment at: source/Utility/FileSpec.cpp:107
+  for (auto i = path.find('/'); i != llvm::StringRef::npos;
+       i = path.find('/', i + 1)) {
+    const auto nextChar = safeCharAtIndex(path, i+1);
----------------
clayborg wrote:
> no as the only caller to this function switches the slashes to '/' already..
If we change that to also replace double-`/` with singles, we could replace this function with a call to llvm::sys::path::remove_dots()

http://llvm.org/doxygen/namespacellvm_1_1sys_1_1path.html#a35c103b5fb70a66a1cb5da3b56f588a1


================
Comment at: source/Utility/FileSpec.cpp:115
+      case '/':
+        // "//" in the middle of a path needs to be normalized
+        if (i > 0)
----------------
Does this also turn "//WORKGROUP/Foo" into "/WORKGROUP/Foo/"?


https://reviews.llvm.org/D45977





More information about the lldb-commits mailing list