From 22633f85bb7d317ff97c86b6ae7817b678777d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 5 Feb 2020 22:29:59 +0200 Subject: [PATCH] [LLDB] Fix compilation with GCC 5 Differential Revision: https://reviews.llvm.org/D74084 (cherry picked from commit 5bbaf543585c54868f8a2bdd9e74edcf395b24b3) --- lldb/source/DataFormatters/FormatCache.cpp | 4 ++++ lldb/source/DataFormatters/LanguageCategory.cpp | 4 ++++ lldb/source/Interpreter/CommandAlias.cpp | 3 ++- lldb/source/Interpreter/Options.cpp | 4 ++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lldb/source/DataFormatters/FormatCache.cpp b/lldb/source/DataFormatters/FormatCache.cpp index 231e7ed0c0a07..99f1407054467 100644 --- a/lldb/source/DataFormatters/FormatCache.cpp +++ b/lldb/source/DataFormatters/FormatCache.cpp @@ -69,6 +69,8 @@ FormatCache::Entry &FormatCache::GetEntry(ConstString type) { return m_map[type]; } +namespace lldb_private { + template<> bool FormatCache::Entry::IsCached() { return IsFormatCached(); } @@ -79,6 +81,8 @@ template<> bool FormatCache::Entry::IsCached() { return IsSyntheticCached(); } +} // namespace lldb_private + template bool FormatCache::Get(ConstString type, ImplSP &format_impl_sp) { std::lock_guard guard(m_mutex); diff --git a/lldb/source/DataFormatters/LanguageCategory.cpp b/lldb/source/DataFormatters/LanguageCategory.cpp index e18ec0feaa8b2..daf8c7af7d1a7 100644 --- a/lldb/source/DataFormatters/LanguageCategory.cpp +++ b/lldb/source/DataFormatters/LanguageCategory.cpp @@ -55,6 +55,8 @@ bool LanguageCategory::Get(FormattersMatchData &match_data, return result; } +namespace lldb_private { + /// Explicit instantiations for the three types. /// \{ template bool @@ -83,6 +85,8 @@ auto &LanguageCategory::GetHardcodedFinder() { return m_hardcoded_synthetics; } +} // namespace lldb_private + template bool LanguageCategory::GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data, diff --git a/lldb/source/Interpreter/CommandAlias.cpp b/lldb/source/Interpreter/CommandAlias.cpp index 5139c53a47b33..5209a7bcbc4e4 100644 --- a/lldb/source/Interpreter/CommandAlias.cpp +++ b/lldb/source/Interpreter/CommandAlias.cpp @@ -65,7 +65,8 @@ static bool ProcessAliasOptionsArgs(lldb::CommandObjectSP &cmd_obj_sp, else { for (auto &entry : args.entries()) { if (!entry.ref().empty()) - option_arg_vector->emplace_back("", -1, entry.ref()); + option_arg_vector->emplace_back(std::string(""), -1, + std::string(entry.ref())); } } } diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index 0bceea14269d0..80e9d3a6fc154 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -1061,8 +1061,8 @@ llvm::Expected Options::ParseAlias(const Args &args, } if (!option_arg) option_arg = ""; - option_arg_vector->emplace_back(option_str.GetString(), has_arg, - option_arg); + option_arg_vector->emplace_back(std::string(option_str.GetString()), + has_arg, std::string(option_arg)); // Find option in the argument list; also see if it was supposed to take an // argument and if one was supplied. Remove option (and argument, if