summaryrefslogtreecommitdiffstats
path: root/tools/llvm-ar
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-07-11 15:35:23 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-07-11 15:35:23 +0000
commit71857ccdb83b6374f7a791c2dae45ce9934a85af (patch)
tree0114117501240cf3ea150ef640d0c388fb07a1bc /tools/llvm-ar
parent11eb51e23935e22e1cb7b346c45713e8c9169c84 (diff)
downloadexternal_llvm-71857ccdb83b6374f7a791c2dae45ce9934a85af.zip
external_llvm-71857ccdb83b6374f7a791c2dae45ce9934a85af.tar.gz
external_llvm-71857ccdb83b6374f7a791c2dae45ce9934a85af.tar.bz2
Fix a FIXME about the format and add a test.
While at it, use strftime on Unix too and use the thread safe versions of localtime. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ar')
-rw-r--r--tools/llvm-ar/llvm-ar.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp
index 7b1dad0..6578bfc 100644
--- a/tools/llvm-ar/llvm-ar.cpp
+++ b/tools/llvm-ar/llvm-ar.cpp
@@ -325,17 +325,15 @@ doDisplayTable(std::string* ErrMsg) {
if (Paths.empty() ||
(std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) {
if (Verbose) {
- // FIXME: Output should be this format:
- // Zrw-r--r-- 500/ 500 525 Nov 8 17:42 2004 Makefile
- outs() << " ";
unsigned mode = I->getMode();
printMode((mode >> 6) & 007);
printMode((mode >> 3) & 007);
printMode(mode & 007);
- outs() << " " << format("%4u", I->getUser());
- outs() << "/" << format("%4u", I->getGroup());
- outs() << " " << format("%8u", I->getSize());
- outs() << " " << format("%20s", I->getModTime().str().substr(4).c_str());
+ outs() << ' ' << I->getUser();
+ outs() << "/" << I->getGroup();
+ outs() << ' ' << format("%6u", I->getSize());
+ sys::TimeValue ModTime = I->getModTime();
+ outs() << " " << ModTime.str();
outs() << " " << I->getPath().str() << "\n";
} else {
outs() << I->getPath().str() << "\n";