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/Analysis/Loads.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Analysis/Loads.cpp') diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp index a687eccf3e9..dce243ca673 100644 --- a/llvm/lib/Analysis/Loads.cpp +++ b/llvm/lib/Analysis/Loads.cpp @@ -25,7 +25,7 @@ using namespace llvm; -static bool isAligned(const Value *Base, APInt Offset, unsigned Align, +static bool isAligned(const Value *Base, const APInt &Offset, unsigned Align, const DataLayout &DL) { APInt BaseAlign(Offset.getBitWidth(), Base->getPointerAlignment(DL)); @@ -52,7 +52,7 @@ static bool isAligned(const Value *Base, unsigned Align, const DataLayout &DL) { /// Test if V is always a pointer to allocated and suitably aligned memory for /// a simple load or store. static bool isDereferenceableAndAlignedPointer( - const Value *V, unsigned Align, APInt Size, const DataLayout &DL, + const Value *V, unsigned Align, const APInt &Size, const DataLayout &DL, const Instruction *CtxI, const DominatorTree *DT, const TargetLibraryInfo *TLI, SmallPtrSetImpl &Visited) { // Note that it is not safe to speculate into a malloc'd region because -- cgit v1.2.3