mirror of https://github.com/microsoft/clang.git
Add __nonnull/__nullable/__null_unspecified predefines for Darwin.
Addresses the rest of rdar://problem/21530726. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240597 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
673b679df9
commit
9e31ec1a14
|
@ -868,6 +868,14 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
|
|||
"__attribute__((objc_ownership(none)))");
|
||||
}
|
||||
|
||||
// On Darwin, there are __double_underscored variants of the type
|
||||
// nullability qualifiers.
|
||||
if (TI.getTriple().isOSDarwin()) {
|
||||
Builder.defineMacro("__nonnull", "_Nonnull");
|
||||
Builder.defineMacro("__null_unspecified", "_Null_unspecified");
|
||||
Builder.defineMacro("__nullable", "_Nullable");
|
||||
}
|
||||
|
||||
// OpenMP definition
|
||||
if (LangOpts.OpenMP) {
|
||||
// OpenMP 2.2:
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
// RUN: %clang_cc1 %s -E -dM -triple i386-apple-darwin10 -o - | FileCheck %s --check-prefix=CHECK-DARWIN
|
||||
|
||||
// RUN: %clang_cc1 %s -E -dM -triple x86_64-unknown-linux -o - | FileCheck %s --check-prefix=CHECK-NONDARWIN
|
||||
|
||||
|
||||
// CHECK-DARWIN: #define __nonnull _Nonnull
|
||||
// CHECK-DARWIN: #define __null_unspecified _Null_unspecified
|
||||
// CHECK-DARWIN: #define __nullable _Nullable
|
||||
|
||||
// CHECK-NONDARWIN-NOT: __nonnull
|
||||
// CHECK-NONDARWIN: #define __clang__
|
||||
// CHECK-NONDARWIN-NOT: __nonnull
|
Loading…
Reference in New Issue