diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h --- a/lldb/include/lldb/Target/Target.h +++ b/lldb/include/lldb/Target/Target.h @@ -36,6 +36,8 @@ namespace lldb_private { +class ClangModulesDeclVendor; + OptionEnumValues GetDynamicValueTypes(); enum InlineStrategy { @@ -1302,7 +1304,7 @@ typedef std::map REPLMap; REPLMap m_repl_map; - lldb::ClangModulesDeclVendorUP m_clang_modules_decl_vendor_up; + std::unique_ptr m_clang_modules_decl_vendor_up; lldb::SourceManagerUP m_source_manager_up; diff --git a/lldb/include/lldb/lldb-forward.h b/lldb/include/lldb/lldb-forward.h --- a/lldb/include/lldb/lldb-forward.h +++ b/lldb/include/lldb/lldb-forward.h @@ -45,15 +45,6 @@ class Broadcaster; class BroadcasterManager; class CallFrameInfo; -class TypeSystemClang; -class ClangASTImporter; -class ClangASTMetadata; -class ClangASTSource; -class ClangExpressionDeclMap; -class ClangExpressionParser; -class ClangExpressionVariable; -class ClangModulesDeclVendor; -class ClangPersistentVariables; class CommandInterpreter; class CommandInterpreterRunOptions; class CommandObject; @@ -304,12 +295,6 @@ typedef std::shared_ptr BroadcasterSP; typedef std::shared_ptr BroadcasterManagerSP; typedef std::weak_ptr BroadcasterManagerWP; -typedef std::unique_ptr TypeSystemClangUP; -typedef std::shared_ptr ClangASTImporterSP; -typedef std::unique_ptr - ClangModulesDeclVendorUP; -typedef std::unique_ptr - ClangPersistentVariablesUP; typedef std::shared_ptr UserExpressionSP; typedef std::shared_ptr CommandObjectSP; typedef std::shared_ptr CommunicationSP; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h @@ -31,6 +31,9 @@ namespace lldb_private { +class ClangASTMetadata; +class TypeSystemClang; + class ClangASTImporter { public: struct LayoutInfo { diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h @@ -42,7 +42,7 @@ /// \param[in] importer /// The ClangASTImporter to use. ClangASTSource(const lldb::TargetSP &target, - const lldb::ClangASTImporterSP &importer); + const std::shared_ptr &importer); /// Destructor ~ClangASTSource() override; @@ -379,7 +379,7 @@ /// The file manager paired with the AST context. clang::FileManager *m_file_manager; /// The target's AST importer. - lldb::ClangASTImporterSP m_ast_importer_sp; + std::shared_ptr m_ast_importer_sp; std::set m_active_lexical_decls; std::set m_active_lookups; }; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -49,8 +49,9 @@ }; } -ClangASTSource::ClangASTSource(const lldb::TargetSP &target, - const lldb::ClangASTImporterSP &importer) +ClangASTSource::ClangASTSource( + const lldb::TargetSP &target, + const std::shared_ptr &importer) : m_import_in_progress(false), m_lookups_enabled(false), m_target(target), m_ast_context(nullptr), m_ast_importer_sp(importer), m_active_lexical_decls(), m_active_lookups() { diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h @@ -28,6 +28,8 @@ namespace lldb_private { +class ClangPersistentVariables; + /// \class ClangExpressionDeclMap ClangExpressionDeclMap.h /// "lldb/Expression/ClangExpressionDeclMap.h" Manages named entities that are /// defined in LLDB's debug information. @@ -78,8 +80,8 @@ ClangExpressionDeclMap( bool keep_result_in_memory, Materializer::PersistentVariableDelegate *result_delegate, - const lldb::TargetSP &target, const lldb::ClangASTImporterSP &importer, - ValueObject *ctx_obj); + const lldb::TargetSP &target, + const std::shared_ptr &importer, ValueObject *ctx_obj); /// Destructor ~ClangExpressionDeclMap() override; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp @@ -65,8 +65,8 @@ ClangExpressionDeclMap::ClangExpressionDeclMap( bool keep_result_in_memory, Materializer::PersistentVariableDelegate *result_delegate, - const lldb::TargetSP &target, const lldb::ClangASTImporterSP &importer, - ValueObject *ctx_obj) + const lldb::TargetSP &target, + const std::shared_ptr &importer, ValueObject *ctx_obj) : ClangASTSource(target, importer), m_found_entities(), m_struct_members(), m_keep_result_in_memory(keep_result_in_memory), m_result_delegate(result_delegate), m_ctx_obj(ctx_obj), m_parser_vars(), diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h @@ -23,6 +23,7 @@ namespace lldb_private { +class ClangExpressionDeclMap; class RecordingMemoryManager; // ClangExpressionHelper diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h @@ -31,6 +31,7 @@ namespace lldb_private { class IRExecutionUnit; +class TypeSystemClang; /// \class ClangExpressionParser ClangExpressionParser.h /// "lldb/Expression/ClangExpressionParser.h" Encapsulates an instance of diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h @@ -18,6 +18,9 @@ namespace lldb_private { +class ClangASTImporter; +class TypeSystemClang; + /// \class ClangPersistentVariables ClangPersistentVariables.h /// "lldb/Expression/ClangPersistentVariables.h" Manages persistent values /// that need to be preserved between expression invocations. @@ -36,7 +39,7 @@ return pv->getKind() == PersistentExpressionState::eKindClang; } - lldb::ClangASTImporterSP GetClangASTImporter(); + std::shared_ptr GetClangASTImporter(); lldb::ExpressionVariableSP CreatePersistentVariable(const lldb::ValueObjectSP &valobj_sp) override; @@ -98,7 +101,7 @@ m_hand_loaded_clang_modules; ///< These are Clang modules we hand-loaded; ///these are the highest- ///< priority source for macros. - lldb::ClangASTImporterSP m_ast_importer_sp; + std::shared_ptr m_ast_importer_sp; }; } // namespace lldb_private diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp @@ -101,7 +101,8 @@ return m_persistent_decls.lookup(name.GetCString()).m_decl; } -lldb::ClangASTImporterSP ClangPersistentVariables::GetClangASTImporter() { +std::shared_ptr +ClangPersistentVariables::GetClangASTImporter() { if (!m_ast_importer_sp) { m_ast_importer_sp = std::make_shared(); } diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp @@ -896,7 +896,7 @@ Materializer::PersistentVariableDelegate &delegate, bool keep_result_in_memory, ValueObject *ctx_obj) { - lldb::ClangASTImporterSP ast_importer; + std::shared_ptr ast_importer; auto *state = exe_ctx.GetTargetSP()->GetPersistentExpressionStateForLanguage( lldb::eLanguageTypeC); if (state) { diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp @@ -160,7 +160,7 @@ void ClangUtilityFunction::ClangUtilityFunctionHelper::ResetDeclMap( ExecutionContext &exe_ctx, bool keep_result_in_memory) { - lldb::ClangASTImporterSP ast_importer; + std::shared_ptr ast_importer; auto *state = exe_ctx.GetTargetSP()->GetPersistentExpressionStateForLanguage( lldb::eLanguageTypeC); if (state) { diff --git a/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp b/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp --- a/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp @@ -56,7 +56,7 @@ return; } - lldb::ClangASTImporterSP clang_ast_importer; + std::shared_ptr clang_ast_importer; auto *state = target_sp->GetPersistentExpressionStateForLanguage( lldb::eLanguageTypeC_plus_plus); if (state) { diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h b/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h --- a/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h @@ -28,6 +28,7 @@ namespace lldb_private { +class TypeSystemClang; class UtilityFunction; class ObjCLanguageRuntime : public LanguageRuntime { diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h @@ -41,6 +41,8 @@ namespace lldb_private { +class ClangASTMetadata; +class ClangASTSource; class Declaration; class TypeSystemClang : public TypeSystem { diff --git a/lldb/unittests/Expression/ClangExpressionDeclMapTest.cpp b/lldb/unittests/Expression/ClangExpressionDeclMapTest.cpp --- a/lldb/unittests/Expression/ClangExpressionDeclMapTest.cpp +++ b/lldb/unittests/Expression/ClangExpressionDeclMapTest.cpp @@ -21,7 +21,7 @@ namespace { struct FakeClangExpressionDeclMap : public ClangExpressionDeclMap { - FakeClangExpressionDeclMap(const ClangASTImporterSP &importer) + FakeClangExpressionDeclMap(const std::shared_ptr &importer) : ClangExpressionDeclMap(false, nullptr, lldb::TargetSP(), importer, nullptr) { m_scratch_context = clang_utils::createAST(); @@ -58,7 +58,7 @@ SubsystemRAII subsystems; /// The ClangASTImporter used during the test. - ClangASTImporterSP importer; + std::shared_ptr importer; /// The ExpressionDeclMap for the current test case. std::unique_ptr decl_map;