Title says it all, this is pretty important. This is the last patch needed to ensure that the checker naming bug won't arise again.
Details
- Reviewers
NoQ george.karpenkov xazax.hun MTC baloghadamsoftware - Commits
- rG204bf2bbb265: [analyzer] Add CheckerManager::getChecker, make sure that a registry function…
rC352292: [analyzer] Add CheckerManager::getChecker, make sure that a registry function…
rL352292: [analyzer] Add CheckerManager::getChecker, make sure that a registry function…
Diff Detail
Event Timeline
Actually, ensuring that a registry function registers no more than one checker can be pulled off very easily -- the change required is so little, I added it to this patch. With that, the checker name bug is "officially" fixed.
Aha, ok, so what's the final procedure now to register a checker that's artificially split in two? Something like this, right?
def CommonModel : Checker<"Common">, HelpText<"Doesn't emit warnings but models common stuff.">; def SubChecker : Checker<"Sub">, HelpText<"Emits common warnings for the sub-stuff.">, Dependencies<[CommonModel]>;
void registerCommonModel(CheckerManager &Mgr) { Mgr.registerChecker<CommonModel>(); } void registerSubChecker(CheckerManager &Mgr) { CommonModel *Model = Mgr.getChecker<CommonModel>(); Model->EnableSubChecker = true; }
This looks quite usable to me.
test/Analysis/free.c | ||
---|---|---|
1 | When cleaning this stuff up, please feel free to drop -analyzer-store=region entirely (same for other options that allow only one value). |
Correct! But since I spent so much time with these files, and I don't expect maaajor changes to them in the foreseeable future, I'll take the time to properly document how the frontend of the analyzer (especially how checker registration) works. Maybe with the new sphinx format if it goes through by then, but any format is better than none.
When cleaning this stuff up, please feel free to drop -analyzer-store=region entirely (same for other options that allow only one value).