//===-- Debug.cpp - An easy way to add debug output to your code ----------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements a handle way of adding debugging information to your
//
//===----------------------------------------------------------------------===//
-#include "Support/Debug.h"
-#include "Support/CommandLine.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Debug.h"
using namespace llvm;
bool llvm::DebugFlag; // DebugFlag - Exported boolean set by the -debug option
return false;
#endif
}
+
+// getErrorOutputStream - Returns the error output stream (std::cerr). This
+// places the std::c* I/O streams into one .cpp file and relieves the whole
+// program from having to have hundreds of static c'tor/d'tors for them.
+//
+OStream &llvm::getErrorOutputStream(const char *DebugType) {
+ static OStream cnoout(0);
+ if (DebugFlag && isCurrentDebugType(DebugType))
+ return cerr;
+ else
+ return cnoout;
+}