[cfe-dev] CFRefCount Problem #4: Hybrid GC
jediknil at belkadan.com
Thu Sep 1 19:12:52 CDT 2011
On Sep 1, 2011, at 13:42, Ted Kremenek wrote:
> I thought about this a bit over the last couple days. I really hate the idea of CheckerManager having any notion of this flag. It doesn't feel right at all. CheckerManager should just be managing checkers. It shouldn't be in the business of changing fundamental ways in how the checkers are run.
>> What I'm working with looks something like this:
>> AnalysisConsumer -> PDC -> [TU] -> [GC/non-GC] -> AnalysisManager/CheckerManager -> [Decl] -> ExprEngine
> Following on this, I had another thought (and I'm going to backpedal on what I said earlier). There is no need for all checkers to get rerun between GC/non-GC. For the non-ExprEngine analyses, we only need to call them once. They have access to the LangOptions, so if they want to do something GC-specific, they can.
> For the ExprEngine analyses, how about:
> AnalysisConsumer -> PDC -> [TU] -> AnalysisManager/CheckerManager -> [Decl] -> [GC/non-GC] -> ExprEngine
> We can just keep the flag in ExprEngine, and have CheckerContext consult that. At some point, all checker callbacks should have a CheckerContext object, so this eventually lead to a nice clean API. There is also no analysis waste here.
> The reason I prefer this approach is that ExprEngine is special when it comes to the hybrid GC mode. We *know* that GC-semantics can change how the whole analysis works, so we need to run it twice. Other non-ExprEngine analyses (if they care), can do the same thing.
That's pretty much what we do now with CFRefCount...though I guess it makes the GC mode available to other checkers. Shouldn't be too hard to implement.
More information about the cfe-dev