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)
commit2a20bd1a945705e3a3845e3d4ef6c3cb68d938c7
treefdda46a505a45931089192a51a5c231fe66f7298
parent849ebc269fe17def169c812f929746cb98955664
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.

llvm-svn: 240156
18 files changed:
clang/include/clang/Basic/DiagnosticLexKinds.td
clang/include/clang/Lex/Preprocessor.h
clang/include/clang/Parse/Parser.h
clang/include/clang/Sema/DeclSpec.h
clang/include/clang/Sema/Sema.h
clang/lib/Lex/PPDirectives.cpp
clang/lib/Lex/PPLexerChange.cpp
clang/lib/Lex/PPMacroExpansion.cpp
clang/lib/Lex/Pragma.cpp
clang/lib/Parse/ParseObjc.cpp
clang/lib/Sema/SemaExprObjC.cpp
clang/lib/Sema/SemaObjCProperty.cpp
clang/lib/Sema/SemaType.cpp
clang/test/SemaObjC/arc-property-decl-attrs.m
clang/test/SemaObjCXX/Inputs/nullability-pragmas-1.h [new file with mode: 0644]
clang/test/SemaObjCXX/Inputs/nullability-pragmas-2.h [new file with mode: 0644]
clang/test/SemaObjCXX/Inputs/nullability-pragmas-3.h [new file with mode: 0644]
clang/test/SemaObjCXX/nullability-pragmas.mm [new file with mode: 0644]