hanchenye-llvm-project/clang/test/Analysis
Pavel Labath 02b64d46a0 [analyzer] Refactor conditional expression evaluating code
Summary:
Instead of digging through the ExplodedGraph, to figure out which edge brought
us here, I compute the value of conditional expression by looking at the
sub-expression values.

To do this, I needed to change the liveness algorithm a bit -- now, the full
conditional expression also depends on all atomic sub-expressions, not only the
outermost ones.

Reviewers: jordan_rose

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1340

llvm-svn: 189090
2013-08-23 07:19:22 +00:00
..
Inputs [analyzer] Treat std::initializer_list as opaque rather than aborting. 2013-07-17 17:16:33 +00:00
diagnostics [analyzer] Merge TextPathDiagnostics and ClangDiagPathDiagConsumer. 2013-08-16 01:06:30 +00:00
engine Add a new -Wundefined-inline warning for inline functions which are used but not 2013-02-01 08:13:20 +00:00
inlining [analyzer] Don't process autorelease counts in synthesized function bodies. 2013-08-01 22:16:36 +00:00
objc [analyzer] DirectIvarAssignment: allow suppression annotation on Ivars. 2013-01-17 23:24:58 +00:00
CFContainers-invalid.c
CFContainers.mm
CFDateGC.m
CFNumber.c
CFRetainRelease_NSAssertionHandler.m
CGColorSpace.c
CheckNSError.m
Malloc+MismatchedDeallocator+NewDelete.cpp [analyzer] Tests: move system functions into system header simulator files. 2013-04-15 20:39:37 +00:00
Malloc+MismatchedDeallocator_intersections.cpp [analyzer] Reduced the unwanted correlations between checkers living inside MallocChecker.cpp 2013-04-04 23:46:29 +00:00
Malloc+NewDelete_intersections.cpp [analyzer] Shorten the malloc checker’s leak message 2013-04-06 00:41:36 +00:00
MismatchedDeallocator-checker-test.mm [analyzer] Better name for the test. 2013-04-05 10:49:41 +00:00
MismatchedDeallocator-path-notes.cpp [analyzer] Enable the new edge algorithm by default. 2013-06-03 23:00:19 +00:00
MissingDealloc.m
NSContainers.m [analyzer] Use output form collections’ count to decide if ObjC for loop should be entered 2013-06-22 00:23:26 +00:00
NSPanel.m
NSString.m [analyzer] Place all inlining policy checks into one palce 2013-02-22 02:59:24 +00:00
NSWindow.m
NewDelete+MismatchedDeallocator_intersections.cpp [analyzer] Re-enable cplusplus.NewDelete (but not NewDeleteLeaks). 2013-04-05 17:55:07 +00:00
NewDelete-checker-test.cpp [analyzer] Warn when using 'delete' on an uninitialized variable. 2013-08-09 00:55:47 +00:00
NewDelete-custom.cpp [analyzer] Shorten the malloc checker’s leak message 2013-04-06 00:41:36 +00:00
NewDelete-intersections.mm [analyzer] Shorten the malloc checker’s leak message 2013-04-06 00:41:36 +00:00
NewDelete-path-notes.cpp [analyzer] Enable the new edge algorithm by default. 2013-06-03 23:00:19 +00:00
NewDelete-variadic.cpp [analyzer] Re-enable cplusplus.NewDelete (but not NewDeleteLeaks). 2013-04-05 17:55:07 +00:00
NoReturn.m Add a test case for 'analyzer_noreturn' on category methods. 2013-01-23 21:29:13 +00:00
OSAtomic_mac.cpp
ObjCProperties.m
ObjCRetSigs.m
PR2599.m
PR2978.m
PR3991.m Split "incomplete implementation" warnings for ObjC into separate warnings. 2013-03-27 00:02:21 +00:00
PR7218.c
PR9741.cpp
PR12905.c
additive-folding-range-constraints.c [analyzer] Teach constraint managers about unsigned comparisons. 2013-03-23 01:21:33 +00:00
additive-folding.cpp [analyzer] Teach constraint managers about unsigned comparisons. 2013-03-23 01:21:33 +00:00
analyzeOneFunction.m
analyze_display_progress.c
analyzer-config.c Revert "[analyzer] Add very limited support for temporary destructors" 2013-07-23 02:15:11 +00:00
analyzer-config.cpp Revert "[analyzer] Add very limited support for temporary destructors" 2013-07-23 02:15:11 +00:00
analyzer-stats.c [analyzer] Fix scan-build's -stats mode. 2013-03-14 17:18:30 +00:00
array-struct-region.c [analyzer] Tighten up safety in the use of lazy bindings. 2013-02-21 01:34:51 +00:00
array-struct-region.cpp
array-struct.c
auto-obj-dtors-cfg-output.cpp Remove useless 'XPASS: *' from tests 2013-01-25 22:20:24 +00:00
base-init.cpp [analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa". 2013-01-24 23:15:30 +00:00
bitwise-ops.c
blocks-no-inline.c [analyzer] Try constant-evaluation for all variables, not just globals. 2013-02-14 19:06:11 +00:00
blocks.m [analyzer] Don't crash if a block's signature just has the return type. 2013-05-30 18:14:27 +00:00
bool-assignment.c Re-apply "[analyzer] Model casts to bool differently from other numbers." 2013-05-01 18:19:59 +00:00
bstring.c
builtin-functions.cpp Omit arguments of __builtin_object_size from the CFG. 2013-08-19 16:27:28 +00:00
call-invalidation.cpp [analyzer] Invalidate regions indirectly accessible through const pointers. 2013-03-20 20:35:53 +00:00
casts.c Re-apply "[analyzer] Model casts to bool differently from other numbers." 2013-05-01 18:19:59 +00:00
casts.m [analyzer] Weaken assertion to account for pointer-to-integer casts. 2013-07-25 17:22:02 +00:00
cfg.cpp [analyzer] Add a triple to test/Analysis/cfg.cpp 2013-08-19 17:46:55 +00:00
cfref_PR2519.c
cfref_rdar6080742.c
check-deserialization.cpp
chroot.c
comparison-implicit-casts.cpp
complex-init-list.cpp
complex.c
concrete-address.c
conditional-operator-path-notes.c [analyzer] Enable the new edge algorithm by default. 2013-06-03 23:00:19 +00:00
conditional-operator.cpp [analyzer] Do not crash when processing binary "?:" in C++ 2013-04-15 22:38:07 +00:00
constant-folding.c
coverage.c [analyzer] Shorten the malloc checker’s leak message 2013-04-06 00:41:36 +00:00
crash-trace.c Remove line number from test/Analysis/crash-trace.c. 2013-07-23 16:12:18 +00:00
cstring-syntax-cxx.cpp [analyzer] Fix a crash in SyntaxCString checker when given a custom strncat. 2013-04-10 22:06:29 +00:00
cstring-syntax.c
ctor.mm [analyzer] Treat std::initializer_list as opaque rather than aborting. 2013-07-17 17:16:33 +00:00
cxx-crashes.cpp
cxx-for-range-cfg.cpp
cxx-for-range.cpp [analyzer; new edges] Simplify edges in a C++11 for-range loop. 2013-06-06 21:53:45 +00:00
cxx-method-names.cpp
cxx11-crashes.cpp Teach static analyzer about AttributedStmts 2013-07-02 09:38:48 +00:00
dead-stores.c [analyzer] Teach DeadStoreChecker to look though BO_Comma and disregard the LHS. 2013-04-25 21:52:35 +00:00
dead-stores.cpp Disable dead stores checker for template instantations. Fixes <rdar://problem/13213575>. 2013-02-18 07:18:28 +00:00
dead-stores.m
debug-CallGraph.c [analyzer] Re-apply r170826 and make the dumping of the GallGraph 2012-12-21 17:27:01 +00:00
default-analyze.m
default-diagnostic-visitors.c [analyzer] Use 'MemRegion::printPretty()' instead of assuming the region is a VarRegion. 2013-02-26 19:44:38 +00:00
delegates.m
derived-to-base.cpp Fix static analyzer crash when casting from an incomplete type 2013-06-20 07:45:01 +00:00
div-zero.cpp
domtest.c
dtor.cpp [analyzer] Enable pseudo-destructor expressions. 2013-07-23 02:15:20 +00:00
dtors-in-dtor-cfg-output.cpp Remove useless 'XPASS: *' from tests 2013-01-25 22:20:24 +00:00
dynamic-cast.cpp [analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa". 2013-01-24 23:15:30 +00:00
edges-new.mm [analyzer; alternate edges] Fix the edge locations in presence of macros. 2013-06-08 00:29:24 +00:00
elementtype.c
enum.cpp [analyzer] Replace isIntegerType() with isIntegerOrEnumerationType(). 2013-04-09 02:30:33 +00:00
exceptions.mm
exercise-ps.c
fields.c [analyzer] Special-case bitfields when finding sub-region bindings. 2013-03-01 23:03:17 +00:00
free.c [analyzer] These implements unix.MismatchedDeallocatorChecker checker. 2013-03-28 17:05:19 +00:00
func.c
global-region-invalidation.c [analyzer] Re-enable using global regions as a symbolic base. 2013-04-15 20:39:45 +00:00
global_region_invalidation.mm [analyzer] Re-enable using global regions as a symbolic base. 2013-04-15 20:39:45 +00:00
html-diags-multifile.c Replace 'grep foo | count 0' with 'not grep foo'. 2013-07-04 15:22:16 +00:00
html-diags-multifile.h
html-diags.c Add a test case for r185707/PR16547. 2013-07-05 15:51:00 +00:00
idempotent-operations-limited-loops.c
idempotent-operations.c
idempotent-operations.cpp
idempotent-operations.m
initializer.cpp [analyzer] Handle C++11 member initializer expressions. 2013-07-17 17:16:42 +00:00
initializers-cfg-output.cpp Remove useless 'XPASS: *' from tests 2013-01-25 22:20:24 +00:00
inline-not-supported.c
inline-plist.c [analyzer] Enable the new edge algorithm by default. 2013-06-03 23:00:19 +00:00
inline-unique-reports.c [analyzer] Enable the new edge algorithm by default. 2013-06-03 23:00:19 +00:00
inline.c Fix a crash in the static analyzer (bug #16307) 2013-06-19 08:19:56 +00:00
inline.cpp [analyzer] Handle C string default values for const char * arguments. 2013-07-17 17:16:38 +00:00
inline2.c
inline3.c
inline4.c
ivars.m
keychainAPI-diagnostic-visitor.m
keychainAPI.m [analyzer] Fix a false positive in Secure Keychain API checker. 2013-01-07 19:13:00 +00:00
lambdas.cpp
logical-ops.c [analyzer] Refactor conditional expression evaluating code 2013-08-23 07:19:22 +00:00
lvalue.cpp
malloc-annotations.c [analyzer] Shorten the malloc checker’s leak message 2013-04-06 00:41:36 +00:00
malloc-interprocedural.c [analyzer] Shorten the malloc checker’s leak message 2013-04-06 00:41:36 +00:00
malloc-overflow.c
malloc-overflow.cpp
malloc-plist.c [analyzer] Enable the new edge algorithm by default. 2013-06-03 23:00:19 +00:00
malloc-sizeof.c
malloc.c [analyzer] Assume that strings are no longer than SIZE_MAX/4. 2013-08-19 16:27:34 +00:00
malloc.cpp [analyzer] Consolidate constant evaluation logic in SValBuilder. 2013-05-01 23:10:44 +00:00
malloc.m [analyzer] Malloc checker should only escape the receiver when “[O init..]” is called. 2013-05-31 23:47:32 +00:00
malloc.mm [analyzer] Switched to checkPreCall interface for detecting usage after free. 2013-04-10 22:21:41 +00:00
member-expr.cpp
method-arg-decay.m Split "incomplete implementation" warnings for ObjC into separate warnings. 2013-03-27 00:02:21 +00:00
method-call-intra-p.cpp
method-call-path-notes.cpp [analyzer] Enable the new edge algorithm by default. 2013-06-03 23:00:19 +00:00
method-call.cpp [analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa". 2013-01-24 23:15:30 +00:00
misc-ps-64.m
misc-ps-arm.m
misc-ps-cxx0x.cpp
misc-ps-eager-assume.m
misc-ps-ranges.m
misc-ps-region-store-i386.m
misc-ps-region-store-x86_64.m
misc-ps-region-store.cpp Add test case for PR 12921. 2013-03-22 21:30:22 +00:00
misc-ps-region-store.m Fixes a typo in my last patch. 2013-03-27 21:33:52 +00:00
misc-ps-region-store.mm
misc-ps.c [analyzer] Accept references to variables declared "extern void" (C only). 2013-05-29 20:50:34 +00:00
misc-ps.m
new-with-exceptions.cpp
new.cpp [analyzer] Remove bogus assert: in C++11, 'new' can do list-initialization. 2013-07-10 19:14:10 +00:00
nil-receiver-undefined-larger-than-voidptr-ret-region.m
nil-receiver-undefined-larger-than-voidptr-ret.m Fix FileCheck --check-prefix lines. 2013-08-12 12:51:05 +00:00
no-exit-cfg.c
no-outofbounds.c
nonnull.m
null-deref-path-notes.m [analyzer] Enable the new edge algorithm by default. 2013-06-03 23:00:19 +00:00
null-deref-ps-region.c
null-deref-ps.c
nullptr.cpp [analyzer] Treat nullPtrType as a location type. 2013-07-12 17:58:33 +00:00
objc-arc.m [analyzer] Look through ExprWithCleanups to see if an expr's consumed. 2013-06-06 01:57:24 +00:00
objc-bool.m
objc-boxing.m [analyzer] Shorten the malloc checker’s leak message 2013-04-06 00:41:36 +00:00
objc-for.m [analyzer] Use output form collections’ count to decide if ObjC for loop should be entered 2013-06-22 00:23:26 +00:00
objc-method-coverage.m Partly revert "Move clang tests that depend on llvm/ADT/Statistic.h to a subdir". 2013-03-11 17:48:03 +00:00
objc-properties.m
objc-string.mm [analyzer] Consolidate constant evaluation logic in SValBuilder. 2013-05-01 23:10:44 +00:00
objc-subscript.m [analyzer] RetainCountChecker: Clean up path notes for autorelease. 2013-04-23 01:42:25 +00:00
objc_invalidation.m [analyzer] IvarInvalidation: correctly handle cases where only partial invalidators exist 2013-04-24 02:49:16 +00:00
operator-calls.cpp [analyzer] Don't crash if we cache out after making a temporary region. 2013-04-18 16:33:40 +00:00
out-of-bounds.c [analyzer] Accept references to variables declared "extern void" (C only). 2013-05-29 20:50:34 +00:00
outofbound-notwork.c
outofbound.c
override-werror.c
plist-html-macros.c
plist-macros.cpp [analyzer; alternate edges] Fix the edge locations in presence of macros. 2013-06-08 00:29:24 +00:00
plist-output-alternate.m [analyzer] Enable the new edge algorithm by default. 2013-06-03 23:00:19 +00:00
plist-output.m [analyzer] Enable the new edge algorithm by default. 2013-06-03 23:00:19 +00:00
pointer-to-member.cpp [analyzer] Pointers-to-members are (currently) Locs, not NonLocs. 2013-07-02 16:50:24 +00:00
pr4209.m Split "incomplete implementation" warnings for ObjC into separate warnings. 2013-03-27 00:02:21 +00:00
pr_2542_rdar_6793404.m
pr_4164.c
properties.m [analyzer] RetainCountChecker: Clean up path notes for autorelease. 2013-04-23 01:42:25 +00:00
pthreadlock.c
ptr-arith.c [analyzer] Use a more generic MemRegion.getAsOffset to evaluate bin operators on MemRegions 2013-05-28 17:31:43 +00:00
ptr-arith.cpp [analyzer] Use a more generic MemRegion.getAsOffset to evaluate bin operators on MemRegions 2013-05-28 17:31:43 +00:00
rdar-6442306-1.m
rdar-6540084.m improve of note message and minor refactoring of my last 2013-05-15 15:27:35 +00:00
rdar-6541136-region.c
rdar-6562655.m
rdar-6600344-nil-receiver-undefined-struct-ret.m
rdar-7168531.m
redefined_system.c
refcnt_naming.m [analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa". 2013-01-24 23:15:30 +00:00
reference.cpp [analyzer] Use the expression’s type instead of region’s type in ArrayToPointer decay evaluation 2013-05-28 23:24:01 +00:00
reference.mm [analyzer] Warn when nil receiver results in forming null reference 2013-04-03 19:28:19 +00:00
region-1.m
region-store.c [analyzer] Set concrete offset bindings to UnknownVal when processing symbolic offset binding, even if no bindings are present. 2013-03-25 20:43:24 +00:00
region-store.cpp [analyzer] Do not believe lazy binding when symbolic region types do not match 2013-03-19 22:38:09 +00:00
reinterpret-cast.cpp [analyzer] Re-enable reasoning about CK_LValueBitCast 2013-05-28 22:32:08 +00:00
retain-release-cf-audited.m [analyzer] Don't let cf_audited_transfer override CFRetain semantics. 2013-03-04 23:21:32 +00:00
retain-release-gc-only.m
retain-release-inline.m [analyzer] Better test for r178063. 2013-03-26 23:58:52 +00:00
retain-release-path-notes-gc.m [analyzer] Merge TextPathDiagnostics and ClangDiagPathDiagConsumer. 2013-08-16 01:06:30 +00:00
retain-release-path-notes.m [analyzer] Merge TextPathDiagnostics and ClangDiagPathDiagConsumer. 2013-08-16 01:06:30 +00:00
retain-release-region-store.m
retain-release.m [analyzer] RetainCountChecker: don't track through xpc_connection_set_context. 2013-05-02 01:51:40 +00:00
retain-release.mm [analyzer] Fix a crash in RetainCountChecker - we should not rely on CallEnter::getCallExpr to return non-NULL 2013-04-25 00:41:32 +00:00
security-syntax-checks-no-emit.c
security-syntax-checks.m Check the canonical parameter type with getAs<>() in a static checker 2013-06-24 16:56:16 +00:00
self-init.m [analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa". 2013-01-24 23:15:30 +00:00
shallow-mode.m [analyzer] Add "-analyzer-config mode=[deep|shallow] ". 2013-01-24 23:15:34 +00:00
simple-stream-checks.c [analyzer] Indirect invalidation counts as an escape for leak checkers. 2013-05-10 17:07:16 +00:00
sizeofpointer.c
stack-addr-ps.c
stack-addr-ps.cpp [analyzer] Fix FP warnings when binding a temporary to a local static variable 2013-07-26 11:50:42 +00:00
stack-block-returned.cpp
stackaddrleak.c Re-apply "[analyzer] Model casts to bool differently from other numbers." 2013-05-01 18:19:59 +00:00
static_local.m
stats.c Partly revert "Move clang tests that depend on llvm/ADT/Statistic.h to a subdir". 2013-03-11 17:48:03 +00:00
stream.c
string-fail.c
string.c [analyzer] Assume that strings are no longer than SIZE_MAX/4. 2013-08-19 16:27:34 +00:00
superclass.m [analyzer] Generalize ObjCMissingSuperCallChecker. 2012-12-13 03:06:45 +00:00
svalbuilder-logic.c Re-apply "[analyzer] Model casts to bool differently from other numbers." 2013-05-01 18:19:59 +00:00
taint-generic.c [analyzer] Teach ConstraintManager to ignore NonLoc <> NonLoc comparisons. 2013-03-24 20:25:22 +00:00
taint-tester.c [analyzer] Tests: move system functions into system header simulator files. 2013-04-15 20:39:37 +00:00
taint-tester.cpp
taint-tester.m
temp-obj-dtors-cfg-output.cpp Revert "[analyzer] Add very limited support for temporary destructors" 2013-07-23 02:15:11 +00:00
templates.cpp [analyzer] Don't crash if a block doesn't have a type signature. 2013-05-22 18:09:44 +00:00
temporaries.cpp [analyzer] Enable usage of temporaries in InitListExprs 2013-08-09 07:46:29 +00:00
test-objc-non-nil-return-value-checker.m
test-variably-modified-types.c
traversal-algorithm.mm
traversal-path-unification.c [analyzer] Rename callback EndPath -> EndFunction 2013-01-03 00:25:29 +00:00
undef-buffers.c
uninit-msg-expr.m
uninit-ps-rdar6145427.m
uninit-sometimes.cpp Use some heuristics so that when a fixit removes a source range, we try 2012-12-20 21:05:53 +00:00
uninit-vals-ps-region.m [analyzer] Do not report uninitialized value warnings inside swap functions. 2013-06-18 23:16:15 +00:00
uninit-vals-ps.c [analyzer] Don't warn for returning void expressions in void blocks. 2013-04-17 18:03:48 +00:00
uninit-vals.m [analyzer] "Force" LazyCompoundVals on bind when they are simple enough. 2013-04-18 16:33:46 +00:00
unions-region.m
unions.cpp
unix-fns.c [analyzer] Address Jordan’s code review for r183451 2013-06-06 22:32:11 +00:00
unreachable-code-path.c [analyzer] Don't run unreachable code checker on inlined functions. 2013-08-19 17:03:12 +00:00
unused-ivars.m
variadic-method-types.m
virtualcall.cpp
virtualcall.h