diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-08-29 20:17:13 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-08-29 20:17:13 +0000 |
commit | eb62b822e343d18a7ff325eedeb3b13b6a9e3b7e (patch) | |
tree | 9ecd639023c40cb00ec85b9ebf8e7525655cddca /clang/lib/Frontend/SerializedDiagnosticPrinter.cpp | |
parent | 352237dbb6d17cbce5dd1a23d8c2e3c2c95d8106 (diff) | |
download | bcm5719-llvm-eb62b822e343d18a7ff325eedeb3b13b6a9e3b7e.tar.gz bcm5719-llvm-eb62b822e343d18a7ff325eedeb3b13b6a9e3b7e.zip |
unique_ptrify the raw_ostream argument to clang::serialized_diags::create
llvm-svn: 216767
Diffstat (limited to 'clang/lib/Frontend/SerializedDiagnosticPrinter.cpp')
-rw-r--r-- | clang/lib/Frontend/SerializedDiagnosticPrinter.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp index 29c58a8ac34..66b3333524d 100644 --- a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp @@ -96,10 +96,9 @@ class SDiagsWriter : public DiagnosticConsumer { : LangOpts(nullptr), OriginalInstance(false), State(State) {} public: - SDiagsWriter(raw_ostream *os, DiagnosticOptions *diags) - : LangOpts(nullptr), OriginalInstance(true), - State(new SharedState(os, diags)) - { + SDiagsWriter(std::unique_ptr<raw_ostream> os, DiagnosticOptions *diags) + : LangOpts(nullptr), OriginalInstance(true), + State(new SharedState(std::move(os), diags)) { EmitPreamble(); } @@ -187,8 +186,9 @@ private: /// \brief State that is shared among the various clones of this diagnostic /// consumer. struct SharedState : RefCountedBase<SharedState> { - SharedState(raw_ostream *os, DiagnosticOptions *diags) - : DiagOpts(diags), Stream(Buffer), OS(os), EmittedAnyDiagBlocks(false) { } + SharedState(std::unique_ptr<raw_ostream> os, DiagnosticOptions *diags) + : DiagOpts(diags), Stream(Buffer), OS(std::move(os)), + EmittedAnyDiagBlocks(false) {} /// \brief Diagnostic options. IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts; @@ -236,8 +236,9 @@ private: namespace clang { namespace serialized_diags { -DiagnosticConsumer *create(raw_ostream *OS, DiagnosticOptions *diags) { - return new SDiagsWriter(OS, diags); +DiagnosticConsumer *create(std::unique_ptr<raw_ostream> OS, + DiagnosticOptions *diags) { + return new SDiagsWriter(std::move(OS), diags); } } // end namespace serialized_diags } // end namespace clang |