llvm-ar: Don't write the directory in the string table.

We were already doing the right thing for short file names, but not long
ones.

llvm-svn: 242354
diff --git a/llvm/lib/Object/ArchiveWriter.cpp b/llvm/lib/Object/ArchiveWriter.cpp
index bd372c3..fd06c6e 100644
--- a/llvm/lib/Object/ArchiveWriter.cpp
+++ b/llvm/lib/Object/ArchiveWriter.cpp
@@ -160,7 +160,7 @@
                              bool Thin) {
   unsigned StartOffset = 0;
   for (const NewArchiveIterator &I : Members) {
-    StringRef Name = I.getName();
+    StringRef Name = sys::path::filename(I.getName());
     if (!useStringTable(Thin, Name))
       continue;
     if (StartOffset == 0) {