]> granicus.if.org Git - clang/commitdiff
AnalysisContext is not const.
authorZhongxing Xu <xuzhongxing@gmail.com>
Fri, 23 Jul 2010 02:49:07 +0000 (02:49 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Fri, 23 Jul 2010 02:49:07 +0000 (02:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109210 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/ProgramPoint.h
include/clang/Checker/PathSensitive/GRCoreEngine.h
lib/Checker/GRExprEngine.cpp

index 08e08f2ad0c6fd6695166476f89424a81c6b6a0d..c71c3059ff5b84f07616e4c1cd7986e09436ef03 100644 (file)
@@ -323,8 +323,9 @@ public:
     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) {
index c69ef70bef4df158d2fe310617d7a7a0ca4cd04c..90f6979b5392a4c566b628f75f5663ec10a94255 100644 (file)
@@ -464,7 +464,7 @@ class GRCallEnterNodeBuilder {
   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 @@ class GRCallEnterNodeBuilder {
 
 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 @@ public:
 
   const Stmt *getCallExpr() const { return CE; }
 
-  const AnalysisContext *getCalleeContext() const { return CalleeCtx; }
+  AnalysisContext *getCalleeContext() const { return CalleeCtx; }
 
   const CFGBlock *getBlock() const { return Block; }
 
index 364f06d46081235377d70cceb12b54017e44877b..fe45b7f013563e1ec10a3c32bbe13116955bc90a 100644 (file)
@@ -1445,7 +1445,7 @@ void GRExprEngine::ProcessSwitch(GRSwitchNodeBuilder& builder) {
 
 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(),