r291167 - Move SerializedDiagnosticPrinter's SharedState to std::shared_ptr rather than IntrusiveRefCntPtr
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 5 11:48:10 PST 2017
Author: dblaikie
Date: Thu Jan 5 13:48:10 2017
New Revision: 291167
URL: http://llvm.org/viewvc/llvm-project?rev=291167&view=rev
Log:
Move SerializedDiagnosticPrinter's SharedState to std::shared_ptr rather than IntrusiveRefCntPtr
Modified:
cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp
Modified: cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp?rev=291167&r1=291166&r2=291167&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp (original)
+++ cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp Thu Jan 5 13:48:10 2017
@@ -143,7 +143,7 @@ class SDiagsWriter : public DiagnosticCo
struct SharedState;
- explicit SDiagsWriter(IntrusiveRefCntPtr<SharedState> State)
+ explicit SDiagsWriter(std::shared_ptr<SharedState> State)
: LangOpts(nullptr), OriginalInstance(false), MergeChildRecords(false),
State(std::move(State)) {}
@@ -151,7 +151,7 @@ public:
SDiagsWriter(StringRef File, DiagnosticOptions *Diags, bool MergeChildRecords)
: LangOpts(nullptr), OriginalInstance(true),
MergeChildRecords(MergeChildRecords),
- State(new SharedState(File, Diags)) {
+ State(std::make_shared<SharedState>(File, Diags)) {
if (MergeChildRecords)
RemoveOldDiagnostics();
EmitPreamble();
@@ -251,7 +251,7 @@ private:
/// \brief State that is shared among the various clones of this diagnostic
/// consumer.
- struct SharedState : RefCountedBase<SharedState> {
+ struct SharedState {
SharedState(StringRef File, DiagnosticOptions *Diags)
: DiagOpts(Diags), Stream(Buffer), OutputFile(File.str()),
EmittedAnyDiagBlocks(false) {}
@@ -299,7 +299,7 @@ private:
};
/// \brief State shared among the various clones of this diagnostic consumer.
- IntrusiveRefCntPtr<SharedState> State;
+ std::shared_ptr<SharedState> State;
};
} // end anonymous namespace
More information about the cfe-commits
mailing list