diff options
author | Pavel Labath <labath@google.com> | 2017-05-02 10:17:30 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-05-02 10:17:30 +0000 |
commit | 4d35d6b3b38bba179c26049c86e3cb8a05559154 (patch) | |
tree | 586e8430edf70f49f01a414c93c2c88c5a323f8c /lldb/source/Plugins/ObjectFile/ELF | |
parent | 8deb87a6c06b466e62bd58e09b86309ef6153ddb (diff) | |
download | bcm5719-llvm-4d35d6b3b38bba179c26049c86e3cb8a05559154.tar.gz bcm5719-llvm-4d35d6b3b38bba179c26049c86e3cb8a05559154.zip |
Change UniqueCStringMap to use ConstString as the key
Summary:
UniqueCStringMap "sorts" the entries for fast lookup, but really it only cares about uniqueness. ConstString can be compared by pointer alone, rather than with strcmp, resulting in much faster comparisons. Change the interface to take ConstString instead, and propagate use of the type to the callers where appropriate.
Reviewers: #lldb, clayborg
Reviewed By: clayborg
Subscribers: labath, jasonmolenda, lldb-commits
Differential Revision: https://reviews.llvm.org/D32316
Patch by Scott Smith <scott.smith@purestorage.com>.
llvm-svn: 301908
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 6e2001b2163..7126233bcf0 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1808,10 +1808,10 @@ DataExtractor ObjectFileELF::GetSegmentDataByIndex(lldb::user_id_t id) { segment_header->p_filesz); } -std::string +llvm::StringRef ObjectFileELF::StripLinkerSymbolAnnotations(llvm::StringRef symbol_name) const { size_t pos = symbol_name.find('@'); - return symbol_name.substr(0, pos).str(); + return symbol_name.substr(0, pos); } //---------------------------------------------------------------------- diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h index 98bd9abb193..9b2d58b7be8 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h @@ -152,7 +152,7 @@ public: // Returns segment data for the given index. lldb_private::DataExtractor GetSegmentDataByIndex(lldb::user_id_t id); - std::string + llvm::StringRef StripLinkerSymbolAnnotations(llvm::StringRef symbol_name) const override; private: |