Pass EphValues by const-ref as it is not modified in the callee
authorSebastian Pop <sebpop@gmail.com>
Wed, 3 Aug 2016 19:13:50 +0000 (19:13 +0000)
committerSebastian Pop <sebpop@gmail.com>
Wed, 3 Aug 2016 19:13:50 +0000 (19:13 +0000)
Patch by Aditya Kumar.

Differential Revision: https://reviews.llvm.org/D22967

llvm-svn: 277634

llvm/include/llvm/Analysis/CodeMetrics.h
llvm/lib/Analysis/CodeMetrics.cpp

index f512aca..9e861ac 100644 (file)
@@ -87,7 +87,7 @@ struct CodeMetrics {
 
   /// \brief Add information about a block to the current state.
   void analyzeBasicBlock(const BasicBlock *BB, const TargetTransformInfo &TTI,
-                         SmallPtrSetImpl<const Value*> &EphValues);
+                         const SmallPtrSetImpl<const Value*> &EphValues);
 
   /// \brief Collect a loop's ephemeral values (those used only by an assume
   /// or similar intrinsics in the loop).
index ed83704..576dca4 100644 (file)
@@ -104,7 +104,7 @@ void CodeMetrics::collectEphemeralValues(
 /// block.
 void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB,
                                     const TargetTransformInfo &TTI,
-                                    SmallPtrSetImpl<const Value*> &EphValues) {
+                                    const SmallPtrSetImpl<const Value*> &EphValues) {
   ++NumBlocks;
   unsigned NumInstsBeforeThisBB = NumInsts;
   for (const Instruction &I : *BB) {