[PATCH] D59195: [analyzer] Remove the default value arg from getChecker*Option

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 10 14:37:57 PDT 2019


Szelethus created this revision.
Szelethus added reviewers: NoQ, baloghadamsoftware, xazax.hun, rnkovacs.
Szelethus added a project: clang.
Herald added subscribers: cfe-commits, Charusso, jdoerfert, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity.
Herald added a reviewer: teemperor.

Since D57922 <https://reviews.llvm.org/D57922>, the config table contains every checker option, and it's default value, so having it as an argument for `getChecker*Option` is redundant.

By the time any of  the `getChecker*Option` function is called, we verified the value in `CheckerRegistry` (after D57860 <https://reviews.llvm.org/D57860>), so we can confidently assert here, as any irregularities detected at this point must be a programmer error. However, in compatibility mode, verification won't happen, so the default value must be restored.

This implies something else, other than adding removing one more potential point of failure -- `debug.ConfigDumper` will always contain valid values, and that's kinda nice :D


Repository:
  rC Clang

https://reviews.llvm.org/D59195

Files:
  include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
  lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp
  lib/StaticAnalyzer/Checkers/CloneChecker.cpp
  lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
  lib/StaticAnalyzer/Checkers/MallocChecker.cpp
  lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp
  lib/StaticAnalyzer/Checkers/MoveChecker.cpp
  lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
  lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp
  lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
  lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp
  lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
  lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
  lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
  test/Analysis/invalid-checker-option.c
  unittests/StaticAnalyzer/AnalyzerOptionsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59195.190025.patch
Type: text/x-patch
Size: 22617 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190310/d825dcf3/attachment-0001.bin>


More information about the cfe-commits mailing list