summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llvm-ar/llvm-ar.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp
index 99dc7fdd6d7..0119ec502e5 100644
--- a/llvm/tools/llvm-ar/llvm-ar.cpp
+++ b/llvm/tools/llvm-ar/llvm-ar.cpp
@@ -429,8 +429,9 @@ static void doDisplayTable(StringRef Name, const object::Archive::Child &C) {
}
if (C.getParent()->isThin()) {
- outs() << sys::path::parent_path(ArchiveName);
- outs() << '/';
+ StringRef ParentDir = sys::path::parent_path(ArchiveName);
+ if (!ParentDir.empty())
+ outs() << ParentDir << '/';
}
outs() << Name << "\n";
}
OpenPOWER on IntegriCloud