summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2015-06-19 18:27:45 +0000
committerDouglas Gregor <dgregor@apple.com>2015-06-19 18:27:45 +0000
commitbec595a6412104306926278f811fd7a75fd0d25f (patch)
tree93e5b56701b83f396d5c0ac172b15a9cc36fb275 /clang/lib/Parse
parenta59a7211f06a0ba306c4293be19b1b70e8d3ea3e (diff)
downloadbcm5719-llvm-bec595a6412104306926278f811fd7a75fd0d25f.tar.gz
bcm5719-llvm-bec595a6412104306926278f811fd7a75fd0d25f.zip
Check for consistent use of nullability type specifiers in a header.
Adds a new warning (under -Wnullability-completeness) that complains about pointer, block pointer, or member pointer declarations that have not been annotated with nullability information (directly or inferred) within a header that contains some nullability annotations. This is intended to be used to help maintain the completeness of nullability information within a header that has already been audited. Note that, for performance reasons, this warning will underrepresent the number of non-annotated pointers in the case where more than one pointer is seen before the first nullability type specifier, because we're only tracking one piece of information per header. Part of rdar://problem/18868820. llvm-svn: 240158
Diffstat (limited to 'clang/lib/Parse')
-rw-r--r--clang/lib/Parse/ParseObjc.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp
index a3cf4831e44..de347181bf3 100644
--- a/clang/lib/Parse/ParseObjc.cpp
+++ b/clang/lib/Parse/ParseObjc.cpp
@@ -317,14 +317,12 @@ static void addContextSensitiveTypeNullability(Parser &P,
bool &addedToDeclSpec) {
// Create the attribute.
auto getNullabilityAttr = [&]() -> AttributeList * {
- auto attr = D.getAttributePool().create(
- P.getNullabilityKeyword(nullability),
- SourceRange(nullabilityLoc),
- nullptr, SourceLocation(),
- nullptr, 0,
- AttributeList::AS_Keyword);
- attr->setContextSensitiveKeywordAttribute();
- return attr;
+ return D.getAttributePool().create(
+ P.getNullabilityKeyword(nullability),
+ SourceRange(nullabilityLoc),
+ nullptr, SourceLocation(),
+ nullptr, 0,
+ AttributeList::AS_ContextSensitiveKeyword);
};
if (D.getNumTypeObjects() > 0) {
OpenPOWER on IntegriCloud