Author: Jonas Devlieghere Date: 2019-11-06T15:06:29-08:00 New Revision: cfca0056f054602dd46d1224c63d2275a4ecd90f
URL: https://github.com/llvm/llvm-project/commit/cfca0056f054602dd46d1224c63d2275a4ecd90f DIFF: https://github.com/llvm/llvm-project/commit/cfca0056f054602dd46d1224c63d2275a4ecd90f.diff LOG: [lldb] Remove dead code from STLUtils.h Added: Modified: lldb/include/lldb/Core/STLUtils.h lldb/source/API/SBTarget.cpp lldb/source/Commands/CommandObjectBreakpoint.h lldb/source/Commands/CommandObjectCommands.h lldb/source/Commands/CommandObjectSource.cpp lldb/source/Commands/CommandObjectSource.h Removed: ################################################################################ diff --git a/lldb/include/lldb/Core/STLUtils.h b/lldb/include/lldb/Core/STLUtils.h index 830aca36a116..f9500aa5594e 100644 --- a/lldb/include/lldb/Core/STLUtils.h +++ b/lldb/include/lldb/Core/STLUtils.h @@ -23,52 +23,4 @@ struct CStringCompareFunctionObject { } }; -// C string equality function object (binary predicate). -struct CStringEqualBinaryPredicate { - bool operator()(const char *s1, const char *s2) const { - return strcmp(s1, s2) == 0; - } -}; - -// Templated type for finding an entry in a std::map<F,S> whose value is equal -// to something -template <class F, class S> class ValueEquals { -public: - ValueEquals(const S &val) : second_value(val) {} - - // Compare the second item - bool operator()(std::pair<const F, S> elem) { - return elem.second == second_value; - } - -private: - S second_value; -}; - -template <class T> -inline void PrintAllCollectionElements(std::ostream &s, const T &coll, - const char *header_cstr = nullptr, - const char *separator_cstr = " ") { - typename T::const_iterator pos; - - if (header_cstr) - s << header_cstr; - for (pos = coll.begin(); pos != coll.end(); ++pos) { - s << *pos << separator_cstr; - } - s << std::endl; -} - -// The function object below can be used to delete a STL container that -// contains C++ object pointers. -// -// Usage: std::for_each(vector.begin(), vector.end(), for_each_delete()); - -struct for_each_cplusplus_delete { - template <typename T> void operator()(T *ptr) { delete ptr; } -}; - -typedef std::vector<std::string> STLStringArray; -typedef std::vector<const char *> CStringArray; - #endif // liblldb_STLUtils_h_ diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index 1d13087eef69..bf444a72278a 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -36,7 +36,6 @@ #include "lldb/Core/Disassembler.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Core/STLUtils.h" #include "lldb/Core/SearchFilter.h" #include "lldb/Core/Section.h" #include "lldb/Core/StructuredDataImpl.h" @@ -1598,7 +1597,7 @@ lldb::SBModule SBTarget::AddModule(const SBModuleSpec &module_spec) { lldb::SBModule sb_module; TargetSP target_sp(GetSP()); if (target_sp) - sb_module.SetSP(target_sp->GetOrCreateModule(*module_spec.m_opaque_up, + sb_module.SetSP(target_sp->GetOrCreateModule(*module_spec.m_opaque_up, true /* notify */)); return LLDB_RECORD_RESULT(sb_module); } diff --git a/lldb/source/Commands/CommandObjectBreakpoint.h b/lldb/source/Commands/CommandObjectBreakpoint.h index 7a0d5546d7a0..d7b3a3e3f36c 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.h +++ b/lldb/source/Commands/CommandObjectBreakpoint.h @@ -14,7 +14,6 @@ #include "lldb/Breakpoint/BreakpointName.h" #include "lldb/Core/Address.h" -#include "lldb/Core/STLUtils.h" #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/Interpreter/Options.h" #include "lldb/lldb-private.h" diff --git a/lldb/source/Commands/CommandObjectCommands.h b/lldb/source/Commands/CommandObjectCommands.h index 468ee53344f1..ef5fc4b0a83c 100644 --- a/lldb/source/Commands/CommandObjectCommands.h +++ b/lldb/source/Commands/CommandObjectCommands.h @@ -10,7 +10,6 @@ #ifndef liblldb_CommandObjectCommands_h_ #define liblldb_CommandObjectCommands_h_ -#include "lldb/Core/STLUtils.h" #include "lldb/Interpreter/CommandObject.h" #include "lldb/Interpreter/CommandObjectMultiword.h" diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index 10da30fb38b9..fd1b158afb16 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -111,7 +111,7 @@ class CommandObjectSourceInfo : public CommandObjectParsed { uint32_t start_line; uint32_t end_line; uint32_t num_lines; - STLStringArray modules; + std::vector<std::string> modules; }; public: @@ -708,7 +708,7 @@ class CommandObjectSourceList : public CommandObjectParsed { lldb::addr_t address; uint32_t start_line; uint32_t num_lines; - STLStringArray modules; + std::vector<std::string> modules; bool show_bp_locs; bool reverse; }; diff --git a/lldb/source/Commands/CommandObjectSource.h b/lldb/source/Commands/CommandObjectSource.h index d72122d55dc7..a2c2b0c68865 100644 --- a/lldb/source/Commands/CommandObjectSource.h +++ b/lldb/source/Commands/CommandObjectSource.h @@ -10,7 +10,6 @@ #ifndef liblldb_CommandObjectSource_h_ #define liblldb_CommandObjectSource_h_ -#include "lldb/Core/STLUtils.h" #include "lldb/Interpreter/CommandObject.h" #include "lldb/Interpreter/CommandObjectMultiword.h" _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits