[cfe-dev] CFRefCount Problem #4: Hybrid GC

Jordy Rose jediknil at belkadan.com
Mon Aug 29 23:49:11 PDT 2011


On Aug 29, 2011, at 21:51, Ted Kremenek wrote:

>> My concern now is that storing the GC mode in the analysis context implies that it could change between code bodies.
> 
> By running the analysis twice, that's essentially what we are doing.
> 
> AnalysisContext implies just that: the "context" in which an analysis gets run.  No more and no less.  If GC is part of the context, that seems like a reasonable place to put it.
[snip]

>> Unfortunately, checker registration functions only have access to a CheckerManager. CheckerManager does have a LangOptions reference, so maybe the GC flag should be there?
> 
> What problem are you trying to solve?  Checkers conditionally registering themselves depending on whether GC is enabled?  They can check the LangOptions reference for that.  If the GC or GC-hybrid mode is in LangOptions, it means GC-checking will happen.

Ah. I was thinking something like this:

1. GC Disabled
a) create CheckerManager and register checkers
b) run non-path-sensitive analyses
c) run path-sensitive analyses
2. GC Enabled
a) create CheckerManager and register checkers
b) run non-path-sensitive analyses
c) run path-sensitive analyses

It sounds like you're thinking:

1. Create CheckerManager and register checkers
2. Mgr->setGCEnabled(true)
a) run non-path-sensitive analyses
b) run path-sensitive analyses
3. GC Enabled
a) run non-path-sensitive analyses
b) run path-sensitive analyses

...and then checkers check if GC is enabled every time it's interesting, instead of once at registration time.

I'm okay with this, but what's your reasoning for preferring it?

Jordy



More information about the cfe-dev mailing list