aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-04-15 22:06:22 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-04-15 22:06:22 +0000
commit5272adfe7066c4847b7339a75777252de64e79c2 (patch)
treebf7288b8f4220ef215723adc67d385f078f60b40 /lib/Sema/SemaExprObjC.cpp
parent7d2b8c1fcc2b707be78b09930a7767477822462f (diff)
Enforce nonnull __attribute__ on Objective-C method calls.
// rdar://9287695 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129615 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r--lib/Sema/SemaExprObjC.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index c769b856cd..cacc846028 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -324,6 +324,12 @@ bool Sema::CheckMessageArgumentTypes(Expr **Args, unsigned NumArgs,
Args[NumArgs-1]->getLocEnd());
}
}
+ // diagnose nonnull arguments.
+ for (specific_attr_iterator<NonNullAttr>
+ i = Method->specific_attr_begin<NonNullAttr>(),
+ e = Method->specific_attr_end<NonNullAttr>(); i != e; ++i) {
+ CheckNonNullArguments(*i, Args, lbrac);
+ }
DiagnoseSentinelCalls(Method, lbrac, Args, NumArgs);
return IsError;