diff options
| author | Adrian Prantl <aprantl@apple.com> | 2019-03-06 21:22:25 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2019-03-06 21:22:25 +0000 |
| commit | 0e4c482124f098957fc13bcfbabc36775dd190ab (patch) | |
| tree | 34ee130b6d6de0d41a229021c4b46ab66b891a08 /lldb/source/Plugins/ObjectContainer | |
| parent | 480bce28ffc4640f443e262fa110af50b0d635df (diff) | |
| download | bcm5719-llvm-0e4c482124f098957fc13bcfbabc36775dd190ab.tar.gz bcm5719-llvm-0e4c482124f098957fc13bcfbabc36775dd190ab.zip | |
Pass ConstString by value (NFC)
My apologies for the large patch. With the exception of ConstString.h
itself it was entirely produced by sed.
ConstString has exactly one const char * data member, so passing a
ConstString by reference is not any more efficient than copying it by
value. In both cases a single pointer is passed. But passing it by
value makes it harder to accidentally return the address of a local
object.
(This fixes rdar://problem/48640859 for the Apple folks)
Differential Revision: https://reviews.llvm.org/D59030
llvm-svn: 355553
Diffstat (limited to 'lldb/source/Plugins/ObjectContainer')
| -rw-r--r-- | lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index 50e474917d7..a52c00107c1 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -169,7 +169,7 @@ size_t ObjectContainerBSDArchive::Archive::ParseObjects() { ObjectContainerBSDArchive::Object * ObjectContainerBSDArchive::Archive::FindObject( - const ConstString &object_name, + ConstString object_name, const llvm::sys::TimePoint<> &object_mod_time) { const ObjectNameToIndexMap::Entry *match = m_object_name_to_index_map.FindFirstValueForName(object_name); diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h index 868f505699f..13afb98fa72 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h @@ -136,7 +136,7 @@ protected: size_t ParseObjects(); - Object *FindObject(const lldb_private::ConstString &object_name, + Object *FindObject(lldb_private::ConstString object_name, const llvm::sys::TimePoint<> &object_mod_time); lldb::offset_t GetFileOffset() const { return m_file_offset; } |

