[all-commits] [llvm/llvm-project] ffe795: Reland "[analyzer] Deprecate `-analyzer-store regi...

Balazs Benics via All-commits all-commits at lists.llvm.org
Tue Jun 14 00:21:18 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ffe7950ebc62380c3afc7c71f454a1db3f6f5c76
      https://github.com/llvm/llvm-project/commit/ffe7950ebc62380c3afc7c71f454a1db3f6f5c76
  Author: Balazs Benics <balazs.benics at sigmatechnology.se>
  Date:   2022-06-14 (Tue, 14 Jun 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticDriverKinds.td
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Driver/Options.td
    M clang/include/clang/StaticAnalyzer/Core/Analyses.def
    M clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    M clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
    M clang/test/Analysis/CFNumber.c
    M clang/test/Analysis/CFRetainRelease_NSAssertionHandler.m
    M clang/test/Analysis/CGColorSpace.c
    M clang/test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp
    M clang/test/Analysis/NSPanel.m
    M clang/test/Analysis/NSString.m
    M clang/test/Analysis/NSWindow.m
    M clang/test/Analysis/OSAtomic_mac.cpp
    M clang/test/Analysis/PR3991.m
    M clang/test/Analysis/PR7218.c
    M clang/test/Analysis/analyzeOneFunction.m
    M clang/test/Analysis/array-struct.c
    M clang/test/Analysis/blocks.m
    M clang/test/Analysis/bool-assignment.c
    M clang/test/Analysis/bstring.cpp
    M clang/test/Analysis/casts.c
    M clang/test/Analysis/casts.cpp
    M clang/test/Analysis/casts.m
    M clang/test/Analysis/cfref_PR2519.c
    M clang/test/Analysis/cfref_rdar6080742.c
    M clang/test/Analysis/chroot.c
    M clang/test/Analysis/concrete-address.c
    M clang/test/Analysis/coverage.c
    M clang/test/Analysis/cstring-syntax-cxx.cpp
    M clang/test/Analysis/cxx-method-names.cpp
    M clang/test/Analysis/dead-stores.cpp
    M clang/test/Analysis/default-diagnostic-visitors.c
    M clang/test/Analysis/delegates.m
    A clang/test/Analysis/deprecated-flags-and-options.cpp
    M clang/test/Analysis/disable-all-checks.c
    M clang/test/Analysis/elementtype.c
    M clang/test/Analysis/fields.c
    M clang/test/Analysis/free.c
    M clang/test/Analysis/free.cpp
    M clang/test/Analysis/func.c
    M clang/test/Analysis/gmalloc.c
    M clang/test/Analysis/ivars.m
    M clang/test/Analysis/keychainAPI-diagnostic-visitor.m
    M clang/test/Analysis/localization-aggressive.m
    M clang/test/Analysis/localization.m
    M clang/test/Analysis/lvalue.cpp
    M clang/test/Analysis/malloc-annotations.c
    M clang/test/Analysis/malloc-annotations.cpp
    M clang/test/Analysis/malloc.c
    M clang/test/Analysis/malloc.m
    M clang/test/Analysis/method-call-intra-p.cpp
    M clang/test/Analysis/misc-ps-64.m
    M clang/test/Analysis/misc-ps-arm.m
    M clang/test/Analysis/misc-ps-eager-assume.m
    M clang/test/Analysis/misc-ps-ranges.m
    M clang/test/Analysis/misc-ps-region-store-i386.m
    M clang/test/Analysis/misc-ps-region-store-x86_64.m
    M clang/test/Analysis/misc-ps-region-store.cpp
    M clang/test/Analysis/misc-ps-region-store.m
    M clang/test/Analysis/misc-ps-region-store.mm
    M clang/test/Analysis/misc-ps.m
    M clang/test/Analysis/new-with-exceptions.cpp
    M clang/test/Analysis/new.cpp
    M clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m
    M clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
    M clang/test/Analysis/no-exit-cfg.c
    M clang/test/Analysis/no-outofbounds.c
    M clang/test/Analysis/null-deref-path-notes.m
    M clang/test/Analysis/null-deref-ps.c
    M clang/test/Analysis/nullptr.cpp
    M clang/test/Analysis/objc-boxing.m
    M clang/test/Analysis/objc-message.m
    M clang/test/Analysis/objc-subscript.m
    M clang/test/Analysis/outofbound-notwork.c
    M clang/test/Analysis/outofbound.c
    M clang/test/Analysis/override-werror.c
    M clang/test/Analysis/pr22954.c
    M clang/test/Analysis/pr4209.m
    M clang/test/Analysis/pr_2542_rdar_6793404.m
    M clang/test/Analysis/pr_4164.c
    M clang/test/Analysis/properties.m
    M clang/test/Analysis/properties.mm
    M clang/test/Analysis/ptr-arith.c
    M clang/test/Analysis/qt_malloc.cpp
    M clang/test/Analysis/range_casts.c
    M clang/test/Analysis/rdar-6442306-1.m
    M clang/test/Analysis/rdar-6541136-region.c
    M clang/test/Analysis/rdar-6562655.m
    M clang/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m
    M clang/test/Analysis/rdar-7168531.m
    M clang/test/Analysis/refcnt_naming.m
    M clang/test/Analysis/reference.cpp
    M clang/test/Analysis/region-1.m
    M clang/test/Analysis/retain-release-path-notes.m
    M clang/test/Analysis/retain-release-region-store.m
    M clang/test/Analysis/retain-release.mm
    M clang/test/Analysis/stack-addr-ps.c
    M clang/test/Analysis/stack-addr-ps.cpp
    M clang/test/Analysis/stack-block-returned.cpp
    M clang/test/Analysis/string-fail.c
    M clang/test/Analysis/undef-buffers.c
    M clang/test/Analysis/uninit-ps-rdar6145427.m
    M clang/test/Analysis/uninit-vals-union.c
    M clang/test/Analysis/uninit-vals.m
    M clang/test/Analysis/unions-region.m
    M clang/test/Analysis/unix-fns.c
    M clang/test/Analysis/valist-as-lazycompound.c
    M clang/test/Analysis/valist-uninitialized-no-undef.c
    M clang/test/Analysis/valist-unterminated.c
    M clang/test/Analysis/variadic-method-types.m
    M clang/test/Analysis/weak-functions.c

  Log Message:
  -----------
  Reland "[analyzer] Deprecate `-analyzer-store region` flag"

I'm trying to remove unused options from the `Analyses.def` file, then
merge the rest of the useful options into the `AnalyzerOptions.def`.
Then make sure one can set these by an `-analyzer-config XXX=YYY` style
flag.
Then surface the `-analyzer-config` to the `clang` frontend;

After all of this, we can pursue the tablegen approach described
https://discourse.llvm.org/t/rfc-tablegen-clang-static-analyzer-engine-options-for-better-documentation/61488

In this patch, I'm proposing flag deprecations.
We should support deprecated analyzer flags for exactly one release. In
this case I'm planning to drop this flag in `clang-16`.

In the clang frontend, now we won't pass this option to the cc1
frontend, rather emit a warning diagnostic reminding the users about
this deprecated flag, which will be turned into error in clang-16.

Unfortunately, I had to remove all the tests referring to this flag,
causing a mass change. I've also added a test for checking this warning.

I've seen that `scan-build` also uses this flag, but I think we should
remove that part only after we turn this into a hard error.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D126215




More information about the All-commits mailing list