[analyzer] Nullability: Don't warn along paths where null returned from non-null.
authorDevin Coughlin <dcoughlin@apple.com>
Mon, 28 Mar 2016 20:30:25 +0000 (20:30 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Mon, 28 Mar 2016 20:30:25 +0000 (20:30 +0000)
commit77942db0b8ae4799fa9cbd2f4b9872397b94bd43
tree8ba518779a36f89a54dba0ba6f521258851a583a
parent0afa32cd5977ec98f44c807c0426d779f3800b13
[analyzer] Nullability: Don't warn along paths where null returned from non-null.

Change the nullability checker to not warn along paths where null is returned from
a method with a non-null return type, even when the diagnostic for this return
has been suppressed. This prevents warning from methods with non-null return types
that inline methods that themselves return nil but that suppressed the diagnostic.

Also change the PreconditionViolated state component to be called "InvariantViolated"
because it is set when a post-condition is violated, as well.

rdar://problem/25393539

llvm-svn: 264647
clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
clang/test/Analysis/Inputs/system-header-simulator-for-nullability.h
clang/test/Analysis/nullability-no-arc.mm