Author: teemperor Date: Wed Oct 2 05:38:04 2019 New Revision: 373460 URL: http://llvm.org/viewvc/llvm-project?rev=373460&view=rev Log: [lldb][NFC] Remove ClangASTContext::Clear
We now only use this function directly after initialization. As Clear() resets the ASTContext back to its initial state, this is just a no-op. There are no other users for this and we no longer can set the ASTContext after construction, so Clear has no useful purpose anymore. It's also mostly copy-pasted from Finalize(). Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=373460&r1=373459&r2=373460&view=diff ============================================================================== --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Wed Oct 2 05:38:04 2019 @@ -111,8 +111,6 @@ public: void setSema(clang::Sema *s); clang::Sema *getSema() { return m_sema; } - void Clear(); - const char *GetTargetTriple(); void SetExternalSource( Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=373460&r1=373459&r2=373460&view=diff ============================================================================== --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed Oct 2 05:38:04 2019 @@ -660,18 +660,6 @@ void ClangASTContext::Finalize() { m_scratch_ast_source_up.reset(); } -void ClangASTContext::Clear() { - m_language_options_up.reset(); - m_source_manager_up.reset(); - m_diagnostics_engine_up.reset(); - m_target_options_rp.reset(); - m_target_info_up.reset(); - m_identifier_table_up.reset(); - m_selector_table_up.reset(); - m_builtins_up.reset(); - m_pointer_byte_size = 0; -} - void ClangASTContext::setSema(Sema *s) { // Ensure that the new sema actually belongs to our ASTContext. assert(s == nullptr || &s->getASTContext() == m_ast_up.get()); @@ -683,7 +671,6 @@ const char *ClangASTContext::GetTargetTr } void ClangASTContext::SetTargetTriple(llvm::StringRef target_triple) { - Clear(); m_target_triple = target_triple.str(); } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits