convert llvm-ar and llvm-ranlib to raw_ostream from iostreams.

Patch by Danil Malyshev!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120341 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-11-29 23:02:20 +00:00
parent 75579f739f
commit 424a04ec4e
2 changed files with 23 additions and 26 deletions

View File

@ -17,12 +17,10 @@
#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";
}
}