[cfe-commits] r47935 - in /cfe/trunk/include/clang/Analysis: ProgramPoint.h Visitors/CFGStmtVisitor.h

Ted Kremenek kremenek at apple.com
Tue Mar 4 21:05:05 PST 2008


Author: kremenek
Date: Tue Mar  4 23:05:04 2008
New Revision: 47935

URL: http://llvm.org/viewvc/llvm-project?rev=47935&view=rev
Log:
Reverted patch 47926 for ProgramPoint.h because it is currently buggy.  May add back (fixed) later.
Updated CFGStmtVisitor to be in accord with rr47913: CallExprs are no longer (automatically) block-level expressions in the CFG.

Modified:
    cfe/trunk/include/clang/Analysis/ProgramPoint.h
    cfe/trunk/include/clang/Analysis/Visitors/CFGStmtVisitor.h

Modified: cfe/trunk/include/clang/Analysis/ProgramPoint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/ProgramPoint.h?rev=47935&r1=47934&r2=47935&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/ProgramPoint.h (original)
+++ cfe/trunk/include/clang/Analysis/ProgramPoint.h Tue Mar  4 23:05:04 2008
@@ -25,13 +25,8 @@
     
 class ProgramPoint {
 public:
-  enum Kind { LayeredNodeKind  =  0x0,
-              BlockEntranceKind = 0x1,
-              PostStmtKind      = 0x2,
-              BlockExitKind     = 0x3,
-              BlockEdgeSrcKind  = 0x5, // Skip 0x4.
-              BlockEdgeDstKind  = 0x6,
-              BlockEdgeAuxKind  = 0x7 }; 
+  enum Kind { BlockEntranceKind=0, PostStmtKind=1, BlockExitKind=2,
+              BlockEdgeSrcKind=3, BlockEdgeDstKind=4, BlockEdgeAuxKind=5 }; 
 protected:
   uintptr_t Data;
 
@@ -45,16 +40,8 @@
   ProgramPoint() : Data(0) {}
   
 public:    
-  
-  unsigned getKind() const { 
-    unsigned x = Data & 0x7;
-    return x & 0x3 ? x : 0;  // Use only lower 2 bits for 0x0.
-  }  
-  
-  void* getRawPtr() const {
-    return (void*) (getKind() ? Data & ~0x7 : Data & ~0x3);
-  }
-
+  unsigned getKind() const { return Data & 0x7; }  
+  void* getRawPtr() const { return reinterpret_cast<void*>(Data & ~0x7); }
   void* getRawData() const { return reinterpret_cast<void*>(Data); }
   
   static bool classof(const ProgramPoint*) { return true; }
@@ -66,27 +53,6 @@
     ID.AddPointer(getRawPtr());
   }    
 };
-  
-class ExplodedNodeImpl;
-template <typename StateTy> class ExplodedNode;
-  
-class LayeredNode : public ProgramPoint {
-public:
-  LayeredNode(ExplodedNodeImpl* N) : ProgramPoint(N, LayeredNodeKind) {
-    assert (reinterpret_cast<uintptr_t>(N) & 0x3 == 0 &&
-            "Address of ExplodedNode must have 4-byte alignment.");
-  }
-  
-  ExplodedNodeImpl* getNodeImpl() const {
-    return (ExplodedNodeImpl*) getRawPtr();
-  }
-
-  template <typename StateTy>
-  ExplodedNode<StateTy>* getNode() const {
-    return (ExplodedNode<StateTy>*) getRawPtr();
-  }
-
-};
                
 class BlockEntrance : public ProgramPoint {
 public:

Modified: cfe/trunk/include/clang/Analysis/Visitors/CFGStmtVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Visitors/CFGStmtVisitor.h?rev=47935&r1=47934&r2=47935&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/Visitors/CFGStmtVisitor.h (original)
+++ cfe/trunk/include/clang/Analysis/Visitors/CFGStmtVisitor.h Tue Mar  4 23:05:04 2008
@@ -65,7 +65,7 @@
     NullifyStmt cleanup(CurrentBlkStmt);
     
     switch (S->getStmtClass()) {
-      DISPATCH_CASE(CallExpr)
+
       DISPATCH_CASE(StmtExpr)
       DISPATCH_CASE(ConditionalOperator)
 
@@ -87,7 +87,6 @@
     }
   }
 
-  DEFAULT_BLOCKSTMT_VISIT(CallExpr)
   DEFAULT_BLOCKSTMT_VISIT(StmtExpr)
   DEFAULT_BLOCKSTMT_VISIT(ConditionalOperator)
   





More information about the cfe-commits mailing list