[cfe-commits] r127930 - in /cfe/trunk: include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h include/clang/Analysis/AnalysisContext.h lib/Analysis/AnalysisContext.cpp lib/Analysis/CFGReachabilityAnalysis.cpp lib/Sema/AnalysisBasedWarnings.cpp lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp

Ted Kremenek kremenek at apple.com
Fri Mar 18 18:00:33 PDT 2011


Author: kremenek
Date: Fri Mar 18 20:00:33 2011
New Revision: 127930

URL: http://llvm.org/viewvc/llvm-project?rev=127930&view=rev
Log:
Rename class 'CFGReachabilityAnalysis' to 'CFGReverseBlockReachabilityAnalysis'.

This rename serves two purposes:

- It reflects the actual functionality of this analysis.
- We will have more than one reachability analysis.

Modified:
    cfe/trunk/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h
    cfe/trunk/include/clang/Analysis/AnalysisContext.h
    cfe/trunk/lib/Analysis/AnalysisContext.cpp
    cfe/trunk/lib/Analysis/CFGReachabilityAnalysis.cpp
    cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
    cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp

Modified: cfe/trunk/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h?rev=127930&r1=127929&r2=127930&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h (original)
+++ cfe/trunk/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h Fri Mar 18 20:00:33 2011
@@ -29,13 +29,13 @@
 // tend to have a common destination, so we lazily do a predecessor search
 // from the destination node and cache the results to prevent work
 // duplication.
