summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ObjCLanguageRuntime.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-03-06 21:22:25 +0000
committerAdrian Prantl <aprantl@apple.com>2019-03-06 21:22:25 +0000
commit0e4c482124f098957fc13bcfbabc36775dd190ab (patch)
tree34ee130b6d6de0d41a229021c4b46ab66b891a08 /lldb/source/Target/ObjCLanguageRuntime.cpp
parent480bce28ffc4640f443e262fa110af50b0d635df (diff)
downloadbcm5719-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/Target/ObjCLanguageRuntime.cpp')
-rw-r--r--lldb/source/Target/ObjCLanguageRuntime.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Target/ObjCLanguageRuntime.cpp b/lldb/source/Target/ObjCLanguageRuntime.cpp
index fac1fae68dc..cd97707ccfa 100644
--- a/lldb/source/Target/ObjCLanguageRuntime.cpp
+++ b/lldb/source/Target/ObjCLanguageRuntime.cpp
@@ -153,7 +153,7 @@ bool ObjCLanguageRuntime::ClassDescriptor::IsPointerValid(
}
ObjCLanguageRuntime::ObjCISA
-ObjCLanguageRuntime::GetISA(const ConstString &name) {
+ObjCLanguageRuntime::GetISA(ConstString name) {
ISAToDescriptorIterator pos = GetDescriptorIterator(name);
if (pos != m_isa_to_descriptor.end())
return pos->first;
@@ -161,7 +161,7 @@ ObjCLanguageRuntime::GetISA(const ConstString &name) {
}
ObjCLanguageRuntime::ISAToDescriptorIterator
-ObjCLanguageRuntime::GetDescriptorIterator(const ConstString &name) {
+ObjCLanguageRuntime::GetDescriptorIterator(ConstString name) {
ISAToDescriptorIterator end = m_isa_to_descriptor.end();
if (name) {
@@ -226,7 +226,7 @@ ObjCLanguageRuntime::GetActualTypeName(ObjCLanguageRuntime::ObjCISA isa) {
ObjCLanguageRuntime::ClassDescriptorSP
ObjCLanguageRuntime::GetClassDescriptorFromClassName(
- const ConstString &class_name) {
+ ConstString class_name) {
ISAToDescriptorIterator pos = GetDescriptorIterator(class_name);
if (pos != m_isa_to_descriptor.end())
return pos->second;
OpenPOWER on IntegriCloud