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/ObjectFile/Mach-O/ObjectFileMachO.h | |
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/ObjectFile/Mach-O/ObjectFileMachO.h')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h index 83f382c70c5..527acae3cc1 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h @@ -193,14 +193,14 @@ protected: bool SectionIsLoadable(const lldb_private::Section *section); llvm::MachO::mach_header m_header; - static const lldb_private::ConstString &GetSegmentNameTEXT(); - static const lldb_private::ConstString &GetSegmentNameDATA(); - static const lldb_private::ConstString &GetSegmentNameDATA_DIRTY(); - static const lldb_private::ConstString &GetSegmentNameDATA_CONST(); - static const lldb_private::ConstString &GetSegmentNameOBJC(); - static const lldb_private::ConstString &GetSegmentNameLINKEDIT(); - static const lldb_private::ConstString &GetSegmentNameDWARF(); - static const lldb_private::ConstString &GetSectionNameEHFrame(); + static lldb_private::ConstString GetSegmentNameTEXT(); + static lldb_private::ConstString GetSegmentNameDATA(); + static lldb_private::ConstString GetSegmentNameDATA_DIRTY(); + static lldb_private::ConstString GetSegmentNameDATA_CONST(); + static lldb_private::ConstString GetSegmentNameOBJC(); + static lldb_private::ConstString GetSegmentNameLINKEDIT(); + static lldb_private::ConstString GetSegmentNameDWARF(); + static lldb_private::ConstString GetSectionNameEHFrame(); llvm::MachO::dysymtab_command m_dysymtab; std::vector<llvm::MachO::segment_command_64> m_mach_segments; |