From bf9d84c0149b4944d58a00024c8abd98eefc9589 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Tue, 1 Oct 2019 15:40:41 +0000 Subject: Remove size_t return parameter from FindTypes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In r368345 I accidentally introduced a regression that would over-report the number of matches found by FindTypes if the DeclContext Filter was hit. This patch simply removes the size_t return parameter altogether — it's not that useful. rdar://problem/55500457 Differential Revision: https://reviews.llvm.org/D68169 llvm-svn: 373344 --- .../SymbolFile/NativePDB/SymbolFileNativePDB.cpp | 35 ++++++++-------------- .../SymbolFile/NativePDB/SymbolFileNativePDB.h | 21 +++++++------ 2 files changed, 23 insertions(+), 33 deletions(-) (limited to 'lldb/source/Plugins/SymbolFile/NativePDB') diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp index 4d2ed0ffc03..ceaa8774593 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp @@ -1250,33 +1250,28 @@ uint32_t SymbolFileNativePDB::FindFunctions(const RegularExpression ®ex, return 0; } -uint32_t SymbolFileNativePDB::FindTypes( +void SymbolFileNativePDB::FindTypes( ConstString name, const CompilerDeclContext *parent_decl_ctx, - uint32_t max_matches, - llvm::DenseSet &searched_symbol_files, TypeMap &types) { + uint32_t max_matches, llvm::DenseSet &searched_symbol_files, + TypeMap &types) { std::lock_guard guard(GetModuleMutex()); if (!name) - return 0; + return; searched_symbol_files.clear(); searched_symbol_files.insert(this); // There is an assumption 'name' is not a regex - size_t match_count = FindTypesByName(name.GetStringRef(), max_matches, types); - - return match_count; + FindTypesByName(name.GetStringRef(), max_matches, types); } -size_t SymbolFileNativePDB::FindTypes(llvm::ArrayRef pattern, - LanguageSet languages, TypeMap &types) { - return 0; -} +void SymbolFileNativePDB::FindTypes(llvm::ArrayRef pattern, + LanguageSet languages, TypeMap &types) {} -size_t SymbolFileNativePDB::FindTypesByName(llvm::StringRef name, - uint32_t max_matches, - TypeMap &types) { +void SymbolFileNativePDB::FindTypesByName(llvm::StringRef name, + uint32_t max_matches, + TypeMap &types) { - size_t match_count = 0; std::vector matches = m_index->tpi().findRecordsByName(name); if (max_matches > 0 && max_matches < matches.size()) matches.resize(max_matches); @@ -1287,9 +1282,7 @@ size_t SymbolFileNativePDB::FindTypesByName(llvm::StringRef name, continue; types.Insert(type); - ++match_count; } - return match_count; } size_t SymbolFileNativePDB::ParseTypes(CompileUnit &comp_unit) { @@ -1578,11 +1571,9 @@ bool SymbolFileNativePDB::CompleteType(CompilerType &compiler_type) { return m_ast->CompleteType(qt); } -size_t SymbolFileNativePDB::GetTypes(lldb_private::SymbolContextScope *sc_scope, - TypeClass type_mask, - lldb_private::TypeList &type_list) { - return 0; -} +void SymbolFileNativePDB::GetTypes(lldb_private::SymbolContextScope *sc_scope, + TypeClass type_mask, + lldb_private::TypeList &type_list) {} CompilerDeclContext SymbolFileNativePDB::FindNamespace(ConstString name, diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h index 837c950cc6a..d8634b28ccf 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h @@ -116,8 +116,8 @@ public: lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) override; - size_t GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask, - TypeList &type_list) override; + void GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask, + TypeList &type_list) override; uint32_t FindFunctions(ConstString name, const CompilerDeclContext *parent_decl_ctx, @@ -128,14 +128,13 @@ public: uint32_t FindFunctions(const RegularExpression ®ex, bool include_inlines, bool append, SymbolContextList &sc_list) override; - uint32_t FindTypes(ConstString name, - const CompilerDeclContext *parent_decl_ctx, - uint32_t max_matches, - llvm::DenseSet &searched_symbol_files, - TypeMap &types) override; + void FindTypes(ConstString name, const CompilerDeclContext *parent_decl_ctx, + uint32_t max_matches, + llvm::DenseSet &searched_symbol_files, + TypeMap &types) override; - size_t FindTypes(llvm::ArrayRef pattern, - LanguageSet languages, TypeMap &types) override; + void FindTypes(llvm::ArrayRef pattern, LanguageSet languages, + TypeMap &types) override; llvm::Expected GetTypeSystemForLanguage(lldb::LanguageType language) override; @@ -158,8 +157,8 @@ private: lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override; - size_t FindTypesByName(llvm::StringRef name, uint32_t max_matches, - TypeMap &types); + void FindTypesByName(llvm::StringRef name, uint32_t max_matches, + TypeMap &types); lldb::TypeSP CreateModifierType(PdbTypeSymId type_id, const llvm::codeview::ModifierRecord &mr, -- cgit v1.2.3