X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2Fraw_ostream.h;h=34fbe082cda804178647039e0d00b9c30f6bd048;hb=c92330c18ce2f7015f0db88e4bfce3d253fa3c57;hp=a0f2c7798fb45118f6a587a9937f2b96de2e3a76;hpb=34bc6b6e787f27b5c9e05c82de4c1b4ac9b117bc;p=oota-llvm.git diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h index a0f2c7798fb..34fbe082cda 100644 --- a/include/llvm/Support/raw_ostream.h +++ b/include/llvm/Support/raw_ostream.h @@ -17,13 +17,18 @@ #include "llvm/ADT/StringRef.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/DataTypes.h" -#include "llvm/Support/FileSystem.h" namespace llvm { class format_object_base; template class SmallVectorImpl; + namespace sys { + namespace fs { + enum OpenFlags : unsigned; + } + } + /// raw_ostream - This class implements an extremely fast bulk output stream /// that can *only* output to a stream. It does not support seeking, reopening, /// rewinding, line buffered disciplines etc. It is a simple buffer that outputs @@ -157,7 +162,7 @@ public: size_t Size = Str.size(); // Make sure we can use the fast path. - if (OutBufCur+Size > OutBufEnd) + if (Size > (size_t)(OutBufEnd - OutBufCur)) return write(Str.data(), Size); memcpy(OutBufCur, Str.data(), Size);