[analysis] Constify CheckerContext.

llvm-svn: 144871
This commit is contained in:
Anna Zaks 2011-11-17 01:09:19 +00:00
parent 871606d8de
commit df6ca9fbee
2 changed files with 6 additions and 6 deletions

View File

@ -52,11 +52,11 @@ public:
/// the state of the program before the checker ran. Note, checkers should /// 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. /// not retain the node in their state since the nodes might get invalidated.
ExplodedNode *getPredecessor() { return Pred; } 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 /// \brief Returns the number of times the current block has been visited
/// along the analyzed path. /// along the analyzed path.
unsigned getCurrentBlockCount() { unsigned getCurrentBlockCount() const {
return NB.getContext().getCurrentBlockCount(); return NB.getContext().getCurrentBlockCount();
} }
@ -64,7 +64,7 @@ public:
return Eng.getContext(); return Eng.getContext();
} }
const LocationContext *getLocationContext() { const LocationContext *getLocationContext() const {
return Pred->getLocationContext(); return Pred->getLocationContext();
} }
@ -84,7 +84,7 @@ public:
return getSValBuilder().getSymbolManager(); return getSValBuilder().getSymbolManager();
} }
bool isObjCGCEnabled() { bool isObjCGCEnabled() const {
return Eng.isObjCGCEnabled(); return Eng.isObjCGCEnabled();
} }
@ -143,7 +143,7 @@ public:
} }
/// \brief Get the name of the called function (path-sensitive). /// \brief Get the name of the called function (path-sensitive).
StringRef getCalleeName(const CallExpr *CE); StringRef getCalleeName(const CallExpr *CE) const;
private: private:
ExplodedNode *addTransitionImpl(const ProgramState *State, ExplodedNode *addTransitionImpl(const ProgramState *State,

View File

@ -16,7 +16,7 @@
using namespace clang; using namespace clang;
using namespace ento; using namespace ento;
StringRef CheckerContext::getCalleeName(const CallExpr *CE) { StringRef CheckerContext::getCalleeName(const CallExpr *CE) const {
const ProgramState *State = getState(); const ProgramState *State = getState();
const Expr *Callee = CE->getCallee(); const Expr *Callee = CE->getCallee();
SVal L = State->getSVal(Callee); SVal L = State->getSVal(Callee);