diff options
author | Sam McCall <sam.mccall@gmail.com> | 2019-04-25 13:33:18 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2019-04-25 13:33:18 +0000 |
commit | 0fc09d0d25d4f7d1068a0940ca1f03aad73ab7ea (patch) | |
tree | 264bf155b0a32224fb2a09256c28ad1515187226 | |
parent | 98b0c910fb7ac707d66b44a6f5c2c615da8a7024 (diff) | |
download | bcm5719-llvm-0fc09d0d25d4f7d1068a0940ca1f03aad73ab7ea.tar.gz bcm5719-llvm-0fc09d0d25d4f7d1068a0940ca1f03aad73ab7ea.zip |
[Support] json::OStream::flush(), which passes through to the underlying stream
llvm-svn: 359190
-rw-r--r-- | llvm/include/llvm/Support/JSON.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h index ebda4e80f69..fb6a6d4e19a 100644 --- a/llvm/include/llvm/Support/JSON.h +++ b/llvm/include/llvm/Support/JSON.h @@ -751,7 +751,6 @@ public: class OStream { public: using Block = llvm::function_ref<void()>; - // OStream does not buffer internally, and need never be flushed or destroyed. // If IndentSize is nonzero, output is pretty-printed. explicit OStream(llvm::raw_ostream &OS, unsigned IndentSize = 0) : OS(OS), IndentSize(IndentSize) { @@ -763,6 +762,9 @@ class OStream { assert(Stack.back().HasValue && "Did not write top-level value"); } + /// Flushes the underlying ostream. OStream does not buffer internally. + void flush() { OS.flush(); } + // High level functions to output a value. // Valid at top-level (exactly once), in an attribute value (exactly once), // or in an array (any number of times). |