[PATCH] D53276: [analyzer][NFC] Fix some incorrect uses of -analyzer-config options

Umann Kristóf via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 25 10:21:34 PDT 2018


Szelethus updated this revision to Diff 171130.
Szelethus added a comment.

`RetainCountChecker` now gets it's option when registering, like every other checker.

`RetainCountChecker` stored a reference to `AnalyzerOptions`, evaluated an option during construction, and one later down the line. This hid an interesting problem when I made `IncludeAllocationLine` a checker-specific option: since checkers get their names //after// their construction, it looked for `-analyzer-config :IncludeAllocationLine=<val>` instead of `-analyzer-config osx.cocoa.RetainCount:IncludeAllocationLine=<val>`.

Another issue that helped this issue hide so well is that this option has no test associated with it, but that's an unrelated observation.


https://reviews.llvm.org/D53276

Files:
  include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
  lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp
  lib/StaticAnalyzer/Checkers/AllocationDiagnostics.h
  lib/StaticAnalyzer/Checkers/CMakeLists.txt
  lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
  lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp
  lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h
  lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
  lib/StaticAnalyzer/Core/RegionStore.cpp
  lib/StaticAnalyzer/Frontend/ModelInjector.cpp
  test/Analysis/analyzer-config.c
  test/Analysis/analyzer-config.cpp
  test/Analysis/cstring-plist.c
  test/Analysis/localization-aggressive.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53276.171130.patch
Type: text/x-patch
Size: 12378 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181025/af383270/attachment-0001.bin>


More information about the cfe-commits mailing list