Skip to content

Commit 6515930

Browse files
authored
[lldb] Minor cleanup in StoringDiagnosticConsumer (#84263)
Removes an unused field. Retypes unshared smart pointers to `unique_ptr`.
1 parent a435e1f commit 6515930

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,11 @@ class StoringDiagnosticConsumer : public clang::DiagnosticConsumer {
6767
std::vector<IDAndDiagnostic> m_diagnostics;
6868
/// The DiagnosticPrinter used for creating the full diagnostic messages
6969
/// that are stored in m_diagnostics.
70-
std::shared_ptr<clang::TextDiagnosticPrinter> m_diag_printer;
70+
std::unique_ptr<clang::TextDiagnosticPrinter> m_diag_printer;
7171
/// Output stream of m_diag_printer.
72-
std::shared_ptr<llvm::raw_string_ostream> m_os;
72+
std::unique_ptr<llvm::raw_string_ostream> m_os;
7373
/// Output string filled by m_os. Will be reused for different diagnostics.
7474
std::string m_output;
75-
Log *m_log;
7675
/// A Progress with explicitly managed lifetime.
7776
std::unique_ptr<Progress> m_current_progress_up;
7877
std::vector<std::string> m_module_build_stack;
@@ -134,12 +133,10 @@ class ClangModulesDeclVendorImpl : public ClangModulesDeclVendor {
134133
} // anonymous namespace
135134

136135
StoringDiagnosticConsumer::StoringDiagnosticConsumer() {
137-
m_log = GetLog(LLDBLog::Expressions);
138-
139-
clang::DiagnosticOptions *m_options = new clang::DiagnosticOptions();
140-
m_os = std::make_shared<llvm::raw_string_ostream>(m_output);
136+
auto *options = new clang::DiagnosticOptions();
137+
m_os = std::make_unique<llvm::raw_string_ostream>(m_output);
141138
m_diag_printer =
142-
std::make_shared<clang::TextDiagnosticPrinter>(*m_os, m_options);
139+
std::make_unique<clang::TextDiagnosticPrinter>(*m_os, options);
143140
}
144141

145142
void StoringDiagnosticConsumer::HandleDiagnostic(

0 commit comments

Comments
 (0)