summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2015-06-24 22:02:08 +0000
committerDouglas Gregor <dgregor@apple.com>2015-06-24 22:02:08 +0000
commitaea7afdc1304cfef3b2cf61793729b1f55f26d0a (patch)
tree80670a6c9757e83d93e42c74128d0730cbaea889 /clang/lib/Basic/IdentifierTable.cpp
parent63d606bdcb606ace3cea3455dcaf0c3dac108d4e (diff)
downloadbcm5719-llvm-aea7afdc1304cfef3b2cf61793729b1f55f26d0a.tar.gz
bcm5719-llvm-aea7afdc1304cfef3b2cf61793729b1f55f26d0a.zip
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
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
-rw-r--r--clang/lib/Basic/IdentifierTable.cpp9
1 files changed, 5 insertions, 4 deletions
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.");
}
OpenPOWER on IntegriCloud