Use LLVM OStream wrapper instead of <iostream> in the logger.

llvm::OStream provides all std::ostream functionality (by holding a
std::ostream* internally), but
 * doesn't include <iostream>, avoiding per-file overhead.
 * allows the stream pointer to be null, and the (inlined) operators do nothing
   when that's the case. (This also allows removal of the ofstream("/dev/null")
   hack Logger used when disabled, which presumably wasn't very portable)
This commit is contained in:
Frits van Bommel
2009-02-26 14:51:02 +01:00
parent 58a8711bc1
commit e37c82d1ec
10 changed files with 19 additions and 25 deletions

View File

@@ -333,7 +333,7 @@ int linkObjToExecutable(const char* argv0)
Logger::println("Linking with: ");
std::vector<const char*>::const_iterator I = args.begin(), E = args.end();
std::ostream& logstr = Logger::cout();
llvm::OStream logstr = Logger::cout();
for (; I != E; ++I)
if (*I)
logstr << "'" << *I << "'" << " ";