diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-01-27 22:17:16 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-06-04 11:59:19 +0000 |
commit | 390adc38fc112be360bd15499e5241bf4e675b6f (patch) | |
tree | 712d68d3aa03f7aa4902ba03dcac2a56f49ae0e5 /contrib/llvm-project/lldb/include/lldb/Core | |
parent | 8a84287b0edc66fc6dede3db770d10ff41da5464 (diff) | |
download | src-390adc38fc112be360bd15499e5241bf4e675b6f.tar.gz src-390adc38fc112be360bd15499e5241bf4e675b6f.zip |
Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.
PR: 261742
MFC after: 2 weeks
(cherry picked from commit 04eeddc0aa8e0a417a16eaf9d7d095207f4a8623)
Diffstat (limited to 'contrib/llvm-project/lldb/include/lldb/Core')
16 files changed, 69 insertions, 58 deletions
diff --git a/contrib/llvm-project/lldb/include/lldb/Core/Address.h b/contrib/llvm-project/lldb/include/lldb/Core/Address.h index dc50e27ca277..f77ffc2fd25e 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/Address.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/Address.h @@ -116,7 +116,7 @@ public: /// /// Initialize with a invalid section (NULL) and an invalid offset /// (LLDB_INVALID_ADDRESS). - Address() : m_section_wp() {} + Address() {} /// Copy constructor /// diff --git a/contrib/llvm-project/lldb/include/lldb/Core/Debugger.h b/contrib/llvm-project/lldb/include/lldb/Core/Debugger.h index 1ab21bec54c9..f9a1f1eea54f 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/Debugger.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/Debugger.h @@ -306,6 +306,10 @@ public: bool SetScriptLanguage(lldb::ScriptLanguage script_lang); + lldb::LanguageType GetREPLLanguage() const; + + bool SetREPLLanguage(lldb::LanguageType repl_lang); + uint32_t GetTerminalWidth() const; bool SetTerminalWidth(uint32_t term_width); diff --git a/contrib/llvm-project/lldb/include/lldb/Core/Declaration.h b/contrib/llvm-project/lldb/include/lldb/Core/Declaration.h index f81de21bc8f8..6ae21eb65eb3 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/Declaration.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/Declaration.h @@ -24,7 +24,7 @@ namespace lldb_private { class Declaration { public: /// Default constructor. - Declaration() : m_file() {} + Declaration() {} /// Construct with file specification, and optional line and column. /// @@ -45,7 +45,7 @@ public: /// Construct with a pointer to another Declaration object. Declaration(const Declaration *decl_ptr) - : m_file(), m_line(0), m_column(LLDB_INVALID_COLUMN_NUMBER) { + : m_line(0), m_column(LLDB_INVALID_COLUMN_NUMBER) { if (decl_ptr) *this = *decl_ptr; } @@ -152,8 +152,6 @@ public: /// The number of bytes that this object occupies in memory. /// The returned value does not include the bytes for any /// shared string values. - /// - /// \see ConstString::StaticMemorySize () size_t MemorySize() const; /// Set accessor for the declaration file specification. diff --git a/contrib/llvm-project/lldb/include/lldb/Core/Disassembler.h b/contrib/llvm-project/lldb/include/lldb/Core/Disassembler.h index 0925bf358b9c..87979fd92584 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/Disassembler.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/Disassembler.h @@ -465,7 +465,7 @@ protected: uint32_t line = LLDB_INVALID_LINE_NUMBER; uint32_t column = 0; - SourceLine() : file() {} + SourceLine() {} bool operator==(const SourceLine &rhs) const { return file == rhs.file && line == rhs.line && rhs.column == column; @@ -489,7 +489,7 @@ protected: // Whether to print a blank line at the end of the source lines. bool print_source_context_end_eol = true; - SourceLinesToDisplay() : lines() {} + SourceLinesToDisplay() {} }; // Get the function's declaration line number, hopefully a line number diff --git a/contrib/llvm-project/lldb/include/lldb/Core/DumpDataExtractor.h b/contrib/llvm-project/lldb/include/lldb/Core/DumpDataExtractor.h index 12188609e8c0..08501b512a2b 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/DumpDataExtractor.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/DumpDataExtractor.h @@ -76,6 +76,15 @@ class Stream; /// same integer value. If the items being displayed are not /// bitfields, this value should be zero. /// +/// \param[in] exe_scope +/// If provided, this will be used to lookup language specific +/// information, address information and memory tags. +/// (if they are requested by the other options) +/// +/// \param[in] show_memory_tags +/// If exe_scope and base_addr are valid, include memory tags +/// in the output. This does not apply to certain formats. +/// /// \return /// The offset at which dumping ended. lldb::offset_t @@ -83,7 +92,8 @@ DumpDataExtractor(const DataExtractor &DE, Stream *s, lldb::offset_t offset, lldb::Format item_format, size_t item_byte_size, size_t item_count, size_t num_per_line, uint64_t base_addr, uint32_t item_bit_size, uint32_t item_bit_offset, - ExecutionContextScope *exe_scope = nullptr); + ExecutionContextScope *exe_scope = nullptr, + bool show_memory_tags = false); void DumpHexBytes(Stream *s, const void *src, size_t src_len, uint32_t bytes_per_line, lldb::addr_t base_addr); diff --git a/contrib/llvm-project/lldb/include/lldb/Core/FileSpecList.h b/contrib/llvm-project/lldb/include/lldb/Core/FileSpecList.h index cab8e9b9b43f..117c6b691498 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/FileSpecList.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/FileSpecList.h @@ -152,8 +152,6 @@ public: /// /// \return /// The number of bytes that this object occupies in memory. - /// - /// \see ConstString::StaticMemorySize () size_t MemorySize() const; bool IsEmpty() const { return m_files.empty(); } diff --git a/contrib/llvm-project/lldb/include/lldb/Core/FormatEntity.h b/contrib/llvm-project/lldb/include/lldb/Core/FormatEntity.h index ecae8500df40..cd9019d55554 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/FormatEntity.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/FormatEntity.h @@ -148,7 +148,7 @@ public: Entry(Type t = Type::Invalid, const char *s = nullptr, const char *f = nullptr) - : string(s ? s : ""), printf_format(f ? f : ""), children(), type(t) {} + : string(s ? s : ""), printf_format(f ? f : ""), type(t) {} Entry(llvm::StringRef s); Entry(char ch); diff --git a/contrib/llvm-project/lldb/include/lldb/Core/LoadedModuleInfoList.h b/contrib/llvm-project/lldb/include/lldb/Core/LoadedModuleInfoList.h index ad6da2bd7559..3f65ddc06d73 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/LoadedModuleInfoList.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/LoadedModuleInfoList.h @@ -101,7 +101,7 @@ public: lldb::addr_t m_dynamic; }; - LoadedModuleInfoList() : m_list() {} + LoadedModuleInfoList() {} void add(const LoadedModuleInfo &mod) { m_list.push_back(mod); } diff --git a/contrib/llvm-project/lldb/include/lldb/Core/Mangled.h b/contrib/llvm-project/lldb/include/lldb/Core/Mangled.h index 6c92591a0881..4e4f75e18e34 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/Mangled.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/Mangled.h @@ -72,10 +72,10 @@ public: return !(*this == rhs); } - /// Convert to pointer operator. + /// Convert to bool operator. /// - /// This allows code to check a Mangled object to see if it contains a valid - /// mangled name using code such as: + /// This allows code to check any Mangled objects to see if they contain + /// anything valid using code such as: /// /// \code /// Mangled mangled(...); @@ -84,25 +84,9 @@ public: /// \endcode /// /// \return - /// A pointer to this object if either the mangled or unmangled - /// name is set, NULL otherwise. - operator void *() const; - - /// Logical NOT operator. - /// - /// This allows code to check a Mangled object to see if it contains an - /// empty mangled name using code such as: - /// - /// \code - /// Mangled mangled(...); - /// if (!mangled) - /// { ... - /// \endcode - /// - /// \return - /// Returns \b true if the object has an empty mangled and - /// unmangled name, \b false otherwise. - bool operator!() const; + /// Returns \b true if either the mangled or unmangled name is set, + /// \b false if the object has an empty mangled and unmangled name. + explicit operator bool() const; /// Clear the mangled and demangled values. void Clear(); @@ -199,8 +183,6 @@ public: /// /// \return /// The number of bytes that this object occupies in memory. - /// - /// \see ConstString::StaticMemorySize () size_t MemorySize() const; /// Set the string value in this object. diff --git a/contrib/llvm-project/lldb/include/lldb/Core/Module.h b/contrib/llvm-project/lldb/include/lldb/Core/Module.h index 6b1e4f8f3704..f6c32586eda8 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/Module.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/Module.h @@ -905,7 +905,7 @@ public: /// correctly. class LookupInfo { public: - LookupInfo() : m_name(), m_lookup_name() {} + LookupInfo() {} LookupInfo(ConstString name, lldb::FunctionNameType name_type_mask, lldb::LanguageType language); @@ -1047,11 +1047,11 @@ protected: /// We store a symbol table parse time duration here because we might have /// an object file and a symbol file which both have symbol tables. The parse /// time for the symbol tables can be aggregated here. - StatsDuration m_symtab_parse_time{0.0}; + StatsDuration m_symtab_parse_time; /// We store a symbol named index time duration here because we might have /// an object file and a symbol file which both have symbol tables. The parse /// time for the symbol tables can be aggregated here. - StatsDuration m_symtab_index_time{0.0}; + StatsDuration m_symtab_index_time; /// Resolve a file or load virtual address. /// diff --git a/contrib/llvm-project/lldb/include/lldb/Core/ModuleSpec.h b/contrib/llvm-project/lldb/include/lldb/Core/ModuleSpec.h index 8e5deebbab9a..bcf4ec30a673 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/ModuleSpec.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/ModuleSpec.h @@ -25,18 +25,14 @@ namespace lldb_private { class ModuleSpec { public: - ModuleSpec() - : m_file(), m_platform_file(), m_symbol_file(), m_arch(), m_uuid(), - m_object_name(), m_source_mappings() {} + ModuleSpec() {} /// If the \c data argument is passed, its contents will be used /// as the module contents instead of trying to read them from /// \c file_spec . ModuleSpec(const FileSpec &file_spec, const UUID &uuid = UUID(), lldb::DataBufferSP data = lldb::DataBufferSP()) - : m_file(file_spec), m_platform_file(), m_symbol_file(), m_arch(), - m_uuid(uuid), m_object_name(), m_object_offset(0), m_source_mappings(), - m_data(data) { + : m_file(file_spec), m_uuid(uuid), m_object_offset(0), m_data(data) { if (data) m_object_size = data->GetByteSize(); else if (m_file) @@ -44,10 +40,8 @@ public: } ModuleSpec(const FileSpec &file_spec, const ArchSpec &arch) - : m_file(file_spec), m_platform_file(), m_symbol_file(), m_arch(arch), - m_uuid(), m_object_name(), m_object_offset(0), - m_object_size(FileSystem::Instance().GetByteSize(file_spec)), - m_source_mappings() {} + : m_file(file_spec), m_arch(arch), m_object_offset(0), + m_object_size(FileSystem::Instance().GetByteSize(file_spec)) {} FileSpec *GetFileSpecPtr() { return (m_file ? &m_file : nullptr); } @@ -279,9 +273,9 @@ protected: class ModuleSpecList { public: - ModuleSpecList() : m_specs(), m_mutex() {} + ModuleSpecList() {} - ModuleSpecList(const ModuleSpecList &rhs) : m_specs(), m_mutex() { + ModuleSpecList(const ModuleSpecList &rhs) { std::lock_guard<std::recursive_mutex> lhs_guard(m_mutex); std::lock_guard<std::recursive_mutex> rhs_guard(rhs.m_mutex); m_specs = rhs.m_specs; diff --git a/contrib/llvm-project/lldb/include/lldb/Core/StructuredDataImpl.h b/contrib/llvm-project/lldb/include/lldb/Core/StructuredDataImpl.h index 8930ebff8166..355aa77c4e5c 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/StructuredDataImpl.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/StructuredDataImpl.h @@ -25,7 +25,7 @@ namespace lldb_private { class StructuredDataImpl { public: - StructuredDataImpl() : m_plugin_wp(), m_data_sp() {} + StructuredDataImpl() {} StructuredDataImpl(const StructuredDataImpl &rhs) = default; diff --git a/contrib/llvm-project/lldb/include/lldb/Core/ThreadSafeValue.h b/contrib/llvm-project/lldb/include/lldb/Core/ThreadSafeValue.h index 51820ec9cd9d..979f008b3170 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/ThreadSafeValue.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/ThreadSafeValue.h @@ -18,7 +18,7 @@ namespace lldb_private { template <class T> class ThreadSafeValue { public: ThreadSafeValue() = default; - ThreadSafeValue(const T &value) : m_value(value), m_mutex() {} + ThreadSafeValue(const T &value) : m_value(value) {} ~ThreadSafeValue() = default; diff --git a/contrib/llvm-project/lldb/include/lldb/Core/UniqueCStringMap.h b/contrib/llvm-project/lldb/include/lldb/Core/UniqueCStringMap.h index e37027a0150a..9c8b8081d374 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/UniqueCStringMap.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/UniqueCStringMap.h @@ -165,7 +165,21 @@ public: // my_map.Append (UniqueCStringMap::Entry(GetName(...), GetValue(...))); // } // my_map.Sort(); - void Sort() { llvm::sort(m_map.begin(), m_map.end(), Compare()); } + void Sort() { + Sort([](const T &, const T &) { return false; }); + } + + /// Sort contents of this map using the provided comparator to break ties for + /// entries with the same string value. + template <typename TCompare> void Sort(TCompare tc) { + Compare c; + llvm::sort(m_map, [&](const Entry &lhs, const Entry &rhs) -> bool { + int result = c.ThreeWay(lhs.cstring, rhs.cstring); + if (result == 0) + return tc(lhs.value, rhs.value); + return result < 0; + }); + } // Since we are using a vector to contain our items it will always double its // memory consumption as things are added to the vector, so if you intend to @@ -205,13 +219,24 @@ protected: return operator()(lhs, rhs.cstring); } + bool operator()(ConstString lhs, ConstString rhs) { + return ThreeWay(lhs, rhs) < 0; + } + // This is only for uniqueness, not lexicographical ordering, so we can // just compare pointers. *However*, comparing pointers from different // allocations is UB, so we need compare their integral values instead. - bool operator()(ConstString lhs, ConstString rhs) { - return uintptr_t(lhs.GetCString()) < uintptr_t(rhs.GetCString()); + int ThreeWay(ConstString lhs, ConstString rhs) { + auto lhsint = uintptr_t(lhs.GetCString()); + auto rhsint = uintptr_t(rhs.GetCString()); + if (lhsint < rhsint) + return -1; + if (lhsint > rhsint) + return 1; + return 0; } }; + collection m_map; }; diff --git a/contrib/llvm-project/lldb/include/lldb/Core/Value.h b/contrib/llvm-project/lldb/include/lldb/Core/Value.h index 1ee4fe639e6e..9f00a14251e2 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/Value.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/Value.h @@ -156,7 +156,7 @@ protected: class ValueList { public: - ValueList() : m_values() {} + ValueList() {} ValueList(const ValueList &rhs); diff --git a/contrib/llvm-project/lldb/include/lldb/Core/ValueObject.h b/contrib/llvm-project/lldb/include/lldb/Core/ValueObject.h index 192149f05436..dac7aac06246 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/ValueObject.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/ValueObject.h @@ -795,7 +795,7 @@ protected: class ChildrenManager { public: - ChildrenManager() : m_mutex(), m_children() {} + ChildrenManager() {} bool HasChildAtIndex(size_t idx) { std::lock_guard<std::recursive_mutex> guard(m_mutex); |