[PATCH] D49438: [analyzer][UninitializedObjectChecker] New flag to turn off dereferencing

Umann Kristóf via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 2 07:26:11 PDT 2018

Szelethus marked an inline comment as done.
Szelethus added inline comments.

Comment at: lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp:715
 void ento::registerUninitializedObjectChecker(CheckerManager &Mgr) {
   auto Chk = Mgr.registerChecker<UninitializedObjectChecker>();
   Chk->IsPedantic = Mgr.getAnalyzerOptions().getBooleanOption(
george.karpenkov wrote:
> `registerChecker` now passes through all arguments to the constructor.
> Could you pass the analyzer options to the constructor,
> and populate the fields from there?
>From an earlier conversation (D48285#inline-423489):
>[...]`getBooleanOption(StringRef, /*DefaultVal*/ bool, const ento::CheckerBase *)` depends on the constructed checker, so I don't think I can pull this off.
>There actually is a way to get boolean options without having to pass the checker as an argument, but then it wouldn't be a checker specific option:
>`-analyzer-config Pedantic=true`
>instead of
>`-analyzer-config alpha.cplusplus.UninitializedObject:Pedantic=true`

I did see your patch D49050, but since `CHECKER::name` is assigned a value after the checker's construction, I don't think it solves this particular problem.


More information about the cfe-commits mailing list