[cfe-commits] r109210 - in /cfe/trunk: include/clang/Analysis/ProgramPoint.h include/clang/Checker/PathSensitive/GRCoreEngine.h lib/Checker/GRExprEngine.cpp

Zhongxing Xu xuzhongxing at gmail.com
Thu Jul 22 19:49:07 PDT 2010


Author: zhongxingxu
Date: Thu Jul 22 21:49:07 2010
New Revision: 109210

URL: http://llvm.org/viewvc/llvm-project?rev=109210&view=rev
Log:
AnalysisContext is not const.

Modified:
    cfe/trunk/include/clang/Analysis/ProgramPoint.h
    cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h
    cfe/trunk/lib/Checker/GRExprEngine.cpp

Modified: cfe/trunk/include/clang/Analysis/ProgramPoint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/ProgramPoint.h?rev=109210&r1=109209&r2=109210&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/ProgramPoint.h (original)
+++ cfe/trunk/include/clang/Analysis/ProgramPoint.h Thu Jul 22 21:49:07 2010
@@ -323,8 +323,9 @@
     return static_cast<const Stmt *>(getData1());
   }
 
-  const AnalysisContext *getCalleeContext() const {
-    return static_cast<const AnalysisContext *>(getData2());
+  AnalysisContext *getCalleeContext() const {
+    return const_cast<AnalysisContext *>(
+                              static_cast<const AnalysisContext *>(getData2()));
   }
 
   static bool classof(const ProgramPoint *Location) {

Modified: cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h?rev=109210&r1=109209&r2=109210&view=diff
==============================================================================
--- cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h (original)
+++ cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h Thu Jul 22 21:49:07 2010
@@ -464,7 +464,7 @@
   const Stmt *CE;
 
   // The AnalysisContext of the callee.
-  const AnalysisContext *CalleeCtx;
+  AnalysisContext *CalleeCtx;
 
   // The parent block of the CallExpr.
   const CFGBlock *Block;
@@ -474,7 +474,7 @@
 
 public:
   GRCallEnterNodeBuilder(GRCoreEngine &eng, const ExplodedNode *pred, 
-                         const Stmt *s, const AnalysisContext *callee, 
+                         const Stmt *s, AnalysisContext *callee, 
                          const CFGBlock *blk, unsigned idx)
     : Eng(eng), Pred(pred), CE(s), CalleeCtx(callee), Block(blk), Index(idx) {}
 
@@ -486,7 +486,7 @@
 
   const Stmt *getCallExpr() const { return CE; }
 
-  const AnalysisContext *getCalleeContext() const { return CalleeCtx; }
+  AnalysisContext *getCalleeContext() const { return CalleeCtx; }
 
   const CFGBlock *getBlock() const { return Block; }
 

Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngine.cpp?rev=109210&r1=109209&r2=109210&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Checker/GRExprEngine.cpp Thu Jul 22 21:49:07 2010
@@ -1445,7 +1445,7 @@
 
 void GRExprEngine::ProcessCallEnter(GRCallEnterNodeBuilder &B) {
   const StackFrameContext *LocCtx 
-    = AMgr.getStackFrame(const_cast<AnalysisContext *>(B.getCalleeContext()),
+    = AMgr.getStackFrame(B.getCalleeContext(),
                          B.getLocationContext(),
                          B.getCallExpr(),
                          B.getBlock(),





More information about the cfe-commits mailing list