[llvm] r332555 - Revert 332508 as it caused problems in the clang test suite.

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Wed May 16 16:29:36 PDT 2018


Author: gclayton
Date: Wed May 16 16:29:36 2018
New Revision: 332555

URL: http://llvm.org/viewvc/llvm-project?rev=332555&view=rev
Log:
Revert 332508 as it caused problems in the clang test suite.


Modified:
    llvm/trunk/lib/Support/Path.cpp
    llvm/trunk/unittests/Support/Path.cpp

Modified: llvm/trunk/lib/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Path.cpp?rev=332555&r1=332554&r2=332555&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Path.cpp (original)
+++ llvm/trunk/lib/Support/Path.cpp Wed May 16 16:29:36 2018
@@ -726,10 +726,6 @@ static SmallString<256> remove_dots(Stri
   SmallString<256> buffer = path::root_path(path, style);
   for (StringRef C : components)
     path::append(buffer, style, C);
-  // If the buffer is empty, then return ".". Many other path utilities
-  // do this so it seems to be an expected result.
-  if (buffer.empty())
-    buffer.append(1, '.');
   return buffer;
 }
 

Modified: llvm/trunk/unittests/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/Path.cpp?rev=332555&r1=332554&r2=332555&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/Path.cpp (original)
+++ llvm/trunk/unittests/Support/Path.cpp Wed May 16 16:29:36 2018
@@ -1146,7 +1146,7 @@ static std::string remove_dots(StringRef
 TEST(Support, RemoveDots) {
   EXPECT_EQ("foolz\\wat",
             remove_dots(".\\.\\\\foolz\\wat", false, path::Style::windows));
-  EXPECT_EQ(".", remove_dots(".\\\\\\\\\\", false, path::Style::windows));
+  EXPECT_EQ("", remove_dots(".\\\\\\\\\\", false, path::Style::windows));
 
   EXPECT_EQ("a\\..\\b\\c",
             remove_dots(".\\a\\..\\b\\c", false, path::Style::windows));
@@ -1163,8 +1163,7 @@ TEST(Support, RemoveDots) {
 
   EXPECT_EQ("foolz/wat",
             remove_dots("././/foolz/wat", false, path::Style::posix));
-  EXPECT_EQ(".", remove_dots("./////", false, path::Style::posix));
-  EXPECT_EQ(".", remove_dots("", false, path::Style::posix));
+  EXPECT_EQ("", remove_dots("./////", false, path::Style::posix));
 
   EXPECT_EQ("a/../b/c", remove_dots("./a/../b/c", false, path::Style::posix));
   EXPECT_EQ("b/c", remove_dots("./a/../b/c", true, path::Style::posix));




More information about the llvm-commits mailing list