convert llvm-ar and llvm-ranlib to raw_ostream from iostreams.
[oota-llvm.git] / tools / llvm-ranlib / llvm-ranlib.cpp
index 5ee762a4cdf8f86f778b8dc5ad31a790124a7479..7f94c2413dbf442927424abc9fcee81e340d775b 100644 (file)
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/PrettyStackTrace.h"
+#include "llvm/Support/Format.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/Signals.h"
-#include <iostream>
-#include <iomanip>
 #include <memory>
-
 using namespace llvm;
 
 // llvm-ar operation code and modifier flags
@@ -35,12 +33,12 @@ Verbose("verbose",cl::Optional,cl::init(false),
 
 // printSymbolTable - print out the archive's symbol table.
 void printSymbolTable(Archive* TheArchive) {
-  std::cout << "\nArchive Symbol Table:\n";
+  outs() << "\nArchive Symbol Table:\n";
   const Archive::SymTabType& symtab = TheArchive->getSymbolTable();
   for (Archive::SymTabType::const_iterator I=symtab.begin(), E=symtab.end();
        I != E; ++I ) {
     unsigned offset = TheArchive->getFirstFileOffset() + I->second;
-    std::cout << " " << std::setw(9) << offset << "\t" << I->first <<"\n";
+    outs() << " " << format("%9u", offset) << "\t" << I->first <<"\n";
   }
 }