From aea7afdc1304cfef3b2cf61793729b1f55f26d0a Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 24 Jun 2015 22:02:08 +0000 Subject: Replace __double_underscored type nullability qualifiers with _Uppercase_underscored Addresses a conflict with glibc's __nonnull macro by renaming the type nullability qualifiers as follows: __nonnull -> _Nonnull __nullable -> _Nullable __null_unspecified -> _Null_unspecified This is the major part of rdar://problem/21530726, but does not yet provide the Darwin-specific behavior for the old names. llvm-svn: 240596 --- clang/lib/Basic/IdentifierTable.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'clang/lib/Basic/IdentifierTable.cpp') diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp index b2950081000..40b28222b8b 100644 --- a/clang/lib/Basic/IdentifierTable.cpp +++ b/clang/lib/Basic/IdentifierTable.cpp @@ -647,16 +647,17 @@ const char *clang::getOperatorSpelling(OverloadedOperatorKind Operator) { llvm_unreachable("Invalid OverloadedOperatorKind!"); } -StringRef clang::getNullabilitySpelling(NullabilityKind kind) { +StringRef clang::getNullabilitySpelling(NullabilityKind kind, + bool isContextSensitive) { switch (kind) { case NullabilityKind::NonNull: - return "__nonnull"; + return isContextSensitive ? "nonnull" : "_Nonnull"; case NullabilityKind::Nullable: - return "__nullable"; + return isContextSensitive ? "nullable" : "_Nullable"; case NullabilityKind::Unspecified: - return "__null_unspecified"; + return isContextSensitive ? "null_unspecified" : "_Null_unspecified"; } llvm_unreachable("Unknown nullability kind."); } -- cgit v1.2.3