diff options
author | Douglas Gregor <dgregor@apple.com> | 2015-06-19 18:14:38 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2015-06-19 18:14:38 +0000 |
commit | 813a066f16df52783708fdc2ef708bb76a9ff521 (patch) | |
tree | 0657ccae705e2a09c50dd92d26d645bff370aded /clang/lib/Basic/IdentifierTable.cpp | |
parent | b4866e85e5ffa0d352d496958582f0983172dc01 (diff) | |
download | bcm5719-llvm-813a066f16df52783708fdc2ef708bb76a9ff521.tar.gz bcm5719-llvm-813a066f16df52783708fdc2ef708bb76a9ff521.zip |
Extend type nullability qualifiers for Objective-C.
Introduce context-sensitive, non-underscored nullability specifiers
(nonnull, nullable, null_unspecified) for Objective-C method return
types, method parameter types, and properties.
Introduce Objective-C-specific semantics, including computation of the
nullability of the result of a message send, merging of nullability
information from the @interface of a class into its @implementation,
etc .
This is the Objective-C part of rdar://problem/18868820.
llvm-svn: 240154
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
-rw-r--r-- | clang/lib/Basic/IdentifierTable.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp index 4e06352d31d..0349ef463bf 100644 --- a/clang/lib/Basic/IdentifierTable.cpp +++ b/clang/lib/Basic/IdentifierTable.cpp @@ -16,6 +16,7 @@ #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/OperatorKinds.h" +#include "clang/Basic/Specifiers.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/SmallString.h" @@ -645,3 +646,16 @@ const char *clang::getOperatorSpelling(OverloadedOperatorKind Operator) { llvm_unreachable("Invalid OverloadedOperatorKind!"); } + +StringRef clang::getNullabilitySpelling(NullabilityKind kind) { + switch (kind) { + case NullabilityKind::NonNull: + return "__nonnull"; + + case NullabilityKind::Nullable: + return "__nullable"; + + case NullabilityKind::Unspecified: + return "__null_unspecified"; + } +} |