From 2e270984a084e716365f1f66c31e948e83a86b44 Mon Sep 17 00:00:00 2001 From: Alex Langford Date: Wed, 22 Jan 2020 14:49:03 -0800 Subject: [PATCH 1/4] [lldb] Adjust to changes in SILModule::print This changed in commit f6643af65083dc311c4ad9b50732fd8299ce1d11 in the swift project. --- .../ExpressionParser/Swift/SwiftExpressionParser.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp index fed4a3e3029e0..3129c9ea97bcf 100644 --- a/lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp +++ b/lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp @@ -1651,8 +1651,7 @@ unsigned SwiftExpressionParser::Parse(DiagnosticManager &diagnostic_manager, if (log) { std::string s; llvm::raw_string_ostream ss(s); - const bool verbose = false; - sil_module->print(ss, verbose, &parsed_expr->module); + sil_module->print(ss, &parsed_expr->module); ss.flush(); log->Printf("SIL module before linking:"); @@ -1667,8 +1666,7 @@ unsigned SwiftExpressionParser::Parse(DiagnosticManager &diagnostic_manager, if (log) { std::string s; llvm::raw_string_ostream ss(s); - const bool verbose = false; - sil_module->print(ss, verbose, &parsed_expr->module); + sil_module->print(ss, &parsed_expr->module); ss.flush(); log->Printf("Generated SIL module:"); @@ -1681,8 +1679,7 @@ unsigned SwiftExpressionParser::Parse(DiagnosticManager &diagnostic_manager, if (log) { std::string s; llvm::raw_string_ostream ss(s); - const bool verbose = false; - sil_module->print(ss, verbose, &parsed_expr->module); + sil_module->print(ss, &parsed_expr->module); ss.flush(); log->Printf("SIL module after diagnostic passes:"); From 1900a4b827038e5b85b911c8f484b163020ef831 Mon Sep 17 00:00:00 2001 From: Alex Langford Date: Wed, 22 Jan 2020 14:52:28 -0800 Subject: [PATCH 2/4] [lldb] Remove function SymbolFileDWARF::GetSymlinkPaths This appeared to be removed in commit 27df2d9f556c3199601ecd1f15c1b37cd49ed9df, so most likely this was the result of a mismerge --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index d04075dceb42d..ced01bcd8d70c 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -220,10 +220,6 @@ ParseSupportFilesFromPrologue(const lldb::ModuleSP &module, return support_files; } -FileSpecList SymbolFileDWARF::GetSymlinkPaths() { - return GetGlobalPluginProperties()->GetSymLinkPaths(); -} - static inline bool IsSwiftLanguage(LanguageType language) { return language == eLanguageTypePLI || language == eLanguageTypeSwift || ((uint32_t)language == (uint32_t)llvm::dwarf::DW_LANG_Swift); From 8ba776b253489752ae18fdb0ff10bcd457e42171 Mon Sep 17 00:00:00 2001 From: Alex Langford Date: Wed, 22 Jan 2020 14:55:23 -0800 Subject: [PATCH 3/4] [lldb] Adjust to changes in ClangASTContext constructor Commit c9a39a896c95402ede07061380346c725556e308 modified the constructor. I'm not entirely sure what name we should be giving here, but this code isn't in llvm.org so I gave it something I thought would be reflective of the intention. --- lldb/source/Symbol/ClangASTContext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 636a854771ef3..67722b0ee6367 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -722,7 +722,8 @@ void ClangASTContext::CreateASTContext() { ClangASTContext *ClangASTContext::GetASTContext(clang::ASTContext *ast) { ClangASTContext *clang_ast = GetASTMap().Lookup(ast); if (!clang_ast) - clang_ast = new ClangASTContext(*ast); + clang_ast = new ClangASTContext( + "ASTContext from ClangASTContext::GetASTContext", *ast); return clang_ast; } From 12401295ba69fb42e63496587ac8e959717e8a05 Mon Sep 17 00:00:00 2001 From: Alex Langford Date: Wed, 22 Jan 2020 15:02:12 -0800 Subject: [PATCH 4/4] [lldb] Adjust for implicitly-deleted copy constructor of ModuleListProperties GetGlobalModuleListProperties() returns a ModuleListProperties, but that class has an implicitly deleted copy constructor. Therefore we should be grabbing a reference to the ModuleListProperties. Additionally, the uses I noticed in SwiftASTContext can be made const. --- lldb/source/Symbol/SwiftASTContext.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lldb/source/Symbol/SwiftASTContext.cpp b/lldb/source/Symbol/SwiftASTContext.cpp index 71cb9af575ca3..d5acb5797180e 100644 --- a/lldb/source/Symbol/SwiftASTContext.cpp +++ b/lldb/source/Symbol/SwiftASTContext.cpp @@ -841,7 +841,7 @@ static bool IsDeviceSupport(const char *path) { static std::string GetClangModulesCacheProperty() { llvm::SmallString<128> path; - auto props = ModuleList::GetGlobalModuleListProperties(); + const auto &props = ModuleList::GetGlobalModuleListProperties(); props.GetClangModulesCachePath().GetPath(path); return path.str(); } @@ -2690,7 +2690,7 @@ swift::ClangImporterOptions &SwiftASTContext::GetClangImporterOptions() { // Set the Clang module search path. llvm::SmallString<128> path; - auto props = ModuleList::GetGlobalModuleListProperties(); + const auto &props = ModuleList::GetGlobalModuleListProperties(); props.GetClangModulesCachePath().GetPath(path); clang_importer_options.ModuleCachePath = path.str(); @@ -3423,7 +3423,7 @@ swift::ASTContext *SwiftASTContext::GetASTContext() { if (!m_ast_context_ap->SearchPathOpts.SDKPath.empty() || TargetHasNoSDK()) { if (!clang_importer_options.OverrideResourceDir.empty()) { // Create the DWARFImporterDelegate. - auto props = ModuleList::GetGlobalModuleListProperties(); + const auto &props = ModuleList::GetGlobalModuleListProperties(); if (props.GetUseDWARFImporter()) m_dwarf_importer_delegate_up = std::make_unique(*this); @@ -3480,7 +3480,7 @@ swift::ASTContext *SwiftASTContext::GetASTContext() { prebuiltModuleCachePath.c_str()); // Determine the Swift module loading mode to use. - auto props = ModuleList::GetGlobalModuleListProperties(); + const auto &props = ModuleList::GetGlobalModuleListProperties(); swift::ModuleLoadingMode loading_mode; switch (props.GetSwiftModuleLoadingMode()) { case eSwiftModuleLoadingModePreferSerialized: