[llvm] r237223 - Constify arguments to methods in LoopInfo. NFC
Pete Cooper
peter_cooper at apple.com
Tue May 12 18:12:07 PDT 2015
Author: pete
Date: Tue May 12 20:12:06 2015
New Revision: 237223
URL: http://llvm.org/viewvc/llvm-project?rev=237223&view=rev
Log:
Constify arguments to methods in LoopInfo. NFC
Modified:
llvm/trunk/include/llvm/Analysis/LoopInfo.h
llvm/trunk/lib/Analysis/LoopInfo.cpp
Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=237223&r1=237222&r2=237223&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue May 12 20:12:06 2015
@@ -361,11 +361,11 @@ public:
/// isLoopInvariant - Return true if the specified value is loop invariant
///
- bool isLoopInvariant(Value *V) const;
+ bool isLoopInvariant(const Value *V) const;
/// hasLoopInvariantOperands - Return true if all the operands of the
/// specified instruction are loop invariant.
- bool hasLoopInvariantOperands(Instruction *I) const;
+ bool hasLoopInvariantOperands(const Instruction *I) const;
/// makeLoopInvariant - If the given value is an instruction inside of the
/// loop and it can be hoisted, do so to make it trivially loop-invariant.
Modified: llvm/trunk/lib/Analysis/LoopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopInfo.cpp?rev=237223&r1=237222&r2=237223&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopInfo.cpp Tue May 12 20:12:06 2015
@@ -56,15 +56,15 @@ static const char *const LoopMDName = "l
/// isLoopInvariant - Return true if the specified value is loop invariant
///
-bool Loop::isLoopInvariant(Value *V) const {
- if (Instruction *I = dyn_cast<Instruction>(V))
+bool Loop::isLoopInvariant(const Value *V) const {
+ if (const Instruction *I = dyn_cast<Instruction>(V))
return !contains(I);
return true; // All non-instructions are loop invariant
}
/// hasLoopInvariantOperands - Return true if all the operands of the
/// specified instruction are loop invariant.
-bool Loop::hasLoopInvariantOperands(Instruction *I) const {
+bool Loop::hasLoopInvariantOperands(const Instruction *I) const {
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
if (!isLoopInvariant(I->getOperand(i)))
return false;
More information about the llvm-commits
mailing list