From 48ba197beaffe64646e21cc06923d8b019c7aa6d Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Mon, 24 Sep 2018 13:35:54 -0700 Subject: Fix some performance-unnecessary-value-param tidy and performance-for-range warnings. art/profman/profile_assistant_test.cc:119:54: error: the const qualified parameter 'hot_methods' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param,-warnings-as-errors] const std::vector hot_methods, ^ & art/profman/profile_assistant_test.cc:120:54: error: the const qualified parameter 'startup_methods' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param,-warnings-as-errors] const std::vector startup_methods, ^ & art/profman/profile_assistant_test.cc:121:54: error: the const qualified parameter 'post_startup_methods' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param,-warnings-as-errors] const std::vector post_startup_methods, ^ & art/runtime/subtype_check_info_test.cc:134:56: error: the parameter 'sc' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] static SubtypeCheckInfo CopyCleared(SubtypeCheckInfo sc) { ~~~~~~~~~~~~~~~~ ^ const & art/runtime/class_linker.cc:6451:62: error: the parameter 'to_process' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] std::vector> to_process) ~~~ ^ const & art/runtime/trace.cc:1127:13: error: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy,-warnings-as-errors] for (auto it : exited_threads_) { ~~~~ ^ const & art/runtime/oat_file_manager.cc:154:41: error: the parameter 'spaces' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] std::vector spaces) { ~~~ ^ const & art/test/004-JniTest/jni_test.cc:707:72: error: the parameter 'methods' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] void TestCalls(const char* declaring_class, std::vector methods) { ~~~ ^ const & art/compiler/optimizing/optimizing_compiler.cc:1409:89: error: the parameter 'info' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors] void OptimizingCompiler::GenerateJitDebugInfo(ArtMethod* method, debug::MethodDebugInfo info) { ~~~~~ ^ const & Bug: http://b/32619234 Bug: http://b/110779387 Test: Build using WITH_TIDY=1 Change-Id: I911d838b8c26ddab3d6a64024f3220000f078cba --- compiler/optimizing/optimizing_compiler.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 9ae025b3fe..3a550efeb8 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -399,7 +399,8 @@ class OptimizingCompiler final : public Compiler { PassObserver* pass_observer, VariableSizedHandleScope* handles) const; - void GenerateJitDebugInfo(ArtMethod* method, debug::MethodDebugInfo method_debug_info) + void GenerateJitDebugInfo(ArtMethod* method, + const debug::MethodDebugInfo& method_debug_info) REQUIRES_SHARED(Locks::mutator_lock_); std::unique_ptr compilation_stats_; @@ -1406,7 +1407,8 @@ bool OptimizingCompiler::JitCompile(Thread* self, return true; } -void OptimizingCompiler::GenerateJitDebugInfo(ArtMethod* method, debug::MethodDebugInfo info) { +void OptimizingCompiler::GenerateJitDebugInfo( + ArtMethod* method, const debug::MethodDebugInfo& info) { const CompilerOptions& compiler_options = GetCompilerDriver()->GetCompilerOptions(); DCHECK(compiler_options.GenerateAnyDebugInfo()); -- cgit v1.2.3-59-g8ed1b