assert(getKind() == Alias);
return Data >> 2;
}
-
+
static RetEffect MakeAlias(unsigned Idx) { return RetEffect(Alias, Idx); }
static RetEffect MakeOwned() { return RetEffect(OwnedSymbol, 0); }
static bool isError(Kind k) { return k >= ErrorUseAfterRelease; }
+ bool isOwned() const {
+ return getKind() == Owned;
+ }
+
static RefVal makeOwned(unsigned Count = 0) {
return RefVal(Owned, Count);
}
CallExpr* CE, LVal L,
ExplodedNode<ValueState>* Pred);
+ // End-of-path.
+
+ virtual void EvalEndPath(GRExprEngine& Engine,
+ GREndPathNodeBuilder<ValueState>& Builder);
+
// Error iterators.
typedef UseAfterReleasesTy::iterator use_after_iterator;
Builder.MakeNode(Dst, CE, Pred, St);
}
+// End-of-path.
+
+void CFRefCount::EvalEndPath(GRExprEngine& Engine,
+ GREndPathNodeBuilder<ValueState>& Builder) {
+
+ RefBindings B = GetRefBindings(*Builder.getState());
+
+ // Scan the set of bindings for symbols that are in the Owned state.
+
+ for (RefBindings::iterator I = B.begin(), E = B.end(); I != E; ++I)
+ if ((*I).second.isOwned()) {
+
+ // FIXME: Register an error with the diagnostic engine. Since we
+ // don't have a Stmt* here, we need some extra machinery to get
+ // a sourcelocation.
+
+ }
+}
+
CFRefCount::RefBindings CFRefCount::Update(RefBindings B, SymbolID sym,
RefVal V, ArgEffect E,