[cfe-commits] r144871 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h lib/StaticAnalyzer/Core/CheckerContext.cpp

Anna Zaks ganna at apple.com
Wed Nov 16 17:09:20 PST 2011


Author: zaks
Date: Wed Nov 16 19:09:19 2011
New Revision: 144871

URL: http://llvm.org/viewvc/llvm-project?rev=144871&view=rev
Log:
[analysis] Constify CheckerContext.

Modified:
    cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
    cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp

Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h?rev=144871&r1=144870&r2=144871&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h Wed Nov 16 19:09:19 2011
@@ -52,11 +52,11 @@
   /// the state of the program before the checker ran. Note, checkers should
   /// not retain the node in their state since the nodes might get invalidated.
   ExplodedNode *getPredecessor() { return Pred; }
-  const ProgramState *getState() { return Pred->getState(); }
+  const ProgramState *getState() const { return Pred->getState(); }
 
   /// \brief Returns the number of times the current block has been visited
   /// along the analyzed path.
-  unsigned getCurrentBlockCount() {
+  unsigned getCurrentBlockCount() const {
     return NB.getContext().getCurrentBlockCount();
   }
 
@@ -64,7 +64,7 @@
     return Eng.getContext();
   }
   
-  const LocationContext *getLocationContext() {
+  const LocationContext *getLocationContext() const {
     return Pred->getLocationContext();
   }
 
@@ -84,7 +84,7 @@
     return getSValBuilder().getSymbolManager();
   }
 
-  bool isObjCGCEnabled() {
+  bool isObjCGCEnabled() const {
     return Eng.isObjCGCEnabled();
   }
 
@@ -143,7 +143,7 @@
   }
 
   /// \brief Get the name of the called function (path-sensitive).
-  StringRef getCalleeName(const CallExpr *CE);
+  StringRef getCalleeName(const CallExpr *CE) const;
 
 private:
   ExplodedNode *addTransitionImpl(const ProgramState *State,

Modified: cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp?rev=144871&r1=144870&r2=144871&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp Wed Nov 16 19:09:19 2011
@@ -16,7 +16,7 @@
 using namespace clang;
 using namespace ento;
 
-StringRef CheckerContext::getCalleeName(const CallExpr *CE) {
+StringRef CheckerContext::getCalleeName(const CallExpr *CE) const {
   const ProgramState *State = getState();
   const Expr *Callee = CE->getCallee();
   SVal L = State->getSVal(Callee);





More information about the cfe-commits mailing list