Revert "Change Path::filename_pos() to skip the drive letter."
authorZachary Turner <zturner@google.com>
Thu, 12 Feb 2015 00:05:49 +0000 (00:05 +0000)
committerZachary Turner <zturner@google.com>
Thu, 12 Feb 2015 00:05:49 +0000 (00:05 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228890 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Path.cpp

index 3e0a4f5aab97466b412bf3fb83f23b1a25ff2ec6..abec7b9dd221e135bacf6ffc2abd5f61847bd5e8 100644 (file)
@@ -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 ||