]> granicus.if.org Git - clang/commitdiff
Driver: Simplify a use of the path API
authorJustin Bogner <mail@justinbogner.com>
Sun, 3 Aug 2014 21:46:33 +0000 (21:46 +0000)
committerJustin Bogner <mail@justinbogner.com>
Sun, 3 Aug 2014 21:46:33 +0000 (21:46 +0000)
It's a bit more obvious what's going on if we use path::filename
rather than decrementing an iterator here.

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

lib/Driver/Multilib.cpp

index 484ce1627d7bb73502f3948da7e4d1756a69d7e5..1f5d62f247c466ade4482bc1e7446ab033c84408 100644 (file)
@@ -37,7 +37,7 @@ static void normalizePathSegment(std::string &Segment) {
 
   // Prune trailing "/" or "./"
   while (1) {
-    StringRef last = *--path::end(seg);
+    StringRef last = path::filename(seg);
     if (last != ".")
       break;
     seg = path::parent_path(seg);