[llvm] r228890 - Revert "Change Path::filename_pos() to skip the drive letter."

Zachary Turner zturner at google.com
Wed Feb 11 16:05:49 PST 2015


Author: zturner
Date: Wed Feb 11 18:05:49 2015
New Revision: 228890

URL: http://llvm.org/viewvc/llvm-project?rev=228890&view=rev
Log:
Revert "Change Path::filename_pos() to skip the drive letter."

This reverts commit 228874.  For some reason users reported
seeing Clang taking up 25+GB of memory and bringing down
machines with this change.  Reverting until we figure it out.

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

Modified: llvm/trunk/lib/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Path.cpp?rev=228890&r1=228889&r2=228890&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Path.cpp (original)
+++ llvm/trunk/lib/Support/Path.cpp Wed Feb 11 18:05:49 2015
@@ -98,11 +98,8 @@ namespace {
     size_t pos = str.find_last_of(separators, str.size() - 1);
 
 #ifdef LLVM_ON_WIN32
-    if (pos == StringRef::npos) {
-      // Skip the drive letter, if one exists.
-      if (str.size() >= 2 && str[1] == ':')
-        pos = 2;
-    }
+    if (pos == StringRef::npos)
+      pos = str.find_last_of(':', str.size() - 2);
 #endif
 
     if (pos == StringRef::npos ||





More information about the llvm-commits mailing list