]> granicus.if.org Git - clang/commit
Introduced pragmas for audited nullability regions.
authorDouglas Gregor <dgregor@apple.com>
Fri, 19 Jun 2015 18:25:57 +0000 (18:25 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 19 Jun 2015 18:25:57 +0000 (18:25 +0000)
commit109dad2dfc7f1f23e826832aee0d77a51fbf4d6c
tree1aea1366a2c526ebd9c5904fec89fbfddec0dd8e
parenta9b97e51df20b5d2d3de662a82cd73c12422b3dc
Introduced pragmas for audited nullability regions.

Introduce the clang pragmas "assume_nonnull begin" and "assume_nonnull
end" in which we make default assumptions about the nullability of many
unannotated pointers:

  - Single-level pointers are inferred to __nonnull
  - NSError** in a (function or method) parameter list is inferred to
    NSError * __nullable * __nullable.
  - CFErrorRef * in a (function or method) parameter list is inferred
    to CFErrorRef __nullable * __nullable.
  - Other multi-level pointers are never inferred to anything.

Implements rdar://problem/19191042.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240156 91177308-0d34-0410-b5e6-96231b3b80d8
18 files changed:
include/clang/Basic/DiagnosticLexKinds.td
include/clang/Lex/Preprocessor.h
include/clang/Parse/Parser.h
include/clang/Sema/DeclSpec.h
include/clang/Sema/Sema.h
lib/Lex/PPDirectives.cpp
lib/Lex/PPLexerChange.cpp
lib/Lex/PPMacroExpansion.cpp
lib/Lex/Pragma.cpp
lib/Parse/ParseObjc.cpp
lib/Sema/SemaExprObjC.cpp
lib/Sema/SemaObjCProperty.cpp
lib/Sema/SemaType.cpp
test/SemaObjC/arc-property-decl-attrs.m
test/SemaObjCXX/Inputs/nullability-pragmas-1.h [new file with mode: 0644]
test/SemaObjCXX/Inputs/nullability-pragmas-2.h [new file with mode: 0644]
test/SemaObjCXX/Inputs/nullability-pragmas-3.h [new file with mode: 0644]
test/SemaObjCXX/nullability-pragmas.mm [new file with mode: 0644]