steakhal updated this revision to Diff 436124. steakhal added a comment. - Add the new `diag::warn_analyzer_deprecated_option` warning to the `"deprecated-static-analyzer-flag"` `DiagGroup` to prevent breaking the `clang/test/Misc/warning-flags.c` test file.
I'm also adding @thakis to review this change, prior to proceeding. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126215/new/ https://reviews.llvm.org/D126215 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/DiagnosticDriverKinds.td clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Driver/Options.td clang/include/clang/StaticAnalyzer/Core/Analyses.def clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h clang/lib/Driver/ToolChains/Clang.cpp clang/lib/Frontend/CompilerInvocation.cpp clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp clang/test/Analysis/CFNumber.c clang/test/Analysis/CFRetainRelease_NSAssertionHandler.m clang/test/Analysis/CGColorSpace.c clang/test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp clang/test/Analysis/NSPanel.m clang/test/Analysis/NSString.m clang/test/Analysis/NSWindow.m clang/test/Analysis/OSAtomic_mac.cpp clang/test/Analysis/PR3991.m clang/test/Analysis/PR7218.c clang/test/Analysis/analyzeOneFunction.m clang/test/Analysis/array-struct.c clang/test/Analysis/blocks.m clang/test/Analysis/bool-assignment.c clang/test/Analysis/bstring.cpp clang/test/Analysis/casts.c clang/test/Analysis/casts.cpp clang/test/Analysis/casts.m clang/test/Analysis/cfref_PR2519.c clang/test/Analysis/cfref_rdar6080742.c clang/test/Analysis/chroot.c clang/test/Analysis/concrete-address.c clang/test/Analysis/coverage.c clang/test/Analysis/cstring-syntax-cxx.cpp clang/test/Analysis/cxx-method-names.cpp clang/test/Analysis/dead-stores.cpp clang/test/Analysis/default-diagnostic-visitors.c clang/test/Analysis/delegates.m clang/test/Analysis/deprecated-flags-and-options.cpp clang/test/Analysis/disable-all-checks.c clang/test/Analysis/elementtype.c clang/test/Analysis/fields.c clang/test/Analysis/free.c clang/test/Analysis/free.cpp clang/test/Analysis/func.c clang/test/Analysis/gmalloc.c clang/test/Analysis/ivars.m clang/test/Analysis/keychainAPI-diagnostic-visitor.m clang/test/Analysis/localization-aggressive.m clang/test/Analysis/localization.m clang/test/Analysis/lvalue.cpp clang/test/Analysis/malloc-annotations.c clang/test/Analysis/malloc-annotations.cpp clang/test/Analysis/malloc.c clang/test/Analysis/malloc.m clang/test/Analysis/method-call-intra-p.cpp clang/test/Analysis/misc-ps-64.m clang/test/Analysis/misc-ps-arm.m clang/test/Analysis/misc-ps-eager-assume.m clang/test/Analysis/misc-ps-ranges.m clang/test/Analysis/misc-ps-region-store-i386.m clang/test/Analysis/misc-ps-region-store-x86_64.m clang/test/Analysis/misc-ps-region-store.cpp clang/test/Analysis/misc-ps-region-store.m clang/test/Analysis/misc-ps-region-store.mm clang/test/Analysis/misc-ps.m clang/test/Analysis/new-with-exceptions.cpp clang/test/Analysis/new.cpp clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m clang/test/Analysis/no-exit-cfg.c clang/test/Analysis/no-outofbounds.c clang/test/Analysis/null-deref-path-notes.m clang/test/Analysis/null-deref-ps.c clang/test/Analysis/nullptr.cpp clang/test/Analysis/objc-boxing.m clang/test/Analysis/objc-message.m clang/test/Analysis/objc-subscript.m clang/test/Analysis/outofbound-notwork.c clang/test/Analysis/outofbound.c clang/test/Analysis/override-werror.c clang/test/Analysis/pr22954.c clang/test/Analysis/pr4209.m clang/test/Analysis/pr_2542_rdar_6793404.m clang/test/Analysis/pr_4164.c clang/test/Analysis/properties.m clang/test/Analysis/properties.mm clang/test/Analysis/ptr-arith.c clang/test/Analysis/qt_malloc.cpp clang/test/Analysis/range_casts.c clang/test/Analysis/rdar-6442306-1.m clang/test/Analysis/rdar-6541136-region.c clang/test/Analysis/rdar-6562655.m clang/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m clang/test/Analysis/rdar-7168531.m clang/test/Analysis/refcnt_naming.m clang/test/Analysis/reference.cpp clang/test/Analysis/region-1.m clang/test/Analysis/retain-release-path-notes.m clang/test/Analysis/retain-release-region-store.m clang/test/Analysis/retain-release.mm clang/test/Analysis/stack-addr-ps.c clang/test/Analysis/stack-addr-ps.cpp clang/test/Analysis/stack-block-returned.cpp clang/test/Analysis/string-fail.c clang/test/Analysis/undef-buffers.c clang/test/Analysis/uninit-ps-rdar6145427.m clang/test/Analysis/uninit-vals-union.c clang/test/Analysis/uninit-vals.m clang/test/Analysis/unions-region.m clang/test/Analysis/unix-fns.c clang/test/Analysis/valist-as-lazycompound.c clang/test/Analysis/valist-uninitialized-no-undef.c clang/test/Analysis/valist-unterminated.c clang/test/Analysis/variadic-method-types.m clang/test/Analysis/weak-functions.c
Index: clang/test/Analysis/weak-functions.c =================================================================== --- clang/test/Analysis/weak-functions.c +++ clang/test/Analysis/weak-functions.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,debug.ExprInspection,unix.Malloc,unix.cstring,alpha.unix.cstring,unix.API,osx.API,osx.cocoa.RetainCount -Wno-null-dereference -Wno-tautological-compare -analyzer-store=region -fblocks -verify -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,debug.ExprInspection,unix.Malloc,unix.cstring,alpha.unix.cstring,unix.API,osx.API,osx.cocoa.RetainCount -Wno-null-dereference -Wno-tautological-compare -fblocks -verify -analyzer-config eagerly-assume=false %s #define NULL 0 void clang_analyzer_eval(int); void myFunc(void); Index: clang/test/Analysis/variadic-method-types.m =================================================================== --- clang/test/Analysis/variadic-method-types.m +++ clang/test/Analysis/variadic-method-types.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.cocoa.VariadicMethodTypes -analyzer-store=region -fblocks -verify %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.cocoa.VariadicMethodTypes -fblocks -verify %s //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from Index: clang/test/Analysis/valist-unterminated.c =================================================================== --- clang/test/Analysis/valist-unterminated.c +++ clang/test/Analysis/valist-unterminated.c @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -triple hexagon-unknown-linux -analyzer-checker=core,valist.Unterminated,valist.CopyToSelf -analyzer-output=text -analyzer-store=region -verify %s -// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core,valist.Unterminated,valist.CopyToSelf -analyzer-output=text -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -triple hexagon-unknown-linux -analyzer-checker=core,valist.Unterminated,valist.CopyToSelf -analyzer-output=text -verify %s +// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core,valist.Unterminated,valist.CopyToSelf -analyzer-output=text -verify %s #include "Inputs/system-header-simulator-for-valist.h" Index: clang/test/Analysis/valist-uninitialized-no-undef.c =================================================================== --- clang/test/Analysis/valist-uninitialized-no-undef.c +++ clang/test/Analysis/valist-uninitialized-no-undef.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core,valist.Uninitialized,valist.CopyToSelf -analyzer-output=text -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core,valist.Uninitialized,valist.CopyToSelf -analyzer-output=text -verify %s #include "Inputs/system-header-simulator-for-valist.h" Index: clang/test/Analysis/valist-as-lazycompound.c =================================================================== --- clang/test/Analysis/valist-as-lazycompound.c +++ clang/test/Analysis/valist-as-lazycompound.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple gcc-linaro-arm-linux-gnueabihf -analyzer-checker=core,valist.Uninitialized,valist.CopyToSelf -analyzer-output=text -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -triple gcc-linaro-arm-linux-gnueabihf -analyzer-checker=core,valist.Uninitialized,valist.CopyToSelf -analyzer-output=text -verify %s // expected-no-diagnostics typedef unsigned int size_t; Index: clang/test/Analysis/unix-fns.c =================================================================== --- clang/test/Analysis/unix-fns.c +++ clang/test/Analysis/unix-fns.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,unix.API,osx.API,optin.portability %s -analyzer-store=region -analyzer-output=plist -analyzer-config faux-bodies=true -fblocks -verify -o %t.plist +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,unix.API,osx.API,optin.portability %s -analyzer-output=plist -analyzer-config faux-bodies=true -fblocks -verify -o %t.plist // RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/unix-fns.c.plist - // RUN: mkdir -p %t.dir // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.API,osx.API,optin.portability -analyzer-output=html -analyzer-config faux-bodies=true -fblocks -o %t.dir %s Index: clang/test/Analysis/unions-region.m =================================================================== --- clang/test/Analysis/unions-region.m +++ clang/test/Analysis/unions-region.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region %s -verify +// RUN: %clang_analyze_cc1 -analyzer-checker=core %s -verify // expected-no-diagnostics //===-- unions-region.m ---------------------------------------------------===// Index: clang/test/Analysis/uninit-vals.m =================================================================== --- clang/test/Analysis/uninit-vals.m +++ clang/test/Analysis/uninit-vals.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-store=region -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-output=text -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-output=text -verify %s typedef unsigned int NSUInteger; typedef __typeof__(sizeof(int)) size_t; Index: clang/test/Analysis/uninit-vals-union.c =================================================================== --- clang/test/Analysis/uninit-vals-union.c +++ clang/test/Analysis/uninit-vals-union.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core.builtin -analyzer-store=region -verify -Wno-unused %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core.builtin -verify -Wno-unused %s typedef union { int y; Index: clang/test/Analysis/uninit-ps-rdar6145427.m =================================================================== --- clang/test/Analysis/uninit-ps-rdar6145427.m +++ clang/test/Analysis/uninit-ps-rdar6145427.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify -analyzer-store=region %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s // Delta-Debugging reduced preamble. typedef signed char BOOL; Index: clang/test/Analysis/undef-buffers.c =================================================================== --- clang/test/Analysis/undef-buffers.c +++ clang/test/Analysis/undef-buffers.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-store=region -verify %s \ +// RUN: %clang_analyze_cc1 -verify %s \ // RUN: -analyzer-checker=core \ // RUN: -analyzer-checker=unix \ // RUN: -analyzer-checker=core.uninitialized \ Index: clang/test/Analysis/string-fail.c =================================================================== --- clang/test/Analysis/string-fail.c +++ clang/test/Analysis/string-fail.c @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s -// RUN: %clang_analyze_cc1 -DUSE_BUILTINS -analyzer-checker=core,unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.cstring,debug.ExprInspection -verify %s +// RUN: %clang_analyze_cc1 -DUSE_BUILTINS -analyzer-checker=core,unix.cstring,debug.ExprInspection -verify %s // XFAIL: * // This file is for tests that may eventually go into string.c, or may be Index: clang/test/Analysis/stack-block-returned.cpp =================================================================== --- clang/test/Analysis/stack-block-returned.cpp +++ clang/test/Analysis/stack-block-returned.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -fblocks -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core -fblocks -verify %s typedef void (^bptr)(void); Index: clang/test/Analysis/stack-addr-ps.cpp =================================================================== --- clang/test/Analysis/stack-addr-ps.cpp +++ clang/test/Analysis/stack-addr-ps.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -verify %s -Wno-undefined-bool-conversion +// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s -Wno-undefined-bool-conversion typedef __INTPTR_TYPE__ intptr_t; Index: clang/test/Analysis/stack-addr-ps.c =================================================================== --- clang/test/Analysis/stack-addr-ps.c +++ clang/test/Analysis/stack-addr-ps.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -fblocks -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core -fblocks -verify %s int* f1(void) { int x = 0; Index: clang/test/Analysis/retain-release.mm =================================================================== --- clang/test/Analysis/retain-release.mm +++ clang/test/Analysis/retain-release.mm @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fblocks -verify %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -fblocks -verify %s #if __has_feature(attribute_ns_returns_retained) #define NS_RETURNS_RETAINED __attribute__((ns_returns_retained)) Index: clang/test/Analysis/retain-release-region-store.m =================================================================== --- clang/test/Analysis/retain-release-region-store.m +++ clang/test/Analysis/retain-release-region-store.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple %itanium_abi_triple -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -analyzer-max-loop 6 -verify %s +// RUN: %clang_analyze_cc1 -triple %itanium_abi_triple -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-max-loop 6 -verify %s //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from Index: clang/test/Analysis/retain-release-path-notes.m =================================================================== --- clang/test/Analysis/retain-release-path-notes.m +++ clang/test/Analysis/retain-release-path-notes.m @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=text -verify %s -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=plist-multi-file %s -o %t +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-output=text -verify %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-output=plist-multi-file %s -o %t // RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/retain-release-path-notes.m.plist - /*** Index: clang/test/Analysis/region-1.m =================================================================== --- clang/test/Analysis/region-1.m +++ clang/test/Analysis/region-1.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify %s // expected-no-diagnostics // // This test case simply should not crash. It evaluates the logic of not Index: clang/test/Analysis/reference.cpp =================================================================== --- clang/test/Analysis/reference.cpp +++ clang/test/Analysis/reference.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -Wno-null-dereference -Wno-tautological-undefined-compare -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -Wno-null-dereference -Wno-tautological-undefined-compare -analyzer-config eagerly-assume=false %s void clang_analyzer_eval(bool); Index: clang/test/Analysis/refcnt_naming.m =================================================================== --- clang/test/Analysis/refcnt_naming.m +++ clang/test/Analysis/refcnt_naming.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-config ipa=none -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-config ipa=none -verify %s typedef const struct __CFString * CFStringRef; typedef const struct __CFAllocator * CFAllocatorRef; Index: clang/test/Analysis/rdar-7168531.m =================================================================== --- clang/test/Analysis/rdar-7168531.m +++ clang/test/Analysis/rdar-7168531.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -triple i386-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -analyzer-store=region %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -triple i386-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 %s // Note that the target triple is important for this test case. It specifies that we use the // fragile Objective-C ABI. Index: clang/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m =================================================================== --- clang/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m +++ clang/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify -Wno-objc-root-class %s // expected-no-diagnostics typedef struct Foo { int x; } Bar; Index: clang/test/Analysis/rdar-6562655.m =================================================================== --- clang/test/Analysis/rdar-6562655.m +++ clang/test/Analysis/rdar-6562655.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -verify %s // expected-no-diagnostics // // This test case mainly checks that the retain/release checker doesn't crash Index: clang/test/Analysis/rdar-6541136-region.c =================================================================== --- clang/test/Analysis/rdar-6541136-region.c +++ clang/test/Analysis/rdar-6541136-region.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -verify -analyzer-checker=core,alpha.security.ArrayBound -analyzer-store=region %s +// RUN: %clang_analyze_cc1 -verify -analyzer-checker=core,alpha.security.ArrayBound %s struct tea_cheese { unsigned magic; }; typedef struct tea_cheese kernel_tea_cheese_t; Index: clang/test/Analysis/rdar-6442306-1.m =================================================================== --- clang/test/Analysis/rdar-6442306-1.m +++ clang/test/Analysis/rdar-6442306-1.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-disable-checker=alpha.core.PointerArithm %s -analyzer-store=region -verify +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-disable-checker=alpha.core.PointerArithm %s -verify // expected-no-diagnostics typedef int bar_return_t; Index: clang/test/Analysis/range_casts.c =================================================================== --- clang/test/Analysis/range_casts.c +++ clang/test/Analysis/range_casts.c @@ -1,5 +1,5 @@ // This test checks that intersecting ranges does not cause 'system is over constrained' assertions in the case of eg: 32 bits unsigned integers getting their range from 64 bits signed integers. -// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core,debug.ExprInspection -verify %s void clang_analyzer_warnIfReached(void); Index: clang/test/Analysis/qt_malloc.cpp =================================================================== --- clang/test/Analysis/qt_malloc.cpp +++ clang/test/Analysis/qt_malloc.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,cplusplus -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,cplusplus -verify %s // expected-no-diagnostics #include "Inputs/qt-simulator.h" Index: clang/test/Analysis/ptr-arith.c =================================================================== --- clang/test/Analysis/ptr-arith.c +++ clang/test/Analysis/ptr-arith.c @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,debug.ExprInspection -analyzer-store=region -Wno-pointer-to-int-cast -verify -triple x86_64-apple-darwin9 -Wno-tautological-pointer-compare -analyzer-config eagerly-assume=false %s -// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,debug.ExprInspection -analyzer-store=region -Wno-pointer-to-int-cast -verify -triple i686-apple-darwin9 -Wno-tautological-pointer-compare -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,debug.ExprInspection -Wno-pointer-to-int-cast -verify -triple x86_64-apple-darwin9 -Wno-tautological-pointer-compare -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,debug.ExprInspection -Wno-pointer-to-int-cast -verify -triple i686-apple-darwin9 -Wno-tautological-pointer-compare -analyzer-config eagerly-assume=false %s void clang_analyzer_eval(int); void clang_analyzer_dump(int); Index: clang/test/Analysis/properties.mm =================================================================== --- clang/test/Analysis/properties.mm +++ clang/test/Analysis/properties.mm @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class -fobjc-arc %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,debug.ExprInspection -verify -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,debug.ExprInspection -verify -Wno-objc-root-class -fobjc-arc %s void clang_analyzer_eval(bool); void clang_analyzer_checkInlined(bool); Index: clang/test/Analysis/properties.m =================================================================== --- clang/test/Analysis/properties.m +++ clang/test/Analysis/properties.m @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.Dealloc,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class -analyzer-config eagerly-assume=false %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.Dealloc,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class -fobjc-arc -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.Dealloc,debug.ExprInspection -verify -Wno-objc-root-class -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.Dealloc,debug.ExprInspection -verify -Wno-objc-root-class -fobjc-arc -analyzer-config eagerly-assume=false %s void clang_analyzer_eval(int); Index: clang/test/Analysis/pr_4164.c =================================================================== --- clang/test/Analysis/pr_4164.c +++ clang/test/Analysis/pr_4164.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core -verify %s // expected-no-diagnostics // PR 4164: http://llvm.org/bugs/show_bug.cgi?id=4164 Index: clang/test/Analysis/pr_2542_rdar_6793404.m =================================================================== --- clang/test/Analysis/pr_2542_rdar_6793404.m +++ clang/test/Analysis/pr_2542_rdar_6793404.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -pedantic -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -pedantic -verify -Wno-objc-root-class %s // BEGIN delta-debugging reduced header stuff Index: clang/test/Analysis/pr4209.m =================================================================== --- clang/test/Analysis/pr4209.m +++ clang/test/Analysis/pr4209.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-incomplete-implementation -verify %s +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core -Wno-incomplete-implementation -verify %s // This test case was crashing due to how CFRefCount.cpp resolved the // ObjCInterfaceDecl* and ClassName in EvalObjCMessageExpr. Index: clang/test/Analysis/pr22954.c =================================================================== --- clang/test/Analysis/pr22954.c +++ clang/test/Analysis/pr22954.c @@ -3,7 +3,7 @@ // At the moment the whole of the destination array content is invalidated. // If a.s1 region has a symbolic offset, the whole region of 'a' is invalidated. // Specific triple set to test structures of size 0. -// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-store=region -verify -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core,unix.Malloc,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s typedef __typeof(sizeof(int)) size_t; Index: clang/test/Analysis/override-werror.c =================================================================== --- clang/test/Analysis/override-werror.c +++ clang/test/Analysis/override-werror.c @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -Werror %s -analyzer-store=region -verify -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -Werror %s -analyzer-store=region -analyzer-werror -verify=werror +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -Werror %s -verify +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -Werror %s -analyzer-werror -verify=werror // This test case illustrates that using '-analyze' overrides the effect of // -Werror. This allows basic warnings not to interfere with producing Index: clang/test/Analysis/outofbound.c =================================================================== --- clang/test/Analysis/outofbound.c +++ clang/test/Analysis/outofbound.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -analyzer-store=region -verify %s \ +// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ // RUN: -analyzer-checker=core \ // RUN: -analyzer-checker=unix \ // RUN: -analyzer-checker=alpha.security.ArrayBound \ Index: clang/test/Analysis/outofbound-notwork.c =================================================================== --- clang/test/Analysis/outofbound-notwork.c +++ clang/test/Analysis/outofbound-notwork.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -analyzer-checker=core,alpha.security.ArrayBound -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -Wno-array-bounds -analyzer-checker=core,alpha.security.ArrayBound -verify %s // XFAIL: * // Once we better handle modeling of sizes of VLAs, we can pull this back Index: clang/test/Analysis/objc-subscript.m =================================================================== --- clang/test/Analysis/objc-subscript.m +++ clang/test/Analysis/objc-subscript.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount -verify -Wno-objc-root-class %s typedef signed char BOOL; typedef unsigned int NSUInteger; Index: clang/test/Analysis/objc-message.m =================================================================== --- clang/test/Analysis/objc-message.m +++ clang/test/Analysis/objc-message.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify -Wno-objc-root-class %s extern void clang_analyzer_warnIfReached(void); void clang_analyzer_eval(int); Index: clang/test/Analysis/objc-boxing.m =================================================================== --- clang/test/Analysis/objc-boxing.m +++ clang/test/Analysis/objc-boxing.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -Wno-objc-literal-conversion -analyzer-checker=core,unix.Malloc,osx.cocoa.NonNilReturnValue,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -Wno-objc-literal-conversion -analyzer-checker=core,unix.Malloc,osx.cocoa.NonNilReturnValue,debug.ExprInspection -verify %s void clang_analyzer_eval(int); Index: clang/test/Analysis/nullptr.cpp =================================================================== --- clang/test/Analysis/nullptr.cpp +++ clang/test/Analysis/nullptr.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -std=c++11 -Wno-conversion-null -analyzer-checker=core,debug.ExprInspection -analyzer-store region -analyzer-output=text -verify %s +// RUN: %clang_analyze_cc1 -std=c++11 -Wno-conversion-null -analyzer-checker=core,debug.ExprInspection -analyzer-output=text -verify %s void clang_analyzer_eval(int); Index: clang/test/Analysis/null-deref-ps.c =================================================================== --- clang/test/Analysis/null-deref-ps.c +++ clang/test/Analysis/null-deref-ps.c @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -Wno-strict-prototypes -Wno-tautological-constant-compare -Wtautological-unsigned-zero-compare -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -analyzer-store=region -analyzer-purge=none -verify %s -Wno-error=return-type -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -Wno-strict-prototypes -Wno-tautological-constant-compare -Wtautological-unsigned-zero-compare -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -analyzer-store=region -verify %s -Wno-error=return-type +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -Wno-strict-prototypes -Wno-tautological-constant-compare -Wtautological-unsigned-zero-compare -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -analyzer-purge=none -verify %s -Wno-error=return-type +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -Wno-strict-prototypes -Wno-tautological-constant-compare -Wtautological-unsigned-zero-compare -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -verify %s -Wno-error=return-type typedef unsigned uintptr_t; Index: clang/test/Analysis/null-deref-path-notes.m =================================================================== --- clang/test/Analysis/null-deref-path-notes.m +++ clang/test/Analysis/null-deref-path-notes.m @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -analyzer-output=text -fblocks -verify -Wno-objc-root-class %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -analyzer-output=plist-multi-file -fblocks -Wno-objc-root-class %s -o %t +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -fblocks -verify -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -fblocks -Wno-objc-root-class %s -o %t // RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/null-deref-path-notes.m.plist - @interface Root { Index: clang/test/Analysis/no-outofbounds.c =================================================================== --- clang/test/Analysis/no-outofbounds.c +++ clang/test/Analysis/no-outofbounds.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,alpha.unix,alpha.security.ArrayBound -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,alpha.unix,alpha.security.ArrayBound -verify %s // expected-no-diagnostics //===----------------------------------------------------------------------===// Index: clang/test/Analysis/no-exit-cfg.c =================================================================== --- clang/test/Analysis/no-exit-cfg.c +++ clang/test/Analysis/no-exit-cfg.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify %s // expected-no-diagnostics // This is a test case for the issue reported in PR 2819: Index: clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m =================================================================== --- clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m +++ clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m @@ -1,8 +1,8 @@ -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin8 -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-objc-root-class %s > %t.1 2>&1 +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin8 -analyzer-checker=core,alpha.core -Wno-objc-root-class %s > %t.1 2>&1 // RUN: FileCheck -input-file=%t.1 -check-prefix=CHECK-darwin8 %s -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-objc-root-class %s > %t.2 2>&1 +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core -Wno-objc-root-class %s > %t.2 2>&1 // RUN: FileCheck -input-file=%t.2 -check-prefix=CHECK-darwin9 %s -// RUN: %clang_analyze_cc1 -triple thumbv6-apple-ios4.0 -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-objc-root-class %s > %t.3 2>&1 +// RUN: %clang_analyze_cc1 -triple thumbv6-apple-ios4.0 -analyzer-checker=core,alpha.core -Wno-objc-root-class %s > %t.3 2>&1 // RUN: FileCheck -input-file=%t.3 -check-prefix=CHECK-darwin9 %s @interface MyClass {} Index: clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m =================================================================== --- clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m +++ clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin8 -analyzer-checker=core,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin8 -analyzer-checker=core,alpha.core -verify -Wno-objc-root-class %s // <rdar://problem/6888289> - This test case shows that a nil instance // variable can possibly be initialized by a method. Index: clang/test/Analysis/new.cpp =================================================================== --- clang/test/Analysis/new.cpp +++ clang/test/Analysis/new.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-store region -std=c++11 -verify -analyzer-config eagerly-assume=false %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-store region -std=c++11 -DTEST_INLINABLE_ALLOCATORS -verify -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -std=c++11 -verify -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -std=c++11 -DTEST_INLINABLE_ALLOCATORS -verify -analyzer-config eagerly-assume=false %s #include "Inputs/system-header-simulator-cxx.h" void clang_analyzer_eval(bool); Index: clang/test/Analysis/new-with-exceptions.cpp =================================================================== --- clang/test/Analysis/new-with-exceptions.cpp +++ clang/test/Analysis/new-with-exceptions.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-store region -std=c++11 -fexceptions -fcxx-exceptions -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-store region -std=c++11 -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -std=c++11 -fexceptions -fcxx-exceptions -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -std=c++11 -verify %s void clang_analyzer_eval(bool); Index: clang/test/Analysis/misc-ps.m =================================================================== --- clang/test/Analysis/misc-ps.m +++ clang/test/Analysis/misc-ps.m @@ -1,6 +1,6 @@ // NOTE: Use '-fobjc-gc' to test the analysis being run twice, and multiple reports are not issued. -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -analyzer-store=region -Wno-strict-prototypes -Wno-pointer-to-int-cast -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -analyzer-store=region -Wno-strict-prototypes -Wno-pointer-to-int-cast -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -Wno-strict-prototypes -Wno-pointer-to-int-cast -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -Wno-strict-prototypes -Wno-pointer-to-int-cast -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s #ifndef __clang_analyzer__ #error __clang_analyzer__ not defined Index: clang/test/Analysis/misc-ps-region-store.mm =================================================================== --- clang/test/Analysis/misc-ps-region-store.mm +++ clang/test/Analysis/misc-ps-region-store.mm @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core -verify -fblocks -analyzer-opt-analyze-nested-blocks %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core -verify -fblocks -analyzer-opt-analyze-nested-blocks %s // expected-no-diagnostics //===------------------------------------------------------------------------------------------===// Index: clang/test/Analysis/misc-ps-region-store.m =================================================================== --- clang/test/Analysis/misc-ps-region-store.m +++ clang/test/Analysis/misc-ps-region-store.m @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core.CastToStruct,alpha.security.ReturnPtrRange,alpha.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class -Wno-strict-prototypes -Wno-error=implicit-function-declaration %s -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -DTEST_64 -analyzer-checker=core,alpha.core.CastToStruct,alpha.security.ReturnPtrRange,alpha.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class -Wno-strict-prototypes -Wno-error=implicit-function-declaration %s +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core.CastToStruct,alpha.security.ReturnPtrRange,alpha.security.ArrayBound -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class -Wno-strict-prototypes -Wno-error=implicit-function-declaration %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -DTEST_64 -analyzer-checker=core,alpha.core.CastToStruct,alpha.security.ReturnPtrRange,alpha.security.ArrayBound -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class -Wno-strict-prototypes -Wno-error=implicit-function-declaration %s typedef long unsigned int size_t; void *memcpy(void *, const void *, size_t); Index: clang/test/Analysis/misc-ps-region-store.cpp =================================================================== --- clang/test/Analysis/misc-ps-region-store.cpp +++ clang/test/Analysis/misc-ps-region-store.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -fexceptions -fcxx-exceptions -Wno-tautological-undefined-compare -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -fexceptions -fcxx-exceptions -Wno-tautological-undefined-compare +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -fexceptions -fcxx-exceptions -Wno-tautological-undefined-compare +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -fexceptions -fcxx-exceptions -Wno-tautological-undefined-compare void clang_analyzer_warnIfReached(); Index: clang/test/Analysis/misc-ps-region-store-x86_64.m =================================================================== --- clang/test/Analysis/misc-ps-region-store-x86_64.m +++ clang/test/Analysis/misc-ps-region-store-x86_64.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core -verify -fblocks %s // expected-no-diagnostics // Here is a case where a pointer is treated as integer, invalidated as an Index: clang/test/Analysis/misc-ps-region-store-i386.m =================================================================== --- clang/test/Analysis/misc-ps-region-store-i386.m +++ clang/test/Analysis/misc-ps-region-store-i386.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core -verify -fblocks %s // expected-no-diagnostics // Here is a case where a pointer is treated as integer, invalidated as an Index: clang/test/Analysis/misc-ps-ranges.m =================================================================== --- clang/test/Analysis/misc-ps-ranges.m +++ clang/test/Analysis/misc-ps-ranges.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify -fblocks %s // <rdar://problem/6776949> // main's 'argc' argument is always > 0 Index: clang/test/Analysis/misc-ps-eager-assume.m =================================================================== --- clang/test/Analysis/misc-ps-eager-assume.m +++ clang/test/Analysis/misc-ps-eager-assume.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify -fblocks %s // expected-no-diagnostics // Delta-reduced header stuff (needed for test cases). @@ -125,8 +125,8 @@ //===---------------------------------------------------------------------===// // PR 5627 - http://llvm.org/bugs/show_bug.cgi?id=5627 -// This test case depends on using -analyzer-config eagerly-assume=true and -// -analyzer-store=region. The 'eagerly-assume=true' causes the path +// This test case depends on using -analyzer-config eagerly-assume=true. +// The 'eagerly-assume=true' causes the path // to bifurcate when evaluating the function call argument, and a state // caching bug in ExprEngine::CheckerVisit (and friends) caused the store // to 'p' to not be evaluated along one path, but then an autotransition caused Index: clang/test/Analysis/misc-ps-arm.m =================================================================== --- clang/test/Analysis/misc-ps-arm.m +++ clang/test/Analysis/misc-ps-arm.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple thumbv7-apple-ios0.0.0 -target-feature +neon -analyzer-checker=core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -triple thumbv7-apple-ios0.0.0 -target-feature +neon -analyzer-checker=core -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s // expected-no-diagnostics // <rdar://problem/11405978> - Handle casts of vectors to structs, and loading Index: clang/test/Analysis/misc-ps-64.m =================================================================== --- clang/test/Analysis/misc-ps-64.m +++ clang/test/Analysis/misc-ps-64.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core -verify -fblocks %s // expected-no-diagnostics // <rdar://problem/6440393> - A bunch of misc. failures involving evaluating Index: clang/test/Analysis/method-call-intra-p.cpp =================================================================== --- clang/test/Analysis/method-call-intra-p.cpp +++ clang/test/Analysis/method-call-intra-p.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s // expected-no-diagnostics // Intra-procedural C++ tests. Index: clang/test/Analysis/malloc.m =================================================================== --- clang/test/Analysis/malloc.m +++ clang/test/Analysis/malloc.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -Wno-objc-root-class -fblocks %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc -verify -Wno-objc-root-class -fblocks %s #include "Inputs/system-header-simulator-objc.h" @class NSString; Index: clang/test/Analysis/malloc.c =================================================================== --- clang/test/Analysis/malloc.c +++ clang/test/Analysis/malloc.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -Wno-strict-prototypes -Wno-error=implicit-int -analyzer-store=region -verify %s \ +// RUN: %clang_analyze_cc1 -Wno-strict-prototypes -Wno-error=implicit-int -verify %s \ // RUN: -analyzer-checker=core \ // RUN: -analyzer-checker=alpha.deadcode.UnreachableCode \ // RUN: -analyzer-checker=alpha.core.CastSize \ Index: clang/test/Analysis/malloc-annotations.cpp =================================================================== --- clang/test/Analysis/malloc-annotations.cpp +++ clang/test/Analysis/malloc-annotations.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-store=region -verify \ +// RUN: %clang_analyze_cc1 -verify \ // RUN: -analyzer-checker=core \ // RUN: -analyzer-checker=alpha.deadcode.UnreachableCode \ // RUN: -analyzer-checker=alpha.core.CastSize \ Index: clang/test/Analysis/malloc-annotations.c =================================================================== --- clang/test/Analysis/malloc-annotations.c +++ clang/test/Analysis/malloc-annotations.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-store=region -verify \ +// RUN: %clang_analyze_cc1 -verify \ // RUN: -analyzer-checker=core \ // RUN: -analyzer-checker=alpha.deadcode.UnreachableCode \ // RUN: -analyzer-checker=alpha.core.CastSize \ Index: clang/test/Analysis/lvalue.cpp =================================================================== --- clang/test/Analysis/lvalue.cpp +++ clang/test/Analysis/lvalue.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s // expected-no-diagnostics int f1() { Index: clang/test/Analysis/localization.m =================================================================== --- clang/test/Analysis/localization.m +++ clang/test/Analysis/localization.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -fblocks -analyzer-store=region -analyzer-output=text -analyzer-checker=optin.osx.cocoa.localizability.NonLocalizedStringChecker -analyzer-checker=alpha.osx.cocoa.localizability.PluralMisuseChecker -verify %s +// RUN: %clang_analyze_cc1 -fblocks -analyzer-output=text -analyzer-checker=optin.osx.cocoa.localizability.NonLocalizedStringChecker -analyzer-checker=alpha.osx.cocoa.localizability.PluralMisuseChecker -verify %s // The larger set of tests in located in localization.m. These are tests // specific for non-aggressive reporting. Index: clang/test/Analysis/localization-aggressive.m =================================================================== --- clang/test/Analysis/localization-aggressive.m +++ clang/test/Analysis/localization-aggressive.m @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fblocks -x objective-c-header -emit-pch -o %t.pch %S/Inputs/localization-pch.h -// RUN: %clang_analyze_cc1 -fblocks -analyzer-store=region \ +// RUN: %clang_analyze_cc1 -fblocks \ // RUN: -analyzer-config optin.osx.cocoa.localizability.NonLocalizedStringChecker:AggressiveReport=true \ // RUN: -analyzer-checker=optin.osx.cocoa.localizability.NonLocalizedStringChecker \ // RUN: -analyzer-checker=optin.osx.cocoa.localizability.EmptyLocalizationContextChecker \ Index: clang/test/Analysis/keychainAPI-diagnostic-visitor.m =================================================================== --- clang/test/Analysis/keychainAPI-diagnostic-visitor.m +++ clang/test/Analysis/keychainAPI-diagnostic-visitor.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=osx.SecKeychainAPI -analyzer-store=region -analyzer-output=text -verify %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=osx.SecKeychainAPI -analyzer-output=text -verify %s // This file is for testing enhanced diagnostics produced by the default SecKeychainAPI checker. Index: clang/test/Analysis/ivars.m =================================================================== --- clang/test/Analysis/ivars.m +++ clang/test/Analysis/ivars.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-store=region -fblocks -verify -Wno-objc-root-class -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -fblocks -verify -Wno-objc-root-class -analyzer-config eagerly-assume=false %s void clang_analyzer_eval(int); Index: clang/test/Analysis/gmalloc.c =================================================================== --- clang/test/Analysis/gmalloc.c +++ clang/test/Analysis/gmalloc.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify %s +// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -verify %s #include "Inputs/system-header-simulator.h" Index: clang/test/Analysis/func.c =================================================================== --- clang/test/Analysis/func.c +++ clang/test/Analysis/func.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s void clang_analyzer_eval(int); void clang_analyzer_warnIfReached(void); Index: clang/test/Analysis/free.cpp =================================================================== --- clang/test/Analysis/free.cpp +++ clang/test/Analysis/free.cpp @@ -1,8 +1,8 @@ -// RUN: %clang_analyze_cc1 -fblocks -verify %s -analyzer-store=region \ +// RUN: %clang_analyze_cc1 -fblocks -verify %s \ // RUN: -analyzer-checker=core \ // RUN: -analyzer-checker=unix.Malloc // -// RUN: %clang_analyze_cc1 -fblocks -verify %s -analyzer-store=region \ +// RUN: %clang_analyze_cc1 -fblocks -verify %s \ // RUN: -analyzer-checker=core \ // RUN: -analyzer-checker=unix.Malloc \ // RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true Index: clang/test/Analysis/free.c =================================================================== --- clang/test/Analysis/free.c +++ clang/test/Analysis/free.c @@ -1,8 +1,8 @@ -// RUN: %clang_analyze_cc1 -fblocks -verify %s -analyzer-store=region \ +// RUN: %clang_analyze_cc1 -fblocks -verify %s \ // RUN: -analyzer-checker=core \ // RUN: -analyzer-checker=unix.Malloc // -// RUN: %clang_analyze_cc1 -fblocks -verify %s -analyzer-store=region \ +// RUN: %clang_analyze_cc1 -fblocks -verify %s \ // RUN: -analyzer-checker=core \ // RUN: -analyzer-checker=unix.Malloc \ // RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true Index: clang/test/Analysis/fields.c =================================================================== --- clang/test/Analysis/fields.c +++ clang/test/Analysis/fields.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,debug.ExprInspection %s -analyzer-store=region -verify +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,debug.ExprInspection %s -verify void clang_analyzer_eval(int); Index: clang/test/Analysis/elementtype.c =================================================================== --- clang/test/Analysis/elementtype.c +++ clang/test/Analysis/elementtype.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-store=region %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core %s typedef struct added_obj_st { int type; Index: clang/test/Analysis/disable-all-checks.c =================================================================== --- clang/test/Analysis/disable-all-checks.c +++ clang/test/Analysis/disable-all-checks.c @@ -1,12 +1,12 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region \ +// RUN: %clang_analyze_cc1 -analyzer-checker=core \ // RUN: -analyzer-disable-all-checks -verify %s // // RUN: %clang_analyze_cc1 -analyzer-disable-all-checks -analyzer-checker=core \ -// RUN: -analyzer-store=region -verify %s +// RUN: -verify %s // // RUN: %clang_analyze_cc1 -analyzer-disable-all-checks -verify %s // -// RUN: not %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region \ +// RUN: not %clang_analyze_cc1 -analyzer-checker=core \ // RUN: -analyzer-disable-checker non.existant.Checker -verify %s 2>&1 \ // RUN: | FileCheck %s // Index: clang/test/Analysis/deprecated-flags-and-options.cpp =================================================================== --- /dev/null +++ clang/test/Analysis/deprecated-flags-and-options.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core %s 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK + +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region %s 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK,DEPRECATED-STORE +// DEPRECATED-STORE: warning: analyzer option '-analyzer-store' is deprecated. This flag will be removed in clang-16, and passing this option will be an error. + +// RUN: %clang_analyze_cc1 -analyzer-checker=core %s --help 2>&1 \ +// RUN: | FileCheck %s --check-prefixes=CHECK-HELP +// CHECK-HELP: -analyzer-store <value> Source Code Analysis - Abstract Memory Store Models [DEPRECATED, removing in clang-16] + +int empty(int x) { + // CHECK: warning: Division by zero + return x ? 0 : 0 / x; +} Index: clang/test/Analysis/delegates.m =================================================================== --- clang/test/Analysis/delegates.m +++ clang/test/Analysis/delegates.m @@ -1,7 +1,6 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -Wno-objc-root-class -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount -Wno-objc-root-class -verify %s // expected-no-diagnostics - //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from // Foundation.h (Mac OS X). Index: clang/test/Analysis/default-diagnostic-visitors.c =================================================================== --- clang/test/Analysis/default-diagnostic-visitors.c +++ clang/test/Analysis/default-diagnostic-visitors.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core -analyzer-store=region -analyzer-output=text -verify %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core -analyzer-output=text -verify %s // This file is for testing enhanced diagnostics produced by the default BugReporterVisitors. Index: clang/test/Analysis/dead-stores.cpp =================================================================== --- clang/test/Analysis/dead-stores.cpp +++ clang/test/Analysis/dead-stores.cpp @@ -4,7 +4,7 @@ // RUN: -verify=non-nested %s // // RUN: %clang_analyze_cc1 -fcxx-exceptions -fexceptions -fblocks -std=c++11 \ -// RUN: -analyzer-store=region -analyzer-checker=deadcode.DeadStores \ +// RUN: -analyzer-checker=deadcode.DeadStores \ // RUN: -analyzer-config deadcode.DeadStores:WarnForDeadNestedAssignments=false\ // RUN: -Wno-unreachable-code -verify=non-nested %s // Index: clang/test/Analysis/cxx-method-names.cpp =================================================================== --- clang/test/Analysis/cxx-method-names.cpp +++ clang/test/Analysis/cxx-method-names.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix,osx,alpha.unix,alpha.security.taint -analyzer-store region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix,osx,alpha.unix,alpha.security.taint -verify %s // expected-no-diagnostics class Evil { Index: clang/test/Analysis/cstring-syntax-cxx.cpp =================================================================== --- clang/test/Analysis/cstring-syntax-cxx.cpp +++ clang/test/Analysis/cstring-syntax-cxx.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -verify %s // expected-no-diagnostics // Ensure we don't crash on C++ declarations with special names. Index: clang/test/Analysis/coverage.c =================================================================== --- clang/test/Analysis/coverage.c +++ clang/test/Analysis/coverage.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc -analyzer-store=region -analyzer-max-loop 4 -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc -analyzer-max-loop 4 -verify %s #include "Inputs/system-header-simulator.h" typedef __typeof(sizeof(int)) size_t; Index: clang/test/Analysis/concrete-address.c =================================================================== --- clang/test/Analysis/concrete-address.c +++ clang/test/Analysis/concrete-address.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify %s // expected-no-diagnostics void foo(void) { Index: clang/test/Analysis/chroot.c =================================================================== --- clang/test/Analysis/chroot.c +++ clang/test/Analysis/chroot.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.unix.Chroot -analyzer-store region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.unix.Chroot -verify %s extern int chroot(const char* path); extern int chdir(const char* path); Index: clang/test/Analysis/cfref_rdar6080742.c =================================================================== --- clang/test/Analysis/cfref_rdar6080742.c +++ clang/test/Analysis/cfref_rdar6080742.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify %s // expected-no-diagnostics // This test case was reported in <rdar:problem/6080742>. Index: clang/test/Analysis/cfref_PR2519.c =================================================================== --- clang/test/Analysis/cfref_PR2519.c +++ clang/test/Analysis/cfref_PR2519.c @@ -1,5 +1,5 @@ // UNSUPPORTED: -zos, -aix -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -verify %s // expected-no-diagnostics typedef unsigned char Boolean; Index: clang/test/Analysis/casts.m =================================================================== --- clang/test/Analysis/casts.m +++ clang/test/Analysis/casts.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify %s // expected-no-diagnostics // Test function pointer casts. Index: clang/test/Analysis/casts.cpp =================================================================== --- clang/test/Analysis/casts.cpp +++ clang/test/Analysis/casts.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core,debug.ExprInspection -verify %s void clang_analyzer_eval(bool); Index: clang/test/Analysis/casts.c =================================================================== --- clang/test/Analysis/casts.c +++ clang/test/Analysis/casts.c @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -Wno-pointer-to-int-cast -Wno-strict-prototypes -verify -analyzer-config eagerly-assume=false %s -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -Wno-pointer-to-int-cast -Wno-strict-prototypes -verify -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -Wno-pointer-to-int-cast -Wno-strict-prototypes -verify -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -Wno-pointer-to-int-cast -Wno-strict-prototypes -verify -analyzer-config eagerly-assume=false %s // RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -Wno-pointer-to-int-cast -Wno-strict-prototypes -verify -DEAGERLY_ASSUME=1 -w %s // RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -Wno-pointer-to-int-cast -Wno-strict-prototypes -verify -DEAGERLY_ASSUME=1 -DBIT32=1 -w %s Index: clang/test/Analysis/bstring.cpp =================================================================== --- clang/test/Analysis/bstring.cpp +++ clang/test/Analysis/bstring.cpp @@ -1,8 +1,8 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.cstring,unix.Malloc,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -verify -analyzer-config eagerly-assume=false %s -// RUN: %clang_analyze_cc1 -DUSE_BUILTINS -analyzer-checker=core,unix.cstring,unix.Malloc,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -verify -analyzer-config eagerly-assume=false %s -// RUN: %clang_analyze_cc1 -DVARIANT -analyzer-checker=core,unix.cstring,alpha.unix.cstring,unix.Malloc,debug.ExprInspection -analyzer-store=region -verify -analyzer-config eagerly-assume=false %s -// RUN: %clang_analyze_cc1 -DUSE_BUILTINS -DVARIANT -analyzer-checker=core,unix.cstring,alpha.unix.cstring,unix.Malloc,debug.ExprInspection -analyzer-store=region -verify -analyzer-config eagerly-assume=false %s -// RUN: %clang_analyze_cc1 -DSUPPRESS_OUT_OF_BOUND -analyzer-checker=core,unix.cstring,unix.Malloc,alpha.unix.cstring.BufferOverlap,alpha.unix.cstring.NotNullTerminated,debug.ExprInspection -analyzer-store=region -verify -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.cstring,unix.Malloc,alpha.unix.cstring,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -DUSE_BUILTINS -analyzer-checker=core,unix.cstring,unix.Malloc,alpha.unix.cstring,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -DVARIANT -analyzer-checker=core,unix.cstring,alpha.unix.cstring,unix.Malloc,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -DUSE_BUILTINS -DVARIANT -analyzer-checker=core,unix.cstring,alpha.unix.cstring,unix.Malloc,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s +// RUN: %clang_analyze_cc1 -DSUPPRESS_OUT_OF_BOUND -analyzer-checker=core,unix.cstring,unix.Malloc,alpha.unix.cstring.BufferOverlap,alpha.unix.cstring.NotNullTerminated,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s #include "Inputs/system-header-simulator-cxx.h" #include "Inputs/system-header-simulator-for-malloc.h" Index: clang/test/Analysis/bool-assignment.c =================================================================== --- clang/test/Analysis/bool-assignment.c +++ clang/test/Analysis/bool-assignment.c @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core.BoolAssignment,alpha.security.taint -analyzer-store=region -verify -std=c99 -Dbool=_Bool %s -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core.BoolAssignment,alpha.security.taint -analyzer-store=region -verify -x c++ %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core.BoolAssignment,alpha.security.taint -verify -std=c99 -Dbool=_Bool %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core.BoolAssignment,alpha.security.taint -verify -x c++ %s // Test C++'s bool and C's _Bool. // FIXME: We stopped warning on these when SValBuilder got smarter about Index: clang/test/Analysis/blocks.m =================================================================== --- clang/test/Analysis/blocks.m +++ clang/test/Analysis/blocks.m @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core -analyzer-store=region -fblocks -analyzer-opt-analyze-nested-blocks -verify -Wno-strict-prototypes %s -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core -analyzer-store=region -fblocks -analyzer-opt-analyze-nested-blocks -verify -x objective-c++ %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core -fblocks -analyzer-opt-analyze-nested-blocks -verify -Wno-strict-prototypes %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core -fblocks -analyzer-opt-analyze-nested-blocks -verify -x objective-c++ %s //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from Mac OS X headers: Index: clang/test/Analysis/array-struct.c =================================================================== --- clang/test/Analysis/array-struct.c +++ clang/test/Analysis/array-struct.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core.CastToStruct -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core.CastToStruct -verify %s struct s { int data; Index: clang/test/Analysis/analyzeOneFunction.m =================================================================== --- clang/test/Analysis/analyzeOneFunction.m +++ clang/test/Analysis/analyzeOneFunction.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyze-function="-[Test1 myMethodWithY:withX:]" -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyze-function="-[Test1 myMethodWithY:withX:]" -analyzer-checker=core,osx.cocoa.RetainCount -verify %s typedef signed char BOOL; typedef unsigned int NSUInteger; Index: clang/test/Analysis/PR7218.c =================================================================== --- clang/test/Analysis/PR7218.c +++ clang/test/Analysis/PR7218.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s char PR7218(char a) { char buf[2]; buf[0] = a; Index: clang/test/Analysis/PR3991.m =================================================================== --- clang/test/Analysis/PR3991.m +++ clang/test/Analysis/PR3991.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-store=region -verify -triple x86_64-apple-darwin9 -Wno-incomplete-implementation %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify -triple x86_64-apple-darwin9 -Wno-incomplete-implementation %s // expected-no-diagnostics //===----------------------------------------------------------------------===// Index: clang/test/Analysis/OSAtomic_mac.cpp =================================================================== --- clang/test/Analysis/OSAtomic_mac.cpp +++ clang/test/Analysis/OSAtomic_mac.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,osx -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,osx -verify -fblocks -analyzer-opt-analyze-nested-blocks %s // expected-no-diagnostics // Test handling of OSAtomicCompareAndSwap when C++ inserts "no-op" casts and we Index: clang/test/Analysis/NSWindow.m =================================================================== --- clang/test/Analysis/NSWindow.m +++ clang/test/Analysis/NSWindow.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core,deadcode.DeadStores -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core,deadcode.DeadStores -verify %s // These declarations were reduced using Delta-Debugging from Foundation.h // on Mac OS X. The test cases are below. Index: clang/test/Analysis/NSString.m =================================================================== --- clang/test/Analysis/NSString.m +++ clang/test/Analysis/NSString.m @@ -1,7 +1,7 @@ -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -analyzer-config mode=shallow -verify -Wno-objc-root-class %s -// RUN: %clang_analyze_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s -// RUN: %clang_analyze_cc1 -DOSATOMIC_USE_INLINED -triple i386-apple-darwin10 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -verify -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-config mode=shallow -verify -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -verify -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -DOSATOMIC_USE_INLINED -triple i386-apple-darwin10 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -verify -Wno-objc-root-class %s //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from Index: clang/test/Analysis/NSPanel.m =================================================================== --- clang/test/Analysis/NSPanel.m +++ clang/test/Analysis/NSPanel.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -verify -Wno-objc-root-class %s // expected-no-diagnostics // BEGIN delta-debugging reduced header stuff Index: clang/test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp =================================================================== --- clang/test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp +++ clang/test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator -analyzer-store region -std=c++11 -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator -std=c++11 -verify %s // expected-no-diagnostics typedef __typeof(sizeof(int)) size_t; Index: clang/test/Analysis/CGColorSpace.c =================================================================== --- clang/test/Analysis/CGColorSpace.c +++ clang/test/Analysis/CGColorSpace.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount -verify %s typedef struct CGColorSpace *CGColorSpaceRef; extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void); Index: clang/test/Analysis/CFRetainRelease_NSAssertionHandler.m =================================================================== --- clang/test/Analysis/CFRetainRelease_NSAssertionHandler.m +++ clang/test/Analysis/CFRetainRelease_NSAssertionHandler.m @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -verify %s -analyzer-store=region +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -verify %s // expected-no-diagnostics typedef struct objc_selector *SEL; Index: clang/test/Analysis/CFNumber.c =================================================================== --- clang/test/Analysis/CFNumber.c +++ clang/test/Analysis/CFNumber.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.coreFoundation.CFNumber,osx.cocoa.RetainCount -analyzer-store=region -verify -triple x86_64-apple-darwin9 %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.coreFoundation.CFNumber,osx.cocoa.RetainCount -verify -triple x86_64-apple-darwin9 %s typedef signed long CFIndex; typedef const struct __CFAllocator * CFAllocatorRef; Index: clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp =================================================================== --- clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -171,13 +171,7 @@ } // Create the analyzer component creators. - switch (Opts->AnalysisStoreOpt) { - default: - llvm_unreachable("Unknown store manager."); -#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATEFN) \ - case NAME##Model: CreateStoreMgr = CREATEFN; break; -#include "clang/StaticAnalyzer/Core/Analyses.def" - } + CreateStoreMgr = &CreateRegionStoreManager; switch (Opts->AnalysisConstraintsOpt) { default: Index: clang/lib/Frontend/CompilerInvocation.cpp =================================================================== --- clang/lib/Frontend/CompilerInvocation.cpp +++ clang/lib/Frontend/CompilerInvocation.cpp @@ -816,18 +816,6 @@ #include "clang/Driver/Options.inc" #undef ANALYZER_OPTION_WITH_MARSHALLING - if (Opts.AnalysisStoreOpt != RegionStoreModel) { - switch (Opts.AnalysisStoreOpt) { -#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN) \ - case NAME##Model: \ - GenerateArg(Args, OPT_analyzer_store, CMDFLAG, SA); \ - break; -#include "clang/StaticAnalyzer/Core/Analyses.def" - default: - llvm_unreachable("Tried to generate unknown analysis store."); - } - } - if (Opts.AnalysisConstraintsOpt != RangeConstraintsModel) { switch (Opts.AnalysisConstraintsOpt) { #define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN) \ @@ -915,20 +903,9 @@ #include "clang/Driver/Options.inc" #undef ANALYZER_OPTION_WITH_MARSHALLING - if (Arg *A = Args.getLastArg(OPT_analyzer_store)) { - StringRef Name = A->getValue(); - AnalysisStores Value = llvm::StringSwitch<AnalysisStores>(Name) -#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN) \ - .Case(CMDFLAG, NAME##Model) -#include "clang/StaticAnalyzer/Core/Analyses.def" - .Default(NumStores); - if (Value == NumStores) { - Diags.Report(diag::err_drv_invalid_value) - << A->getAsString(Args) << Name; - } else { - Opts.AnalysisStoreOpt = Value; - } - } + if (Arg *A = Args.getLastArg(OPT_analyzer_store)) + Diags.Report(diag::warn_analyzer_deprecated_option) << "-analyzer-store" + << "clang-16"; if (Arg *A = Args.getLastArg(OPT_analyzer_constraints)) { StringRef Name = A->getValue(); Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -3158,9 +3158,6 @@ static void RenderAnalyzerOptions(const ArgList &Args, ArgStringList &CmdArgs, const llvm::Triple &Triple, const InputInfo &Input) { - // Enable region store model by default. - CmdArgs.push_back("-analyzer-store=region"); - // Treat blocks as analysis entry points. CmdArgs.push_back("-analyzer-opt-analyze-nested-blocks"); Index: clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h =================================================================== --- clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h +++ clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h @@ -40,13 +40,6 @@ NumAnalyses }; -/// AnalysisStores - Set of available analysis store models. -enum AnalysisStores { -#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN) NAME##Model, -#include "clang/StaticAnalyzer/Core/Analyses.def" -NumStores -}; - /// AnalysisConstraints - Set of available constraint models. enum AnalysisConstraints { #define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN) NAME##Model, @@ -207,7 +200,6 @@ /// A key-value table of use-specified configuration values. // TODO: This shouldn't be public. ConfigTable Config; - AnalysisStores AnalysisStoreOpt = RegionStoreModel; AnalysisConstraints AnalysisConstraintsOpt = RangeConstraintsModel; AnalysisDiagClients AnalysisDiagOpt = PD_HTML; AnalysisPurgeMode AnalysisPurgeOpt = PurgeStmt; Index: clang/include/clang/StaticAnalyzer/Core/Analyses.def =================================================================== --- clang/include/clang/StaticAnalyzer/Core/Analyses.def +++ clang/include/clang/StaticAnalyzer/Core/Analyses.def @@ -10,13 +10,6 @@ // //===----------------------------------------------------------------------===// -#ifndef ANALYSIS_STORE -#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN) -#endif - -ANALYSIS_STORE(RegionStore, "region", "Use region-based analyzer store", - CreateRegionStoreManager) - #ifndef ANALYSIS_CONSTRAINTS #define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN) #endif @@ -94,7 +87,6 @@ NoRedundancy, "noredundancy", "Do not analyze a function which has been previously inlined") -#undef ANALYSIS_STORE #undef ANALYSIS_CONSTRAINTS #undef ANALYSIS_DIAGNOSTICS #undef ANALYSIS_PURGE Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -4996,8 +4996,9 @@ def analysis_CFGAddImplicitDtors : Flag<["-"], "cfg-add-implicit-dtors">, HelpText<"Add C++ implicit destructors to CFGs for all analyses">; +// We should remove this option in clang-16 release. def analyzer_store : Separate<["-"], "analyzer-store">, - HelpText<"Source Code Analysis - Abstract Memory Store Models">; + HelpText<"Source Code Analysis - Abstract Memory Store Models [DEPRECATED, removing in clang-16]">; def analyzer_store_EQ : Joined<["-"], "analyzer-store=">, Alias<analyzer_store>; def analyzer_constraints : Separate<["-"], "analyzer-constraints">, Index: clang/include/clang/Basic/DiagnosticGroups.td =================================================================== --- clang/include/clang/Basic/DiagnosticGroups.td +++ clang/include/clang/Basic/DiagnosticGroups.td @@ -15,6 +15,8 @@ ImplicitInt ]>; +def DeprecatedStaticAnalyzerFlag : DiagGroup<"deprecated-static-analyzer-flag">; + // Empty DiagGroups are recognized by clang but ignored. def ODR : DiagGroup<"odr">; def : DiagGroup<"abi">; Index: clang/include/clang/Basic/DiagnosticDriverKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticDriverKinds.td +++ clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -457,6 +457,10 @@ def err_analyzer_not_built_with_z3 : Error< "analyzer constraint manager 'z3' is only available if LLVM was built with " "-DLLVM_ENABLE_Z3_SOLVER=ON">; +def warn_analyzer_deprecated_option : Warning< + "analyzer option '%0' is deprecated. This flag will be removed in %1, and " + "passing this option will be an error.">, + InGroup<DeprecatedStaticAnalyzerFlag>; def warn_drv_needs_hvx : Warning< "%0 requires HVX, use -mhvx/-mhvx= to enable it">, Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -550,6 +550,11 @@ `strcmp``, ``strncmp``, ``strcpy``, ``strlen``, ``strsep`` and many more. Although this checker currently is in list of alpha checkers due to a false positive. +- Deprecate ``-analyzer-store region`` analyzer flag. + This flag is still accepted, but a warning will be displayed. + This flag will be rejected, thus turned into a hard error starting with + ``clang-16``. + .. _release-notes-ubsan: Undefined Behavior Sanitizer (UBSan)
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits