[llvm] r188844 - Add some constantness.

Jakub Staszak kubastaszak at gmail.com
Tue Aug 20 16:04:15 PDT 2013


Author: kuba
Date: Tue Aug 20 18:04:15 2013
New Revision: 188844

URL: http://llvm.org/viewvc/llvm-project?rev=188844&view=rev
Log:
Add some constantness.

Modified:
    llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h
    llvm/trunk/include/llvm/Analysis/CFG.h
    llvm/trunk/lib/Analysis/CFG.cpp

Modified: llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h?rev=188844&r1=188843&r2=188844&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h (original)
+++ llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h Tue Aug 20 18:04:15 2013
@@ -118,7 +118,7 @@ class BlockFrequencyImpl {
 
   /// isBackedge - Return if edge Src -> Dst is a reachable backedge.
   ///
-  bool isBackedge(BlockT *Src, BlockT *Dst) {
+  bool isBackedge(BlockT *Src, BlockT *Dst) const {
     unsigned a = RPO.lookup(Src);
     if (!a)
       return false;

Modified: llvm/trunk/include/llvm/Analysis/CFG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CFG.h?rev=188844&r1=188843&r2=188844&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/CFG.h (original)
+++ llvm/trunk/include/llvm/Analysis/CFG.h Tue Aug 20 18:04:15 2013
@@ -65,7 +65,8 @@ bool isCriticalEdge(const TerminatorInst
 /// on branchy code but not loops, and LI is most useful on code with loops but
 /// does not help on branchy code outside loops.
 bool isPotentiallyReachable(const Instruction *From, const Instruction *To,
-                            DominatorTree *DT = 0, LoopInfo *LI = 0);
+                            const DominatorTree *DT = 0,
+                            const LoopInfo *LI = 0);
 
 /// \brief Determine whether block 'To' is reachable from 'From', returning
 /// true if uncertain.
@@ -74,7 +75,8 @@ bool isPotentiallyReachable(const Instru
 /// Returns false only if we can prove that once 'From' has been reached then
 /// 'To' can not be executed. Conservatively returns true.
 bool isPotentiallyReachable(const BasicBlock *From, const BasicBlock *To,
-                            DominatorTree *DT = 0, LoopInfo *LI = 0);
+                            const DominatorTree *DT = 0,
+                            const LoopInfo *LI = 0);
 
 } // End llvm namespace
 

Modified: llvm/trunk/lib/Analysis/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFG.cpp?rev=188844&r1=188843&r2=188844&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CFG.cpp (original)
+++ llvm/trunk/lib/Analysis/CFG.cpp Tue Aug 20 18:04:15 2013
@@ -116,7 +116,7 @@ bool llvm::isCriticalEdge(const Terminat
 
 // LoopInfo contains a mapping from basic block to the innermost loop. Find
 // the outermost loop in the loop nest that contains BB.
-static const Loop *getOutermostLoop(LoopInfo *LI, const BasicBlock *BB) {
+static const Loop *getOutermostLoop(const LoopInfo *LI, const BasicBlock *BB) {
   const Loop *L = LI->getLoopFor(BB);
   if (L) {
     while (const Loop *Parent = L->getParentLoop())
@@ -126,7 +126,7 @@ static const Loop *getOutermostLoop(Loop
 }
 
 // True if there is a loop which contains both BB1 and BB2.
-static bool loopContainsBoth(LoopInfo *LI,
+static bool loopContainsBoth(const LoopInfo *LI,
                              const BasicBlock *BB1, const BasicBlock *BB2) {
   const Loop *L1 = getOutermostLoop(LI, BB1);
   const Loop *L2 = getOutermostLoop(LI, BB2);
@@ -135,7 +135,8 @@ static bool loopContainsBoth(LoopInfo *L
 
 static bool isPotentiallyReachableInner(SmallVectorImpl<BasicBlock *> &Worklist,
                                         BasicBlock *StopBB,
-                                        DominatorTree *DT, LoopInfo *LI) {
+                                        const DominatorTree *DT,
+                                        const LoopInfo *LI) {
   // When the stop block is unreachable, it's dominated from everywhere,
   // regardless of whether there's a path between the two blocks.
   if (DT && !DT->isReachableFromEntry(StopBB))
@@ -179,7 +180,7 @@ static bool isPotentiallyReachableInner(
 }
 
 bool llvm::isPotentiallyReachable(const BasicBlock *A, const BasicBlock *B,
-                                  DominatorTree *DT, LoopInfo *LI) {
+                                  const DominatorTree *DT, const LoopInfo *LI) {
   assert(A->getParent() == B->getParent() &&
          "This analysis is function-local!");
 
@@ -191,7 +192,7 @@ bool llvm::isPotentiallyReachable(const
 }
 
 bool llvm::isPotentiallyReachable(const Instruction *A, const Instruction *B,
-                                  DominatorTree *DT, LoopInfo *LI) {
+                                  const DominatorTree *DT, const LoopInfo *LI) {
   assert(A->getParent()->getParent() == B->getParent()->getParent() &&
          "This analysis is function-local!");
 





More information about the llvm-commits mailing list