diff options
author | Devin Coughlin <dcoughlin@apple.com> | 2016-04-13 00:41:54 +0000 |
---|---|---|
committer | Devin Coughlin <dcoughlin@apple.com> | 2016-04-13 00:41:54 +0000 |
commit | b2d2a018d6383f6e568de4de056f80433f32bf5f (patch) | |
tree | a1a7fbf1c903e46adf44dcf01b42cd922300274c /llvm/lib/CodeGen/RegAllocBasic.cpp | |
parent | 887d4767b74bf9be18d81b1f4884a220697a921f (diff) | |
download | bcm5719-llvm-b2d2a018d6383f6e568de4de056f80433f32bf5f.tar.gz bcm5719-llvm-b2d2a018d6383f6e568de4de056f80433f32bf5f.zip |
[analyzer] Nullability: Treat nil _Nonnull ivar as invariant violation.
Treat a _Nonnull ivar that is nil as an invariant violation in a similar
fashion to how a nil _Nonnull parameter is treated as a precondition violation.
This avoids warning on defensive returns of nil on defensive internal
checks, such as the following common idiom:
@class InternalImplementation
@interface PublicClass {
InternalImplementation * _Nonnull _internal;
}
-(id _Nonnull)foo;
@end
@implementation PublicClass
-(id _Nonnull)foo {
if (!_internal)
return nil; // no-warning
return [_internal foo];
}
@end
rdar://problem/24485171
llvm-svn: 266157
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocBasic.cpp')
0 files changed, 0 insertions, 0 deletions