namespace llvm {
+ /// FlushStream - Function called by BaseStream to flush an ostream.
+ void FlushStream(std::ostream &S);
+
/// BaseStream - Acts like the STL streams. It's a wrapper for the std::cerr,
/// std::cout, std::cin, etc. streams. However, it doesn't require #including
/// @verbatim <iostream> @endverbatm in every file (doing so increases static
return *this;
}
+ void flush() {
+ if (Stream)
+ FlushStream(*Stream);
+ }
+
template <typename Ty>
BaseStream &operator << (const Ty &Thing) {
if (Stream) *Stream << Thing;
OStream llvm::cout(std::cout);
OStream llvm::cerr(std::cerr);
IStream llvm::cin(std::cin);
+
+namespace llvm {
+
+/// FlushStream - Function called by BaseStream to flush an ostream.
+void FlushStream(std::ostream &S) {
+ S << std::flush;
+}
+
+} // end anonymous namespace
//===----------------------------------------------------------------------===//
#include <llvm/Config/config.h>
+#include <llvm/Support/Streams.h>
#include "Unix.h"
-#include <iostream>
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
}
// Make sure stderr and stdout have been flushed
- std::cerr << std::flush;
- std::cout << std::flush;
+ cerr.flush();
+ cout.flush();
fsync(1);
fsync(2);
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Compiler.h"
-#include <iostream>
#include <queue>
#include <set>
#include "SPUTargetMachine.h"
#include "SPUGenInstrInfo.inc"
#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include <iostream>
+#include "llvm/Support/Streams.h"
using namespace llvm;
BuildMI(MBB, MI, get(SPU::ORv4i32), DestReg).addReg(SrcReg)
.addReg(SrcReg);
} else {
- std::cerr << "Attempt to copy unknown/unsupported register class!\n";
+ cerr << "Attempt to copy unknown/unsupported register class!\n";
abort();
}
}
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/STLExtras.h"
#include <cstdlib>
-#include <iostream>
using namespace llvm;
case SPU::R126: return 126;
case SPU::R127: return 127;
default:
- std::cerr << "Unhandled reg in SPURegisterInfo::getRegisterNumbering!\n";
+ cerr << "Unhandled reg in SPURegisterInfo::getRegisterNumbering!\n";
abort();
}
}