Mercurial > projects > ldc
diff gen/asmstmt.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 | ae710cba0884 |
children | 125c09006ac6 |
line wrap: on
line diff
--- a/gen/asmstmt.cpp Thu Feb 26 15:24:20 2009 +0100 +++ b/gen/asmstmt.cpp Thu Feb 26 14:51:02 2009 +0100 @@ -14,7 +14,6 @@ #include <cassert> #include <deque> -#include <iostream> #include <cstring> //#include "d-lang.h" @@ -260,7 +259,7 @@ break; case Arg_FrameRelative: // FIXME -std::cout << "asm fixme Arg_FrameRelative" << std::endl; +llvm::cout << "asm fixme Arg_FrameRelative" << std::endl; assert(0); /* if (arg->expr->op == TOKvar) arg_val = ((VarExp *) arg->expr)->var->toSymbol()->Stree; @@ -278,7 +277,7 @@ break;*/ case Arg_LocalSize: // FIXME -std::cout << "asm fixme Arg_LocalSize" << std::endl; +llvm::cout << "asm fixme Arg_LocalSize" << std::endl; assert(0); /* var_frame_offset = cfun->x_frame_offset; if (var_frame_offset < 0) @@ -711,7 +710,7 @@ Logger::cout() << "Arguments:" << '\n'; Logger::indent(); for (std::vector<LLValue*>::iterator b = args.begin(), i = b, e = args.end(); i != e; ++i) { - std::ostream& cout = Logger::cout(); + llvm::OStream cout = Logger::cout(); cout << '$' << (i - b) << " ==> " << **i; if (llvm::isa<LLConstant>(*i)) cout << '\n';