From b73279120d67817156717a1625207ee1bbf41477 Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Fri, 23 Jul 2010 02:49:07 +0000 Subject: [PATCH] AnalysisContext is not const. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109210 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Analysis/ProgramPoint.h | 5 +++-- include/clang/Checker/PathSensitive/GRCoreEngine.h | 6 +++--- lib/Checker/GRExprEngine.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h index 08e08f2ad0..c71c3059ff 100644 --- a/include/clang/Analysis/ProgramPoint.h +++ b/include/clang/Analysis/ProgramPoint.h @@ -323,8 +323,9 @@ public: return static_cast(getData1()); } - const AnalysisContext *getCalleeContext() const { - return static_cast(getData2()); + AnalysisContext *getCalleeContext() const { + return const_cast( + static_cast(getData2())); } static bool classof(const ProgramPoint *Location) { diff --git a/include/clang/Checker/PathSensitive/GRCoreEngine.h b/include/clang/Checker/PathSensitive/GRCoreEngine.h index c69ef70bef..90f6979b53 100644 --- a/include/clang/Checker/PathSensitive/GRCoreEngine.h +++ b/include/clang/Checker/PathSensitive/GRCoreEngine.h @@ -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; } diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp index 364f06d460..fe45b7f013 100644 --- a/lib/Checker/GRExprEngine.cpp +++ b/lib/Checker/GRExprEngine.cpp @@ -1445,7 +1445,7 @@ void GRExprEngine::ProcessSwitch(GRSwitchNodeBuilder& builder) { void GRExprEngine::ProcessCallEnter(GRCallEnterNodeBuilder &B) { const StackFrameContext *LocCtx - = AMgr.getStackFrame(const_cast(B.getCalleeContext()), + = AMgr.getStackFrame(B.getCalleeContext(), B.getLocationContext(), B.getCallExpr(), B.getBlock(), -- 2.50.1