Mercurial > projects > ldc
comparison gen/linker.cpp @ 994:18ad5601dff7
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)
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Thu, 26 Feb 2009 14:51:02 +0100 |
parents | a8cb25d478c4 |
children | f756c47f310a |
comparison
equal
deleted
inserted
replaced
993:27956b440c0a | 994:18ad5601dff7 |
---|---|
331 fflush(stdout); | 331 fflush(stdout); |
332 } | 332 } |
333 | 333 |
334 Logger::println("Linking with: "); | 334 Logger::println("Linking with: "); |
335 std::vector<const char*>::const_iterator I = args.begin(), E = args.end(); | 335 std::vector<const char*>::const_iterator I = args.begin(), E = args.end(); |
336 std::ostream& logstr = Logger::cout(); | 336 llvm::OStream logstr = Logger::cout(); |
337 for (; I != E; ++I) | 337 for (; I != E; ++I) |
338 if (*I) | 338 if (*I) |
339 logstr << "'" << *I << "'" << " "; | 339 logstr << "'" << *I << "'" << " "; |
340 logstr << "\n" << std::flush; | 340 logstr << "\n" << std::flush; |
341 | 341 |