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
This commit is contained in:
Adrian Prantl
2019-03-06 21:22:25 +00:00
parent 480bce28ff
commit 0e4c482124
209 changed files with 824 additions and 825 deletions

View File

@@ -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 &regex,
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 {