summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-04-09 15:54:59 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-04-09 15:54:59 +0000
commitee0dd4d289cf2a6dcc2de13866ccee4016ee87c0 (patch)
tree76456bc97212cf44bd85e4b9028031a612cd68db /llvm/lib/Support
parent007435c1b7bdc296d935d5514f5d4cf7feb9604c (diff)
downloadbcm5719-llvm-ee0dd4d289cf2a6dcc2de13866ccee4016ee87c0.tar.gz
bcm5719-llvm-ee0dd4d289cf2a6dcc2de13866ccee4016ee87c0.zip
This reverts commit r234460 and r234461.
Revert "Add classof implementations to the raw_ostream classes." Revert "Use the cast machinery to remove dummy uses of formatted_raw_ostream." The underlying issue can be fixed without classof. llvm-svn: 234495
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Debug.cpp5
-rw-r--r--llvm/lib/Support/raw_ostream.cpp9
2 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Support/Debug.cpp b/llvm/lib/Support/Debug.cpp
index 896898c185c..a88b18e6c06 100644
--- a/llvm/lib/Support/Debug.cpp
+++ b/llvm/lib/Support/Debug.cpp
@@ -114,8 +114,9 @@ static void debug_user_sig_handler(void *Cookie) {
// know that debug mode is enabled and dbgs() really is a
// circular_raw_ostream. If NDEBUG is defined, then dbgs() ==
// errs() but this will never be invoked.
- llvm::circular_raw_ostream &dbgout = cast<circular_raw_ostream>(llvm::dbgs());
- dbgout.flushBufferWithBanner();
+ llvm::circular_raw_ostream *dbgout =
+ static_cast<llvm::circular_raw_ostream *>(&llvm::dbgs());
+ dbgout->flushBufferWithBanner();
}
/// dbgs - Return a circular-buffered debug stream.
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index a312126fffe..051e2dd252f 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -489,7 +489,7 @@ void format_object_base::home() {
raw_fd_ostream::raw_fd_ostream(StringRef Filename, std::error_code &EC,
sys::fs::OpenFlags Flags)
- : raw_ostream(SK_FD), Error(false), UseAtomicWrites(false), pos(0) {
+ : Error(false), UseAtomicWrites(false), pos(0) {
EC = std::error_code();
// Handle "-" as stdout. Note that when we do this, we consider ourself
// the owner of stdout. This means that we can do things like close the
@@ -519,8 +519,8 @@ raw_fd_ostream::raw_fd_ostream(StringRef Filename, std::error_code &EC,
/// raw_fd_ostream ctor - FD is the file descriptor that this writes to. If
/// ShouldClose is true, this closes the file when the stream is destroyed.
raw_fd_ostream::raw_fd_ostream(int fd, bool shouldClose, bool unbuffered)
- : raw_ostream(SK_FD, unbuffered), FD(fd), ShouldClose(shouldClose),
- Error(false), UseAtomicWrites(false) {
+ : raw_ostream(unbuffered), FD(fd),
+ ShouldClose(shouldClose), Error(false), UseAtomicWrites(false) {
#ifdef O_BINARY
// Setting STDOUT to binary mode is necessary in Win32
// to avoid undesirable linefeed conversion.
@@ -749,8 +749,7 @@ void raw_string_ostream::write_impl(const char *Ptr, size_t Size) {
// capacity. This allows raw_ostream to write directly into the correct place,
// and we only need to set the vector size when the data is flushed.
-raw_svector_ostream::raw_svector_ostream(SmallVectorImpl<char> &O)
- : raw_ostream(SK_SVECTOR), OS(O) {
+raw_svector_ostream::raw_svector_ostream(SmallVectorImpl<char> &O) : OS(O) {
// Set up the initial external buffer. We make sure that the buffer has at
// least 128 bytes free; raw_ostream itself only requires 64, but we want to
// make sure that we don't grow the buffer unnecessarily on destruction (when
OpenPOWER on IntegriCloud