-class CFGReachabilityAnalysis {
+class CFGReverseBlockReachabilityAnalysis {
   typedef llvm::BitVector ReachableSet;
   typedef llvm::DenseMap<unsigned, ReachableSet> ReachableMap;
   ReachableSet analyzed;
   ReachableMap reachable;
 public:
-  CFGReachabilityAnalysis(const CFG &cfg);
+  CFGReverseBlockReachabilityAnalysis(const CFG &cfg);
 
   /// Returns true if the block 'Dst' can be reached from block 'Src'.
   bool isReachable(const CFGBlock *Src, const CFGBlock *Dst);

Modified: cfe/trunk/include/clang/Analysis/AnalysisContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/AnalysisContext.h?rev=127930&r1=127929&r2=127930&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/AnalysisContext.h (original)
+++ cfe/trunk/include/clang/Analysis/AnalysisContext.h Fri Mar 18 20:00:33 2011
@@ -28,7 +28,7 @@
 
 class Decl;
 class Stmt;
-class CFGReachabilityAnalysis;
+class CFGReverseBlockReachabilityAnalysis;
 class CFGStmtMap;
 class LiveVariables;
 class ParentMap;
@@ -60,7 +60,7 @@
   llvm::OwningPtr<LiveVariables> relaxedLiveness;
   llvm::OwningPtr<ParentMap> PM;
   llvm::OwningPtr<PseudoConstantAnalysis> PCA;
-  llvm::OwningPtr<CFGReachabilityAnalysis> CFA;
+  llvm::OwningPtr<CFGReverseBlockReachabilityAnalysis> CFA;
 
   llvm::BumpPtrAllocator A;
 
@@ -100,7 +100,7 @@
   
   CFGStmtMap *getCFGStmtMap();
 
-  CFGReachabilityAnalysis *getCFGReachablityAnalysis();
+  CFGReverseBlockReachabilityAnalysis *getCFGReachablityAnalysis();
   
   /// Return a version of the CFG without any edges pruned.
   CFG *getUnoptimizedCFG();

Modified: cfe/trunk/lib/Analysis/AnalysisContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/AnalysisContext.cpp?rev=127930&r1=127929&r2=127930&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/AnalysisContext.cpp (original)
+++ cfe/trunk/lib/Analysis/AnalysisContext.cpp Fri Mar 18 20:00:33 2011
@@ -132,12 +132,12 @@
   return 0;
 }
 
-CFGReachabilityAnalysis *AnalysisContext::getCFGReachablityAnalysis() {
+CFGReverseBlockReachabilityAnalysis *AnalysisContext::getCFGReachablityAnalysis() {
   if (CFA)
     return CFA.get();
   
   if (CFG *c = getCFG()) {
-    CFA.reset(new CFGReachabilityAnalysis(*c));
+    CFA.reset(new CFGReverseBlockReachabilityAnalysis(*c));
     return CFA.get();
   }
   

Modified: cfe/trunk/lib/Analysis/CFGReachabilityAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFGReachabilityAnalysis.cpp?rev=127930&r1=127929&r2=127930&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFGReachabilityAnalysis.cpp (original)
+++ cfe/trunk/lib/Analysis/CFGReachabilityAnalysis.cpp Fri Mar 18 20:00:33 2011
@@ -19,10 +19,10 @@
 
 using namespace clang;
 
-CFGReachabilityAnalysis::CFGReachabilityAnalysis(const CFG &cfg)
+CFGReverseBlockReachabilityAnalysis::CFGReverseBlockReachabilityAnalysis(const CFG &cfg)
   : analyzed(cfg.getNumBlockIDs(), false) {}
 
-bool CFGReachabilityAnalysis::isReachable(const CFGBlock *Src,
+bool CFGReverseBlockReachabilityAnalysis::isReachable(const CFGBlock *Src,
                                           const CFGBlock *Dst) {
 
   const unsigned DstBlockID = Dst->getBlockID();
@@ -39,7 +39,7 @@
 
 // Maps reachability to a common node by walking the predecessors of the
 // destination node.
-void CFGReachabilityAnalysis::mapReachability(const CFGBlock *Dst) {
+void CFGReverseBlockReachabilityAnalysis::mapReachability(const CFGBlock *Dst) {
   llvm::SmallVector<const CFGBlock *, 11> worklist;
   llvm::BitVector visited(analyzed.size());
   

Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=127930&r1=127929&r2=127930&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Fri Mar 18 20:00:33 2011
@@ -576,7 +576,7 @@
         if (const Stmt *stmt = i->stmt) {
           const CFGBlock *block = AC.getBlockForRegisteredExpression(stmt);
           assert(block);
-          if (CFGReachabilityAnalysis *cra = AC.getCFGReachablityAnalysis()) {
+          if (CFGReverseBlockReachabilityAnalysis *cra = AC.getCFGReachablityAnalysis()) {
             // Can this block be reached from the entrance?
             if (cra->isReachable(&AC.getCFG()->getEntry(), block))
               S.Diag(D.Loc, D.PD);

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp?rev=127930&r1=127929&r2=127930&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp Fri Mar 18 20:00:33 2011
@@ -531,7 +531,7 @@
                                                       const CFGBlock *CB,
                                                       const CoreEngine &CE) {
 
-  CFGReachabilityAnalysis *CRA = AC->getCFGReachablityAnalysis();
+  CFGReverseBlockReachabilityAnalysis *CRA = AC->getCFGReachablityAnalysis();
   
   // Test for reachability from any aborted blocks to this block
   typedef CoreEngine::BlocksAborted::const_iterator AbortedIterator;
@@ -556,10 +556,10 @@
   class VisitWL : public WorkList::Visitor {
     const CFGStmtMap *CBM;
     const CFGBlock *TargetBlock;
-    CFGReachabilityAnalysis &CRA;
+    CFGReverseBlockReachabilityAnalysis &CRA;
   public:
     VisitWL(const CFGStmtMap *cbm, const CFGBlock *targetBlock,
-            CFGReachabilityAnalysis &cra)
+            CFGReverseBlockReachabilityAnalysis &cra)
       : CBM(cbm), TargetBlock(targetBlock), CRA(cra) {}
     virtual bool visit(const WorkListUnit &U) {
       ProgramPoint P = U.getNode()->getLocation();





More information about the cfe-commits mailing list