From 728b9abb3f6e5aa67687ddc34a29d547f2d26a0d Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Mon, 1 Aug 2016 15:15:49 +0000 Subject: [lldb][tsan] Avoid a string copy (NFC) Differential Revision: https://reviews.llvm.org/D22984 llvm-svn: 277347 --- .../ThreadSanitizer/ThreadSanitizerRuntime.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp') diff --git a/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp b/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp index 62e5ce63a54..1d9fab31a0d 100644 --- a/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp +++ b/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp @@ -273,7 +273,7 @@ t; )"; static StructuredData::Array * -CreateStackTrace(ValueObjectSP o, std::string trace_item_name = ".trace") { +CreateStackTrace(ValueObjectSP o, const std::string &trace_item_name = ".trace") { StructuredData::Array *trace = new StructuredData::Array(); ValueObjectSP trace_value_object = o->GetValueForExpressionPath(trace_item_name.c_str()); for (int j = 0; j < 8; j++) { @@ -286,7 +286,7 @@ CreateStackTrace(ValueObjectSP o, std::string trace_item_name = ".trace") { } static StructuredData::Array * -ConvertToStructuredArray(ValueObjectSP return_value_sp, std::string items_name, std::string count_name, std::function const &callback) +ConvertToStructuredArray(ValueObjectSP return_value_sp, const std::string &items_name, const std::string &count_name, std::function const &callback) { StructuredData::Array *array = new StructuredData::Array(); unsigned int count = return_value_sp->GetValueForExpressionPath(count_name.c_str())->GetValueAsUnsigned(0); @@ -303,7 +303,7 @@ ConvertToStructuredArray(ValueObjectSP return_value_sp, std::string items_name, } static std::string -RetrieveString(ValueObjectSP return_value_sp, ProcessSP process_sp, std::string expression_path) +RetrieveString(ValueObjectSP return_value_sp, ProcessSP process_sp, const std::string &expression_path) { addr_t ptr = return_value_sp->GetValueForExpressionPath(expression_path.c_str())->GetValueAsUnsigned(0); std::string str; @@ -785,7 +785,7 @@ ThreadSanitizerRuntime::Deactivate() } static std::string -GenerateThreadName(std::string path, StructuredData::Object *o, StructuredData::ObjectSP main_info) { +GenerateThreadName(const std::string &path, StructuredData::Object *o, StructuredData::ObjectSP main_info) { std::string result = "additional information"; if (path == "mops") { @@ -837,7 +837,7 @@ GenerateThreadName(std::string path, StructuredData::Object *o, StructuredData:: } static void -AddThreadsForPath(std::string path, ThreadCollectionSP threads, ProcessSP process_sp, StructuredData::ObjectSP info) +AddThreadsForPath(const std::string &path, ThreadCollectionSP threads, ProcessSP process_sp, StructuredData::ObjectSP info) { info->GetObjectForDotSeparatedPath(path)->GetAsArray()->ForEach([process_sp, threads, path, info] (StructuredData::Object *o) -> bool { std::vector pcs; -- cgit v1.2.3