diff options
Diffstat (limited to 'lib/Basic/IdentifierTable.cpp')
-rw-r--r-- | lib/Basic/IdentifierTable.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index 4e06352..b295008 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/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,17 @@ 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"; + } + llvm_unreachable("Unknown nullability kind."); +} |