From a000366d0502b35fc0d3b113ace7f0e3bbdc08cd Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 5 Jan 2021 10:24:37 +0000 Subject: [PATCH] [SimplifyIndVar] createWideIV - make WideIVInfo arg a const ref. NFCI. The WideIVInfo arg is only ever used as a const. Fixes cppcheck warning. --- llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h | 2 +- llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h b/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h index 4599627..4ba56fb 100644 --- a/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h +++ b/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h @@ -74,7 +74,7 @@ struct WideIVInfo { /// Widen Induction Variables - Extend the width of an IV to cover its /// widest uses. -PHINode *createWideIV(WideIVInfo &WI, +PHINode *createWideIV(const WideIVInfo &WI, LoopInfo *LI, ScalarEvolution *SE, SCEVExpander &Rewriter, DominatorTree *DT, SmallVectorImpl &DeadInsts, unsigned &NumElimExt, unsigned &NumWidened, diff --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp index f3b1980..290c04a 100644 --- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp @@ -2076,7 +2076,7 @@ void WidenIV::calculatePostIncRanges(PHINode *OrigPhi) { } } -PHINode *llvm::createWideIV(WideIVInfo &WI, +PHINode *llvm::createWideIV(const WideIVInfo &WI, LoopInfo *LI, ScalarEvolution *SE, SCEVExpander &Rewriter, DominatorTree *DT, SmallVectorImpl &DeadInsts, unsigned &NumElimExt, unsigned &NumWidened, -- 2.7.4