protected:
friend class CallEventManager;
- CallEvent(const Expr *E, ProgramStateRef state, const LocationContext *lctx)
+ CallEvent(const Expr *E, const ProgramStateRef &state,
+ const LocationContext *lctx)
: State(state), LCtx(lctx), Origin(E), RefCount(0) {}
- CallEvent(const Decl *D, ProgramStateRef state, const LocationContext *lctx)
+ CallEvent(const Decl *D, const ProgramStateRef &state,
+ const LocationContext *lctx)
: State(state), LCtx(lctx), Origin(D), RefCount(0) {}
// DO NOT MAKE PUBLIC
}
/// \brief The state in which the call is being evaluated.
- ProgramStateRef getState() const {
+ const ProgramStateRef &getState() const {
return State;
}
/// 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; }
- ProgramStateRef getState() const { return Pred->getState(); }
+ const ProgramStateRef &getState() const { return Pred->getState(); }
/// \brief Check if the checker changed the state of the execution; ex: added
/// a new transition or a bug report.
public:
- explicit ExplodedNode(const ProgramPoint &loc, ProgramStateRef state,
+ explicit ExplodedNode(const ProgramPoint &loc, const ProgramStateRef &state,
bool IsSink)
: Location(loc), State(state), Succs(IsSink) {
assert(isSink() == IsSink);
return *getLocationContext()->getAnalysis<T>();
}
- ProgramStateRef getState() const { return State; }
+ const ProgramStateRef &getState() const { return State; }
template <typename T>
const T* getLocationAs() const LLVM_LVALUE_FUNCTION {