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/Core/ModuleList.cpp | |
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/Core/ModuleList.cpp')
-rw-r--r-- | lldb/source/Core/ModuleList.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index 74b9af3e10c..8740bd0f40a 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -344,7 +344,7 @@ ModuleSP ModuleList::GetModuleAtIndexUnlocked(size_t idx) const { return module_sp; } -size_t ModuleList::FindFunctions(const ConstString &name, +size_t ModuleList::FindFunctions(ConstString name, FunctionNameType name_type_mask, bool include_symbols, bool include_inlines, bool append, @@ -380,7 +380,7 @@ size_t ModuleList::FindFunctions(const ConstString &name, return sc_list.GetSize() - old_size; } -size_t ModuleList::FindFunctionSymbols(const ConstString &name, +size_t ModuleList::FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, SymbolContextList &sc_list) { const size_t old_size = sc_list.GetSize(); @@ -439,7 +439,7 @@ size_t ModuleList::FindCompileUnits(const FileSpec &path, bool append, return sc_list.GetSize(); } -size_t ModuleList::FindGlobalVariables(const ConstString &name, +size_t ModuleList::FindGlobalVariables(ConstString name, size_t max_matches, VariableList &variable_list) const { size_t initial_size = variable_list.GetSize(); @@ -463,7 +463,7 @@ size_t ModuleList::FindGlobalVariables(const RegularExpression ®ex, return variable_list.GetSize() - initial_size; } -size_t ModuleList::FindSymbolsWithNameAndType(const ConstString &name, +size_t ModuleList::FindSymbolsWithNameAndType(ConstString name, SymbolType symbol_type, SymbolContextList &sc_list, bool append) const { @@ -542,7 +542,7 @@ ModuleSP ModuleList::FindModule(const UUID &uuid) const { } size_t -ModuleList::FindTypes(Module *search_first, const ConstString &name, +ModuleList::FindTypes(Module *search_first, ConstString name, bool name_is_fully_qualified, size_t max_matches, llvm::DenseSet<SymbolFile *> &searched_symbol_files, TypeList &types) const { |