From c321e534022768d424cf5c5ab43f99489e55bf07 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 8 Jun 2016 19:09:22 +0000 Subject: Apply most suggestions of clang-tidy's performance-unnecessary-value-param Avoids unnecessary copies. All changes audited & pass tests with asan. No functional change intended. llvm-svn: 272190 --- llvm/lib/Linker/LinkModules.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Linker') diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index 14a25612259..ff36f90b53f 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -44,7 +44,7 @@ class ModuleLinker { /// The mover has just hit GV and we have to decide if it, and other members /// of the same comdat, should be linked. Every member to be linked is passed /// to Add. - void addLazyFor(GlobalValue &GV, IRMover::ValueAdder Add); + void addLazyFor(GlobalValue &GV, const IRMover::ValueAdder &Add); bool shouldLinkReferencedLinkOnce() { return !(Flags & Linker::DontForceLinkLinkonceODR); @@ -416,7 +416,7 @@ bool ModuleLinker::linkIfNeeded(GlobalValue &GV) { return false; } -void ModuleLinker::addLazyFor(GlobalValue &GV, IRMover::ValueAdder Add) { +void ModuleLinker::addLazyFor(GlobalValue &GV, const IRMover::ValueAdder &Add) { if (!shouldLinkReferencedLinkOnce()) // For ThinLTO we don't import more than what was required. // The client has to guarantee that the linkonce will be availabe at link -- cgit v1.2.3