[PATCH] D14393: Moving FileManager::removeDotPaths to llvm::sys::path::remove_dots

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 19:46:58 PST 2015


silvas added a subscriber: silvas.

================
Comment at: lib/Support/Path.cpp:664
@@ -663,3 +663,1 @@
 
-StringRef remove_leading_dotslash(StringRef Path) {
-  // Remove leading "./" (or ".//" or "././" etc.)
----------------
Why remove this function?

================
Comment at: lib/Support/Path.cpp:691
@@ +690,3 @@
+
+  std::string result = remove_dots(p, remove_dot_dot);
+  if (result == p)
----------------
Can you implement the std::string version in terms of the SmallVectorImpl version? In the "small" case the version currently in clang does no heap allocation. It would be a shame to unnecessarily start doing heap allocation for this.


http://reviews.llvm.org/D14393





More information about the llvm-commits mailing list